• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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 Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

Hacks0rus

Monster Raving Looney
24
Posts
12
Years
  • Seen Nov 9, 2012
Nope :/ Still doesn't work.

Are you using XSE v1.0? If so, you'll need to update to 1.1.1.

Also, you may need a lock at the start and release at the end, that may be why it skips past it.

that then should work, fingers crossed :)
 

RetroRoller

Trailer Trash
111
Posts
12
Years
Are you using XSE v1.0? If so, you'll need to update to 1.1.1.

Also, you may need a lock at the start and release at the end, that may be why it skips past it.

that then should work, fingers crossed :)

I'll try and update, thanks. I can try it in PKSV in the meantime. I say meantime because trying to get XSE 1.1.1 on here 404'd so yeah -.- I'll try and leave HackMew a VM if he/she (whoever :3) hasn't already ammended the link.
 
7
Posts
12
Years
  • Seen Mar 31, 2012
Movement offsets for Ruby

I'm trying to hack Pokemon Ruby using Advance Map and PokeScript but I'm having some trouble with movement. I know how to set up the script but I can't find the correct offsets. Where can i find them/ could someone list the basic ones (move left, right, up, and down)?
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I'll try and update, thanks. I can try it in PKSV in the meantime. I say meantime because trying to get XSE 1.1.1 on here 404'd so yeah -.- I'll try and leave HackMew a VM if he/she (whoever :3) hasn't already ammended the link.

HackMew hasn't been around for a while so I doubt you would get a response. Just use this link to get the 1.1.1 version.

I'm trying to hack Pokemon Ruby using Advance Map and PokeScript but I'm having some trouble with movement. I know how to set up the script but I can't find the correct offsets. Where can i find them/ could someone list the basic ones (move left, right, up, and down)?

Here are the movements for R/S/E:

Spoiler:
 
72
Posts
12
Years
  • Seen Sep 30, 2017
Ok, this is frustrating. I'm working on a map that has several actions to complete (Pokéball, Pokédex etc). And I want to make it so that if you walk away before you get your Pokémon you will get MSG A and do Movement A (walk up). That way you can't get away before you have your Pokémon.

After you have your Pokémon and you walk away, I want to get MSG B and Movement A untill you talk to the only person there so he can tell you to get a Pokédex. If you talked to him and you then walk away before getting the Pokedex, I want to get MSG C and Movement A. If you get the Pokédex and then walk away I want to get MSG D and Movement A. If you then talk to the person again, I want the script to finish and you can walk through without any messages.

I KNOW how to do it, the only problem is that everytime I fix one part of one of the script, another part seems to **** UP. Either a part of the script becomes something COMPLETELY else or a message becomes random signs.

It's like the whole thing is a line getting from A to B and along the way are several points. And everytime I straighten one point out, so it becomes a line, another point gets ****ed up and I have to straighten that one out. But if I do that, a different point gets ****ed up. And I keep straightening everything and it keeps getting ****ed up.

How the **** do I fix this, because it's becoming really frustrating?

To add: here are the scripts as they SHOULD be, without any lines getting messed up.

First this one, this will take you to the next map:
Spoiler:
Then you should take a Pokémon, but to prevent you from walking away there is this script. This script also prevents you from walking off before you get your Pokedex (after getting the Pokemon) and after talking to a person for the last time (after getting your Pokedex):
Spoiler:
After getting the Pokémon, the previous scripts prevents you from walking away. You need to talk to someone. This is the script for that someone.

Spoiler:
This person tells you to get the Pokédex, which has the following script:
Spoiler:

The following things get messed up:
In the first script:
#org 0x8013E0
= JELLE: You need a Pokémon before\nyou do anything else. Follow me!
becomes random signs.
In the second script:
msgbox 0x8801BA7 MSG_NORMAL '"JELLE: Wait! I need to tell you\ns..."
applymovement MOVE_PLAYER 0x8800A61
waitmovement 0x0
releaseall
end
dissapears and becomes the word 'nop'
In the third script
msgbox 0x880194E MSG_NORMAL '"You have your first Pokémon and\ny..."
setvar 0x7022 0x1
the setvar 0x7022 0x1 command changes into setvar 0x7022 0xD9D1, strange enough.
In the last script
#org 0x8019DC
setflag 0x829
hidesprite 0x5
setflag 0x1025
msgbox 0x8801ACE MSG_NORMAL '"You got a Pokédex!"
releaseall
end
just becomes nonsense.
 
Last edited:
4
Posts
14
Years
  • Seen Apr 12, 2012
This has been something, I've been wondering for quite a while... Is it possible to script a "give nationaldex" earlier? If so, how. I'm not requesting a script.. I'm asking HOW!
 

Death_Mande

Avenged Sevenfold.
195
Posts
16
Years
This has been something, I've been wondering for quite a while... Is it possible to script a "give nationaldex" earlier? If so, how. I'm not requesting a script.. I'm asking HOW!

I'm not sure what you actually mean by "give", but here's the special that activates the national dex in Fire Red/Leaf Green:

special 0x16F
 
4
Posts
14
Years
  • Seen Apr 12, 2012
I'm not sure what you actually mean by "give", but here's the special that activates the national dex in Fire Red/Leaf Green:

special 0x16F

thanks :D

and yes, that's what I meant by "give".

One more question:

How do I make someone walk inside during an event.

What I'm trying to do is to make a 3rd person walk in when Prof. Oak is giving the pokedex to me and gary. How do I make the "!" appear over the head? How do I make his come in?
 
Last edited:

fatmanjumprope

黒雷 神 エネル
27
Posts
13
Years
Making trainer vanish after battle

Spoiler:



Above is the script I've been working/messing with. I've been trying to make a Team Rocket script where the guy guarding the front elevator (the one this specific script is assigned to) will disappear after being defeated so you can advance deeper into the building via different floors. I've searched through the tutorial section and through random videos but the information I do find doesn't really make sense to me D:

The script works up to the end of the battle then the Rocket grunt just sits there like a normal trainer script. If any of you fine ladies or gents could give me a hand/some assistance by telling me what I'm doing wrong or what I need to change I would really appreciate it :)

My goal:
Talk to Team Rocket Grunt
Grunt says message
battle starts
after battle (if you win) grunt says another message
screen fades
the grunt disappears forever and never comes back.
 
Last edited:

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Ok, this is frustrating. I'm working on a map that has several actions to complete (Pokéball, Pokédex etc). And I want to make it so that if you walk away before you get your Pokémon you will get MSG A and do Movement A (walk up). That way you can't get away before you have your Pokémon.

After you have your Pokémon and you walk away, I want to get MSG B and Movement A untill you talk to the only person there so he can tell you to get a Pokédex. If you talked to him and you then walk away before getting the Pokedex, I want to get MSG C and Movement A. If you get the Pokédex and then walk away I want to get MSG D and Movement A. If you then talk to the person again, I want the script to finish and you can walk through without any messages.

I KNOW how to do it, the only problem is that everytime I fix one part of one of the script, another part seems to **** UP. Either a part of the script becomes something COMPLETELY else or a message becomes random signs.

It's like the whole thing is a line getting from A to B and along the way are several points. And everytime I straighten one point out, so it becomes a line, another point gets ****ed up and I have to straighten that one out. But if I do that, a different point gets ****ed up. And I keep straightening everything and it keeps getting ****ed up.

How the **** do I fix this, because it's becoming really frustrating?

To add: here are the scripts as they SHOULD be, without any lines getting messed up.

First this one, this will take you to the next map:
Spoiler:

Then you should take a Pokémon, but to prevent you from walking away there is this script. This script also prevents you from walking off before you get your Pokedex (after getting the Pokemon) and after talking to a person for the last time (after getting your Pokedex):
Spoiler:

After getting the Pokémon, the previous scripts prevents you from walking away. You need to talk to someone. This is the script for that someone.

Spoiler:

This person tells you to get the Pokédex, which has the following script:
Spoiler:


The following things get messed up:
In the first script:

becomes random signs.
In the second script:

dissapears and becomes the word 'nop'
In the third script

the setvar 0x7022 0x1 command changes into setvar 0x7022 0xD9D1, strange enough.
In the last script

just becomes nonsense.

After inserting the scripts into your ROM, are you opening them through Advance Map and trying to edit them from there? That's what I believe you are doing, which isn't good practice and is the reason why your commands are becoming garbled.

You need to have dynamic pointers (@talk, @move etc.) rather than static pointers (0x8801199, 0x880115A etc.) which you receive when you open a script from Advance Map. If you are working with static pointers, like you have shown by posting your scripts here straight from being opened in Advance Map, then you can't make them longer at all - This is because XSE will automatically overwrite what ever data you have at the address that you have specified with static pointers. Here is an example of what I'm talking about:

Code:
#org 0x80004E
lockall
applymovement 0x1 0x8800064
waitmovement 0x1
msgbox 0x8800067 0x2
releaseall
end

#org 0x800064
#raw 0x11
#raw 0xFE

#org 0x800067
= Hello world!

In this script I have opened from Advance Map and cleaned up a little you see that I am using static pointers that tell me what offset parts of the script are assigned to. If I suddenly realised that the OW I'm moving needs to step upwards three more times and subsequently added three more 'raw 0x11's to his movements and then compiled the script again, this is what it would look like once I reload it:

Code:
#org 0x80004E
lockall
applymovement 0x1 0x8800064
waitmovement 0x1
msgbox 0x8800067 0x2
releaseall
end

#org 0x800064
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org 0x800067
= Ù\nllo world!

As you can see, the text in the message box has now been corrupted and is unusable, as the extra movement data that I added has overwritten three bytes of what was otherwise perfectly legible text. This is the problem with static offsets, you can't add any data that would otherwise expand the size of your script. It is good for quickly altering small things like changing values, variables used and stuff that won't lengthen your script, but it is otherwise improper for everyday XSE use.

Once you've finished writing a new script (with dynamic pointers, not static pointers from Advance Map), I would advise saving it as a .rbc file, which is as easy as going to 'File > Save As' and saving your script as you would any other program. This way you can open up your script in the future with your dynamic pointers already in place and reinsert it again if you need to lengthen it.

thanks :D

and yes, that's what I meant by "give".

One more question:

How do I make someone walk inside during an event.

What I'm trying to do is to make a 3rd person walk in when Prof. Oak is giving the pokedex to me and gary. How do I make the "!" appear over the head? How do I make his come in?

You can make an exclamation mark appear over somebody's head in FR/LG by typing 'raw 0x62' into their movements.

Spoiler:



Above is the script I've been working/messing with. I've been trying to make a Team Rocket script where the guy guarding the front elevator (the one this specific script is assigned to) will disappear after being defeated so you can advance deeper into the building via different floors. I've searched through the tutorial section and through random videos but the information I do find doesn't really make sense to me D:

The script works up to the end of the battle then the Rocket grunt just sits there like a normal trainer script. If any of you fine ladies or gents could give me a hand/some assistance by telling me what I'm doing wrong or what I need to change I would really appreciate it :)

My goal:
Talk to Team Rocket Grunt
Grunt says message
battle starts
after battle (if you win) grunt says another message
screen fades
the grunt disappears forever and never comes back.

In generic trainerbattle scripts, the script ends once you have finished the battle. For a script to continue after you have won, you need to use the trainerbattle type 0x1 rather than 0x0 like you are using now. 0x1 typed trainer battles also need an extra pointer added so the script knows where to continue once the battle is over. Here is what your script should look like if you want it to function like you want:

Code:
#dyn 0x740000
#org @begin
trainerbattle [COLOR="red"]0x1[/COLOR] 0x15F 0x0 @intro @defeat [COLOR="Red"]@later[/COLOR] // The battle is now 0x1 typed and the '@later' pointer tells the ROM where to continue once the battle is over

#org @intro
= Message

#org @defeat
= Message

#org @afterwards
= Message

#org [COLOR="Red"]@later[/COLOR]
message [COLOR="red"]@afterwards[/COLOR] // I made this message use the 'afterwards' pointer as it wasn't going to be used anywhere else
boxset 0x6
fadescreen
hidesprite [COLOR="red"]0x800F[/COLOR] // Variable 0x800F will affect the last person you talked to, so if you ever change the grunt's 'Event Number' you won't have to alter this script
[COLOR="red"]setflag 0xYYY[/COLOR] // More on this later
release
end

You will also have to set a flag during your script if you want the grunt to disappear forever. Chose the flag you want to use, edit it into the script and then put it in the OW's 'Person ID'.
 
Last edited:

Epitaph93

Intermediate Digidestined
120
Posts
12
Years
ASM Gender Check

I want to make a gender check of the first pokemon in the party. I found where the party offset is: 0x02024284, then from there found the gender of the first pokemon in the party: 0x02024289. I made the following routine to load the information into a temporary variable:

Code:
.text
.align 2
.thumb
.thumb_func
.global gendercheck1

main:
	push {r0-r1, lr}
	ldr r0, .FIRSTDIGIMON_GENDER
	ldr r0, [r0]
	ldr r1, .VAR
	ldrb r0, [r0, #0x5]
	strh r0, [r1]
	pop {r0-r1, pc}

.align 2
.FIRSTDIGIMON_GENDER:
	.word 0x02024284
.VAR:
	.word 0x020270B6 + (0x800D * 2)

This is my first routine, and I've only been at this for a few hours so I figured the problem lies in the routine. However, I made a script in XSE to call the routine to check if the gender data was greater than or equal to 20. The rest of the script is pretty self explanatory

Code:
#dynamic 0x800000

#org @start
callasm 0x852828
compare lastresult 0x20
if 0x4 goto @girl
if 0x0 goto @boy
end

#org @girl
msgbox @gender2 0x2 
end

#org @boy
msgbox @gender 0x2 
end

#org @gender
= You're digimon is a boy!

#org @gender2
= You're digimon is a girl!

I know the gender information is different for all pokemon, but this is only a test to see if the routine actually works. It didn't work, it simply restarted the rom. Like I said, I'm pretty sure the problem lies in the routine.
 

Death_Mande

Avenged Sevenfold.
195
Posts
16
Years
thanks :D

and yes, that's what I meant by "give".

One more question:

How do I make someone walk inside during an event.

What I'm trying to do is to make a 3rd person walk in when Prof. Oak is giving the pokedex to me and gary. How do I make the "!" appear over the head? How do I make his come in?

As DrFuji said, you could add #raw 0x62 to the hero/heroine's movements before the third guy walks in. #raw 0x11, If I'm not mistaken, will make the third guy move. An example of that would be:

Spoiler:


To learn how to create the movement script itself, I suggest reading this XSE tutorial. If you require any more help, feel free to post here again or PM me. Hope this helps you.
 

fatmanjumprope

黒雷 神 エネル
27
Posts
13
Years
In generic trainerbattle scripts, the script ends once you have finished the battle. For a script to continue after you have won, you need to use the trainerbattle type 0x1 rather than 0x0 like you are using now. 0x1 typed trainer battles also need an extra pointer added so the script knows where to continue once the battle is over. Here is what your script should look like if you want it to function like you want:

Code:
#dyn 0x740000
#org @begin
trainerbattle [COLOR=red]0x1[/COLOR] 0x15F 0x0 @intro @defeat [COLOR=Red]@later[/COLOR] // The battle is now 0x1 typed and the '@later' pointer tells the ROM where to continue once the battle is over

#org @intro
= Message

#org @defeat
= Message

#org @afterwards
= Message

#org [COLOR=Red]@later[/COLOR]
message [COLOR=red]@afterwards[/COLOR] // I made this message use the 'afterwards' pointer as it wasn't going to be used anywhere else
boxset 0x6
fadescreen
hidesprite [COLOR=red]0x800F[/COLOR] // Variable 0x800F will affect the last person you talked to, so if you ever change the grunt's 'Event Number' you won't have to alter this script
[COLOR=red]setflag 0xYYY[/COLOR] // More on this later
release
end
You will also have to set a flag during your script if you want the grunt to disappear forever. Chose the flag you want to use, edit it into the script and then put it in the OW's 'Person ID'.


Sorry to bother you again D: after reading your message this is what I got from it all:

Spoiler:



I read what you wrote about the flag. After searching a little I decided to use a flag marked as "unused" so I put it in, made the changes, and compiled the script. After I finished assigning the script to the rocket member I went to test the game.

As soon as I talk to the sprite the screen goes black and a bunch of random green colors start flashing and the game crashes. Again I apologize for my stupidity in figuring this out but if you could yet again give me a hand by telling me what I did wrong I would appreciate it. Thanks

-fats-
 
Last edited:

Death_Mande

Avenged Sevenfold.
195
Posts
16
Years
Sorry to bother you again D: after reading your message this is what I got from it all:

Spoiler:



I read what you wrote about the flag. After searching a little I decided to use a flag marked as "unused" so I put it in, made the changes, and compiled the script. After I finished assigning the script to the rocket member I went to test the game.

As soon as I talk to the sprite the screen goes black and a bunch of random green colors start flashing and the game crashes. Again I apologize for my stupidity in figuring this out but if you could yet again give me a hand by telling me what I did wrong I would appreciate it. Thanks

-fats-

My apologies for "butting in", but I noticed that:

#dyn 0x740000
#org @begin
trainerbattle 0x1 0x15F 0x0 @intro @defeat @later

Doesn't contain the following:

Code:
#dyn 0x740000
#org @begin
[B]lock
faceplayer
checkflag 0x[your flag of choice]
if 0x1 goto @yourstring[/B]
[B][you could insert a msgbox, perhaps?][/B]
trainerbattle 0x1 0x15F 0x0 @intro @defeat @later
[B]end[/B]

Try adding that to the script and see if it works properly.
 

fatmanjumprope

黒雷 神 エネル
27
Posts
13
Years
My apologies for "butting in", but I noticed that:

#dyn 0x740000
#org @begin
trainerbattle 0x1 0x15F 0x0 @intro @defeat @later

Doesn't contain the following:

Code:
#dyn 0x740000
#org @begin
[B]lock
faceplayer
checkflag 0x[your flag of choice]
if 0x1 goto @yourstring[/B]
[B][you could insert a msgbox, perhaps?][/B]
trainerbattle 0x1 0x15F 0x0 @intro @defeat @later
[B]end[/B]
Try adding that to the script and see if it works properly.

No please feel free! Any help is very appreciated.

If you haven't already noticed I'm new to scripting... I've worked with mapping and tiles in the past but just recently moved to scripts so please bare with me here.

This is what I've come up with after reading your post.

Spoiler:


Unfortunately this script comes up with the same black screen crash issue :( Also after running this script I've come up with a new issue which is the sprite the script is assigned to disappearing when the game is ran. I'm guessing this is part of the remove sprite going wrong somewhere in my script.
 

Death_Mande

Avenged Sevenfold.
195
Posts
16
Years
No please feel free! Any help is very appreciated.

If you haven't already noticed I'm new to scripting... I've worked with mapping and tiles in the past but just recently moved to scripts so please bare with me here.

This is what I've come up with after reading your post.

Spoiler:


Unfortunately this script comes up with the same black screen crash issue :( Also after running this script I've come up with a new issue which is the sprite the script is assigned to disappearing when the game is ran. I'm guessing this is part of the remove sprite going wrong somewhere in my script.

I have revised your script, and tested it on my ROM. It worked fine, here's the script:

Spoiler:


Did you check "Trainer?" in A-Map on the grunt's sprite? If you did, that was the cause of your black/red screen. As DrFuji explained to you earlier, hidesprite 0x800F hides the last sprite you interacted with. With this script, you simply set your grunt's Person ID to 01F4 or any other unused flag.

The Person ID section can be found under the "Script Offset:" box in Advance Map. I have modified your script a bit. You may have to leave the map and come back for him to be permanently gone. If you don't understand a certain part of the script or if you're still having a bug, please let me know! I hope this helps you!

EDIT: Also, if you find my "typing" pattern funny, I'm sorry! It's 1am where I live and I have a migrane headache XD! Can't think straight!
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Unfortunately this script comes up with the same black screen crash issue :( Also after running this script I've come up with a new issue which is the sprite the script is assigned to disappearing when the game is ran. I'm guessing this is part of the remove sprite going wrong somewhere in my script.

If the sprite isn't showing at all that means that the Flag is already set in game, try using a flag such as 0x800 (and changing the ID to 800). Generally flags over 800 aren't used by the game and so are definitely safe to us.
 
36
Posts
17
Years
  • Seen Dec 25, 2022
Hi everybody!
I'm sorry but I'm a noob here and I don't know where to post this question:

I'm using Advancemap and pksv as script editor.
I've made so far 3 talking scripts (using script generator of pksv) on the same map, and they work perfectly.
But when I create a 4th talking script on the same map, the person with that script only says the 2nd or 3rd script.
What it's happening and how should I correct this?
Thank you so much in advance for your answer.
Best regards,
Pokemaniaco :P
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Hi everybody!
I'm sorry but I'm a noob here and I don't know where to post this question:

I'm using Advancemap and pksv as script editor.
I've made so far 3 talking scripts (using script generator of pksv) on the same map, and they work perfectly.
But when I create a 4th talking script on the same map, the person with that script only says the 2nd or 3rd script.
What it's happening and how should I correct this?
Thank you so much in advance for your answer.
Best regards,
Pokemaniaco :P

It sounds like the 4th person event you've created is sharing the same 'Person Event Number' as somebody else on that map. Check if it is the same as anybody else's and then change it to an unused number if that is the case.
 
21
Posts
14
Years
  • Seen Mar 26, 2021
I want to make a gender check of the first pokemon in the party. I found where the party offset is: 0x02024284, then from there found the gender of the first pokemon in the party: 0x02024289. I made the following routine to load the information into a temporary variable:

Code:
.text
.align 2
.thumb
.thumb_func
.global gendercheck1

main:
	push {r0-r1, lr}
	ldr r0, .FIRSTDIGIMON_GENDER
	ldr r0, [r0]
	ldr r1, .VAR
	ldrb r0, [r0, #0x5]
	strh r0, [r1]
	pop {r0-r1, pc}

.align 2
.FIRSTDIGIMON_GENDER:
	.word 0x02024284
.VAR:
	.word 0x020270B6 + (0x800D * 2)

This is my first routine, and I've only been at this for a few hours so I figured the problem lies in the routine. However, I made a script in XSE to call the routine to check if the gender data was greater than or equal to 20. The rest of the script is pretty self explanatory

Code:
#dynamic 0x800000

#org @start
callasm 0x852828
compare lastresult 0x20
if 0x4 goto @girl
if 0x0 goto @boy
end

#org @girl
msgbox @gender2 0x2 
end

#org @boy
msgbox @gender 0x2 
end

#org @gender
= You're digimon is a boy!

#org @gender2
= You're digimon is a girl!

I know the gender information is different for all pokemon, but this is only a test to see if the routine actually works. It didn't work, it simply restarted the rom. Like I said, I'm pretty sure the problem lies in the routine.

well from what i read here http://bulbapedia.bulbagarden.net/wiki/Personality_value

gender is part of the pokemon's personality value, wouldn't it be somewhere on the first 4 byte?

here's how i understand it at least(im not totally sure but here goes):
lets say my bulbasaur in my FR save has a personality value of C5CA4F52 which is 11000101110010100100111101010010 in binary. the lowest byte which is 01010010 (82) determines its Pgender value you then compare this value to the gender threshold of bulbasaur(look at YAPE) which is 31 if its greater or equal than the threshold value it is a male otherwise it is a female.

but before all that you need to perform a check for 100% male/females and genderless just to be safe
please someone correct me if im wrong >.<
 
Status
Not open for further replies.
Back
Top