Hello everyone,
I'm having some trouble compiling my scripts...
The script I'm using is:
I want to make a certain area where only players who have defeated the league champion can go, I added a script tile in the hall of fame that sets the players flag 994.
When I compiled it and added the offset to the script tile in Advance Map, it works and looks fine, but when I trigger it in game, the script resets into this:
(I used free space finder to find a free offset, when I checked it, it was empty/free, but after it resetted to the script above, it stays like that)
I have no idea what causes this :/.
More info:
Advance map version: 1.9.5
XSE version: 1.1.1
Pokemon version: Emerald
Experience: little ;D
Mail:
[email protected]
Please get back to me a.s.a.p. :0.
Sincerely,
DoC
You did look for free space, but the commands you used at 527702 take up space that is written over 527703 and 527704. For example, the checkflag command needs X bytes and the goto one needs Y bytes, so your next offset should be X+Y bytes after 527702. I suggest simply scripting dynamically, you simply define an offset at the beginning and the script editor compiles everything in free space and returns the offsets used to you. So for example:
#dynamic 0x80000
#org @start
checkflag 0x994
if 0x1 goto @next
end
#org @next
lockall
msgbox @message MSG_KEEPOPEN '"Hmmm[.] \pI should beat the\nPokém..."
closeonkeypress
applymovement MOVE_PLAYER @move
waitmovement 0x0
releaseall
end
#org @message
= Hmmm[.] \pI should beat the\nPokémon league first!
#org @move
#raw 0x9 'Step Up (Normal)
#raw 0xFE 'End of Movements
I put an end command after the checkflag, since if the flag is not set the game will freeze otherwise.
Also, if you're using trigger scripts, I suggest not using flags at all since they're unnecessary. Trigger scripts take a variable value and a number. So for example, if your script's variable value is 52C0 and its variable value is 0, the trigger script will always be executed as long as 52C0's value in the game is 0, which is the default value. So instead of setting a flag, once the
setvar 0x52C0 0x1 command is executed in any script, your trigger script would not execute again, unless you set the variable's value to 0 again.