I've been trying to create a rom hack for Pokemon Fire red. For some reason when I step on a tile that has a script event my game soft locks. Any help appreciated.
assign a variable? as in, set a flag? yes ive done that.
Okay. Compile the script, assign it to a script tile (green with an S) and not a person.
Now test it in the ROM. Then look at this spoiler.
Spoiler:Didn't work, did it? Froze on the spot. You're going to need to change this...
![]()
to this....
![]()
Try it now. Worked perfectly, didn't it?
No, like this...
No, like this...
Should every script event have those exact values?
Should every script event have those exact values?
Those numbers are used to let the script run only in certain circumstances.
You can use variables from 4011 to 40FF. The script will run only when the variable's value is the one you wrote in "Var value".
Assuming that the current value of 4011 is 0, if you put "setvar 0x4011 0x1" in your script it will run just once since at its end 4011's value won't be 0 anymore.
should i always use the "setvar 0x???? 0x1" command? considering most scripts only run once.
Well it is recommended. What matters is that the script runs only if the variable you put has the value you put (on Advance Map I mean).
heres on of the scripts i wrote.
The 40XX value doesn't change but the other number changes because you set it in a script. Yes flags do work like that but if you have script events (green ones) then they need a var number and value to work. You also need them for level scripts. Flags are more used for person events as they are only on or off.
Don't use flag 0x1004(doesn't even exist), there's a list of flags on ths forum should come up on google.
A person number of 290b is super high, you'd usually use something less than 10(hex). The max is FF anyway.
#dynamic 0x72395E
#org @start
lockall
checkflag 0x1004
if 0x1 goto @done
countpokemon
compare 0x800D 0x1
if 0x1 goto @continue
applymovement 0xY @move
msgbox @1 0x6
applymovement 0xFF @movehero
waitmovement 0x0
applymovement 0xY @move1
waitmovement 0x0
release
end
#org @continue
lockall
applymovement 0xY @move
waitmovement 0x0
bufferfirstpokemon 0x00
msgbox @2 0x06
applymovement 0xY @move1
waitmovement 0x0
setvar 0x40XX 0xZ
releaseall
end
#org @done
releaseall
end
#org @2
= OOH! That's a pretty scary looking\n\v\h02\
#org @move1
#raw 0x3
#raw 0xFE
#org @move
#raw 0x1
#raw 0xFE
#org @1
= I'm sorry but, it's to dangerous\nto go alone. Go talk to Professor\lOak to choose your pokemon.
#org @movehero
#raw 0x51
#raw 0xFE
I do apologize but im still not quite understanding the "0x1" part of the setvar command i understand "setvar 0x????" just not the second part. I do understand everything else thank you.
The pictures in that spoiler aren't coming up, and I am also looking for the solution to this problem. If you see this (I know its been a few years) could you please tell me what happened in those images?No, like this...
The pictures in that spoiler aren't coming up, and I am also looking for the solution to this problem. If you see this (I know its been a few years) could you please tell me what happened in those images?
Here you go:
Spoiler:Didn't work, did it? Froze on the spot. You're going to need to change this...
![]()
to this....
![]()
Try it now. Worked perfectly, didn't it?
Unfortunately diegoisawesome doesn't really go into why those number have to be like that or what they mean, but fortunately karatekid552's tutorial has an excellent part on script tiles that explains what's going on.