QUOTE (Niclas @ Dec 21 2011, 12:41 PM)
@Digioso: Yeah, sure!
Thanks and I started working on it a couple of minutes ago.
But it didn't take me long to find out that this is not going to work.
With the current setup in my script I only have one "layer". The switch or event.
For self switches I'd need two: The Event and the Self Switch.
And for this I'd have to basically make a copy of everything I have, edit it for self switches and then paste it.
In that case - your script already exists so no need to try to make a copy of it.
But I found one possible bug in your script.
Your're checking for [A-Z] here.
I didn't test what the game does if it encounters a self switch > D. My guess is that it crashes. So the best thing is to not even allow this.
I didn't check what area.name.scan returns when the regex isn't matched. If it returns false then you could do a [A-D] instead of [A-Z] here and do a if(area.name.scan ...).
If it doesn't return anything usable you could check the content of s2 after s2 = $2.to_s and see whether there's only A-D in there. And if not do a print or whatever so that the developer sees that he did something wrong.
And you could add an /i at the end of the scan to allow lower case as well. I don't know if the game allows the self switches to be lowercase. If it doesn't you have to convert it to uppercase (with s2.upcase) again but at least the user has the option to use lowercase.
Anyway, good work and I'll keep this script in mind in case I need it. More options are always good.
This post has been edited by Digioso: Dec 23 2011, 03:42 PM