• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] I'm having odd script issues.

7
Posts
10
Years
This has been driving me crazy but I'm making a script on the ground and setting the variable at 8002.
I'm then using the following script in the script square.
Pksv UI script:
Spoiler:

Sorry for my spaghetti code.

However, it seems the first time the script is walked on the player isn't moved. After the first flag (219), the player is always moved down regardless of the direction the script was walked on, and the second flag (21C ), once again won't move the player after going through the text it just releases all and ends. The final flag (21A) is working as intended it locks then releases and ends. can anyone tell me why this is happening? I just don't understand, it makes no sense.
If anyone can help me it would be very much appreciated. Thanks!
 
7
Posts
10
Years
I'm going to try bumping this thread as I still need help sorry if it's against the rules. I couldn't find anything on it being disallowed.
 

Bela

Banned
262
Posts
15
Years
Oh man. That is very spaghetti scripting there.

I think your issue may have something to do with relying on PLAYERFACING to trigger your player's movement, which btw I think is a weird thing to do in a script anyway. Usually, you just allow the player to move the player on their own, not force them to move in a direction. That's just a minor game design critique for you, though. PLAYERFACING (var 0x800C in FireRed) only updates when you press the A button, so you can't reliably use it in event tiles like this.

I think you should rewrite this event, and use a single var instead of flags for the conditions. Tile scripts are more suited to var use anyway! I think it would look something like this:

(This is in XSE format, and assumes your script uses var 4001, a temp var used in events like the Safari Zone entrance scripts)

Code:
#org @event
lockall
compare 0x4050 0x3
if 0x4 goto @finished
compare 0x4050 0x2
if 0x1 goto @afterwarp
compare 0x4050 0x1
if 0x1 goto @staycave
msgbox @voice 0x4 'This is a preference of mine, used with closeonkeypress
closeonkeypress
setvar 0x4001 0x1
releaseall
end

#org @afterwarp
msgbox @serious 0x4
closeonkeypress
setvar 0x4001 0x1
releaseall
end

#org @afterwarp
msgbox @water 0x4
closeonkeypress
setvar 0x4050 0x2
setvar 0x4001 0x1
releaseall
end
 
7
Posts
10
Years
Ahh, thanks for the response I've been busy and didn't have a chance to reply. (Sorry about the bump. Mods, feel free to lock if this was against the rules.)
 
Back
Top