• 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.

Tool: PKSV - Pokémon Script Editor + GUI

Status
Not open for further replies.

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
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?
You have to use your own flag number, for example 0x200 - 0x2FF, 0x500 - 0x5FF, etc.
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
Add a #dyn to the start and replace (using "Replace All" in the find/replace dialog, this is important) the contents of the "#org" clauses:
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
Then once you've pressed F9, you should see a dialog appear:


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:
 
Last edited:
4
Posts
14
Years
  • Seen May 13, 2013
Thanks, i finally got it to work. By the way great program, im looking forwards for any more updates.
 
1
Posts
14
Years
  • Seen Jun 16, 2009
I think i almost have it

OK so After auto generating a script whether for fighting a pokemon or finding a item which numbers do i input into Advance map for it to actually work? and where exactly?
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
OK so After auto generating a script whether for fighting a pokemon or finding a item which numbers do i input into Advance map for it to actually work? and where exactly?
After compiling it in PKSV (hotkey F9) you should find an offset dialog. Look for "@start", and there should be a number beginning with "0x" just after the "<->". Copy that number and replace "0x" with "$", then put it in the "Script Offset" for any person, script trap, or sign in AdvanceMap.
 
5
Posts
14
Years
  • Seen Sep 4, 2010
i downloaded it and everything they when i opened it it turned into japanese help?
 

Full Metal

C(++) Developer.
810
Posts
16
Years
it would probably be easier if you told us a lil bit more info (about your OS) and maybe included a screen cap?
(to do that push 'PrintScrn' then open paint,push these button combos in order ....
(ctrl+v,ctrl+s) save your image, upload then, oh u can't post links.....hm.....
lets see....place your link in this format...
http : // www . restofurlbefore'.com' / finishurlbefore'.bmp' . bmp (or other file extension)
notice the spaces, that way you will be able to post the link.
or just try to use the little picture of the mountain, that should let you insert an image....
do u even have the japanese language pack installed?
are u even sure the language u see is japanese?
 
25
Posts
16
Years
When I do wild battle script, the battle music is always R/S battle music even though the Rom is Fire Red. How can I change this?
 
5
Posts
14
Years
  • Seen Sep 4, 2010
im running vista i opened it in winrar and i dont have any japanese language pack
http : // i44 . tinypic.com / 23le8zl.jpg
it is exactly how u have it
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
im running vista i opened it in winrar and i dont have any japanese language pack
http : // i44 . tinypic.com / 23le8zl.jpg
it is exactly how u have it
Hi, that's Chinese and some of it appears to be fine, while other parts are a little messed-up. Extract the whole archive into its own folder and run the "en_only" version, this corrects the bug on some systems that prefer the Chinese resources.
 
4
Posts
14
Years
  • Seen Feb 20, 2010
Im new here and to pokemon rom hacking but i have one question i cant figure out. Im trying to create a new event. A sign >.> which im sure is pretty pathetic... But i think i have a problem every time i edit the script. I think it has something to do with the offsets but im not sure how they work. I had pictures but I cant post urls >.>
 

Samike360

Lover of May
397
Posts
15
Years
^In A-map, there is a magnifying glass. Use it and type in 800000 instead of 6-something number and then in "bytes needed" type in 100 to be safe and use the offsets it gives you.
 
4
Posts
14
Years
  • Seen Feb 20, 2010
Okay so it pops up saying

Spoiler:


So then i copy the first offset and put in the Script Offset box for the event

Then i open the event and it looks like this

Spoiler:


So then i used the Script Generator and selected person talking entered my message and set it as MSG_SIGN and hit generate. This pops up.

Spoiler:


I dont know what to do from there.
 

Samike360

Lover of May
397
Posts
15
Years
^Nope, do it this way:

You messed up when you got this:
$2E9804
$2E9868
$2E98CC
$2E9930
$2E9994

Go back to the magnifying glass. Do you see where it says $6B0000 in a text-box? Change it to $800000. Then get your offsets and replace the @start with one of the five that you choose.
 
4
Posts
14
Years
  • Seen Feb 20, 2010
Okay I went back and did that then i get...

Spoiler:


So im gonna use $85D5B4

I put in the script offset

Spoiler:


Thats what i got

Should i try the script generator again or is something still wrong? Im really srry im bad at his lol.

Thx for the help so far also.
 

Samike360

Lover of May
397
Posts
15
Years
^Hmm..that's strange....no don't use the script gen, instead try downloading HackMew's FreeSpaceFinder and using that to find some offsets. Or maybe since it is a small script set the bytes needed to 10. I'll pm you another piece of advice.
 

score_under

Inactive; Former ROM hack tool author, ❤️
526
Posts
18
Years
Something is very wrong there - opening PKSV where AdvanceMap detects free space should result in #raw 0xFF repeatedly.

If you compiled to that offset beginning with 2E, it's likely you messed up some vital data in your ROM too, so it's best to re-download it.
 
4
Posts
14
Years
  • Seen Feb 20, 2010
Do you mean it should look like this?

Spoiler:


Okay nvm i did figure out what i was doing wrong i got it to where all it says is #RAW OxFF i had the bytes to look for set to 00 instead of FF. Now im trying to get it to complile right lol

EDIT AGAIN: I finally got everything working right. I made a new event and it works nothings messed up lol. Thanks alot everyone.
 
Last edited:
Status
Not open for further replies.
Back
Top