score_under
Inactive; Former ROM hack tool author, ❤️
- 526
- Posts
- 19
- Years
- Age 32
- Kent, England
- Seen Dec 7, 2022
You have to use your own flag number, for example 0x200 - 0x2FF, 0x500 - 0x5FF, etc.I cant seem to create a give Pokémon script. I cant find the flag numbers anywhere, does anyone know where I can find them ?
Also, when i change the offset for some scripts they don't seem to work, when i test out the script in the game it freezes. What am I doing wrong?
If you want one to start with, try 0x201. (0x201 is not equal to 201, by the way.)
If you change the "Script Offset" through AdvanceMap alone, that causes the game to load a script from that offset, it doesn't move the original script. If you want to check what script was at that offset, just press the button to open the script. If the script editor crashes or has an unusual amount of #raw commands (there should be none, ideally) then it's probably not a valid script.
To "move" a script, open it in PKSV, put "#dyn 0x800000" at the top of the script on its own line, find all "#org 0x[whatever]" and use find/replace to replace "0x[whatever]" with "@[insert-a-unique-name-here]". Then press F9 to recompile, and the first offset in the list is your script offset.
Example:
Code:
#org 0x81BDF13
'-----------------------------------
special 0x187
compare LASTRESULT 0x2
if 0x1 jump 0x81A7AE0 ' Equal To
lockall
checkflag 0x821
if 0x0 jump 0x81BDF87 ' Smaller Than
checkattack 0xF
compare LASTRESULT 0x6
if 0x1 jump 0x81BDF87 ' Equal To
setanimation 0x0 0x800D
storepokemonvar 0x0 0x800D
storeatk 0x1 0xF
msgbox 0x81BDF94 ' This tree looks like...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0x0
if 0x1 jump 0x81BDF91 ' Equal To
msgbox 0x81BDFD7 ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
closemsg
doanimation 0x2
waitspecial
jump 0x81BDF76
#org 0x81A7AE0
'-----------------------------------
release
end
#org 0x81BDF87
'-----------------------------------
msgbox 0x81BDFE3 ' This tree looks like...
callstd 0x3 '
releaseall
end
#org 0x81BDF91
'-----------------------------------
closemsg
releaseall
end
#org 0x81BDF76
'-----------------------------------
applymovement LASTTALKED 0x81BDF85 ' animate end
pauseevent 0x0
disappear 0x800F
releaseall
end
#org 0x81BDF94
= This tree looks like it can be CUT\ndown!\pWould you like to CUT it?
#org 0x81BDFD7
= \v\h02 used \v\h03!
#org 0x81BDFE3
= This tree looks like it can be CUT\ndown!
#org 0x81BDF85
M animate end
Shown in red is difference:
Code:
[COLOR=Red]#dyn 0x800000[/COLOR]
#org [COLOR=Red]@start[/COLOR]
'-----------------------------------
special 0x187
compare LASTRESULT 0x2
if 0x1 jump [COLOR=Red]@end[/COLOR] ' Equal To
lockall
checkflag 0x821
if 0x0 jump [COLOR=Red]@nocut[/COLOR] ' Smaller Than
checkattack 0xF
compare LASTRESULT 0x6
if 0x1 jump [COLOR=Red]@nocut[/COLOR] ' Equal To
setanimation 0x0 0x800D
storepokemonvar 0x0 0x800D
storeatk 0x1 0xF
msgbox [COLOR=Red]@cutme-msg[/COLOR] ' This tree looks like...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT 0x0
if 0x1 jump [COLOR=Red]@closeend[/COLOR] ' Equal To
msgbox [COLOR=Red]@used-cut-msg[/COLOR] ' \v\h02 used \v\h03!
callstd MSG_NOCLOSE ' Non-closing message
closemsg
doanimation 0x2
waitspecial
jump [COLOR=Red]@animation[/COLOR]
#org [COLOR=Red]@end[/COLOR]
'-----------------------------------
release
end
#org [COLOR=Red]@nocut[/COLOR]
'-----------------------------------
msgbox [COLOR=Red]@no-cut-msg[/COLOR] ' This tree looks like...
callstd 0x3 '
releaseall
end
#org [COLOR=Red]@closeend[/COLOR]
'-----------------------------------
closemsg
releaseall
end
#org [COLOR=Red]@animation[/COLOR]
'-----------------------------------
applymovement LASTTALKED [COLOR=Red]@animate-movement[/COLOR] ' animate end
pauseevent 0x0
disappear 0x800F
releaseall
end
#org [COLOR=Red]@cutme-msg[/COLOR]
= This tree looks like it can be CUT\ndown!\pWould you like to CUT it?
#org [COLOR=Red]@used-cut-msg[/COLOR]
= \v\h02 used \v\h03!
#org [COLOR=Red]@no-cut-msg[/COLOR]
= This tree looks like it can be CUT\ndown!
#org [COLOR=Red]@animate-movement[/COLOR]
M animate end
![[PokeCommunity.com] PKSV - Pokémon Script Editor + GUI [PokeCommunity.com] PKSV - Pokémon Script Editor + GUI](https://g.imagehost.org/t/0507/dynoff.jpg)
The first line there has the new offset of your script, right in the middle (after "<->"). Note that your offset will be different from mine.
Unrelated:
Spoiler:
(Apart from CSS fun, which is also off-topic. In fact, I think this looks pretty good. There should be an [unrelated] tag.)
An example of a script with a loop, a script that will make your character run towards any spot on the map regardless of where you currently are on the map. Works on sprites and script traps, but not signs.
An example of a script with a loop, a script that will make your character run towards any spot on the map regardless of where you currently are on the map. Works on sprites and script traps, but not signs.
Code:
#dyn 0x800000
#org @start
lockall
getplayerxy 0x8000 0x8001
addvar 0x8000 0x100
addvar 0x8001 0x100
subtractvar 0x8000 0xA
subtractvar 0x8001 0x9
jump @loop
#org @loop
compare 0x8000 0x100
if < jump @loop2
if == jump @loop3
applymovement PLAYER @run-left
pauseevent 0x0
subtractvar 0x8000 1
jump @loop
#org @loop2
compare 0x8000 0x100
if == jump @loop3
applymovement PLAYER @run-right
pauseevent 0x0
addvar 0x8000 1
jump @loop2
#org @loop3
compare 0x8001 0x100
if < jump @loop4
if == jump @endloops
applymovement PLAYER @run-up
pauseevent 0x0
subtractvar 0x8001 1
jump @loop3
#org @loop4
compare 0x8001 0x100
if == jump @endloops
applymovement PLAYER @run-down
pauseevent 0x0
addvar 0x8001 1
jump @loop4
#org @run-left
m run_left end
#org @run-right
m run_right end
#org @run-up
m run_up end
#org @run-down
m run_down end
#org @endloops
releaseall
end
Last edited: