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

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.
7
Posts
12
Years
  • Seen Mar 31, 2012
Birch's speech

Hello world.

I really want to edit professor Birch's speech right before he gives you your first Pokemon (so not the monologue when he tells you what a Pokemon is at the beginning of the game) but I really don't know how to make him still give you the Pokemon you used before. I doubt I'm the first person to ask this, but with over 200 posts in this thread I don't have time to go through each one. If someone could show me how to write a script on PokeScript for Pokemon Ruby I would be really grateful, or if there is already an answer floating around out there, if someone could point me to it.

thanks ^_^
 

Hacks0rus

Monster Raving Looney
24
Posts
12
Years
  • Seen Nov 9, 2012
Ok, so I added the part to that Spherical Ice gave me and made the following script:


After compiling however, I get 5 offsets, three of which seem to matter:
@setup 8002D5
@setup1 8002DC
@start 8002E7

Which one do I put where? And is this script even working? Cause it doesn't seem to respond if I put any of the three on the 'Script Offset 2' box in the Header (script type is 04 Validates Value, Flag=1001, Value:7005).

Oh and the Script Offset box is greyed out and has $71A276. The reason I have checkflag 0x1001, is because in the previous movement script that takes me to the map has just set the flag. So what I intended was that if the script starts it just checks to see if the flag is set. If not, just proceed with your business. If it is, the script as mentioned above is set.

Have no idea what more I can tell, so if you have any questions about the script, do ask.

I cant comment on the first part as I dont use spherical ice's method, but what I can say is that the checkflag wont work.
For some reason checkflag situations dont work in these scripts, but you can get around that using the setvar command.

var's act like the scripts flag, if it is 0x1 it wont play, if its 0x0 it will play. If you setvar 0x(7000 and up) 0x1 at the end of your script, it wont play again unless it is set back to 0x0. remember to put the var number used in the script into the var number box in A-map.

therefore you dont need a checkflag, just a setvar at the end.

Finally, I recommend re-doing the script to get rid of the wierd bug you had. try both spherical's and the traditional method and see if you get anything different.
 
5,256
Posts
16
Years
Ok, so I added the part to that Spherical Ice gave me and made the following script:


After compiling however, I get 5 offsets, three of which seem to matter:
@setup 8002D5
@setup1 8002DC
@start 8002E7

Which one do I put where? And is this script even working? Cause it doesn't seem to respond if I put any of the three on the 'Script Offset 2' box in the Header (script type is 04 Validates Value, Flag=1001, Value:7005).

Oh and the Script Offset box is greyed out and has $71A276. The reason I have checkflag 0x1001, is because in the previous movement script that takes me to the map has just set the flag. So what I intended was that if the script starts it just checks to see if the flag is set. If not, just proceed with your business. If it is, the script as mentioned above is set.

Have no idea what more I can tell, so if you have any questions about the script, do ask.

hWRdw.png

Then save Amap and test it out. Obviously your offset wouldn't be 123456.
 
72
Posts
12
Years
  • Seen Sep 30, 2017
I cant comment on the first part as I dont use spherical ice's method, but what I can say is that the checkflag wont work.
For some reason checkflag situations dont work in these scripts, but you can get around that using the setvar command.

var's act like the scripts flag, if it is 0x1 it wont play, if its 0x0 it will play. If you setvar 0x(7000 and up) 0x1 at the end of your script, it wont play again unless it is set back to 0x0. remember to put the var number used in the script into the var number box in A-map.

therefore you dont need a checkflag, just a setvar at the end.

Finally, I recommend re-doing the script to get rid of the wierd bug you had. try both spherical's and the traditional method and see if you get anything different.


Well I tried, but no succes. Nothing happens. I enter the map as I should in the previous movement script. But then I enter it and nothing happens.


hWRdw.png

Then save Amap and test it out. Obviously your offset wouldn't be 123456.

And apparently this does work! Only problem is that the script starts with the messagebox, I do the movement as given and then it freezes up again, as if it's waiting for the script to finish. The music does continue playing.

Code:
#org 0x80038D
lockall
msgbox 0x88003B7 '"This way please!"
callstd 0x4
closeonkeypress
applymovement MOVE_PLAYER 0x88003C9
waitmovement 0x0
msgbox 0x880045B '"Ah, there you are!"
callstd 0x4
closeonkeypress
setvar 0x7005 0x1
releaseall
end

I've tried fiddling with the setvar command, the message command, but no luck. It freezes up the moment before the 'Ah, there you are!' message. I think it has to do something with the waitmovement command. When I change the waitmovement 0x0 into pause 0x250, the 'Ah, there you are!' message DOES play, but it freezes up after that...
 
5,256
Posts
16
Years
Well I tried, but no succes. Nothing happens. I enter the map as I should in the previous movement script. But then I enter it and nothing happens.




And apparently this does work! Only problem is that the script starts with the messagebox, I do the movement as given and then it freezes up again, as if it's waiting for the script to finish. The music does continue playing.

Code:
#org 0x80038D
lockall
msgbox 0x88003B7 '"This way please!"
callstd 0x4
closeonkeypress
applymovement MOVE_PLAYER 0x88003C9
waitmovement 0x0
msgbox 0x880045B '"Ah, there you are!"
callstd 0x4
closeonkeypress
setvar 0x7005 0x1
releaseall
end

I've tried fiddling with the setvar command, the message command, but no luck. It freezes up the moment before the 'Ah, there you are!' message. I think it has to do something with the waitmovement command. When I change the waitmovement 0x0 into pause 0x250, the 'Ah, there you are!' message DOES play, but it freezes up after that...
Wow, what version of XSE are you using? It looks outdated.
If it's not version 1.1.1, which I', 99% sure it isn't, then download XSE 1.1.1 here:
http://www.4shared.com/rar/lcgKM8Q5/XSE_Upload.html?

You'd then need to rewrite your script to:
Code:
#org @setup
#raw 0x2
#raw pointer @setup1
#raw 0x0

#org @setup1
#raw word 0x7000 'This is the variable you set later on in your script.
#raw word 0x0
#raw pointer @start
#raw word 0x0

#org @start
lockall
msgbox @string1 0x4
closeonkeypress
applymovement MOVE_PLAYER @move1
waitmovement 0x0
msgbox @string2 0x4
closeonkeypress
setvar 0x7005 0x1
releaseall
end

#org @string1
= text

#org @string2
= text

#org @move1
// movements
#raw 0xFE // you need to have #raw 0xfe at the end of movement commands.

Then everything should hopefully work.
 
72
Posts
12
Years
  • Seen Sep 30, 2017
Yeah, I got 1.0.0

Might need to get a new version. I apparently deleted 0xFE at the movement part, stupid me. But, this script keeps haunting me. Now it won't stop playing. It loops the script on and on. I can't stop it with a key press or anything, even though I have the setvar 0x7005 0x1 command.
 
5,256
Posts
16
Years
Yeah, I got 1.0.0

Might need to get a new version. I apparently deleted 0xFE at the movement part, stupid me. But, this script keeps haunting me. Now it won't stop playing. It loops the script on and on. I can't stop it with a key press or anything, even though I have the setvar 0x7005 0x1 command.

Well first upgrade to 1.1.1 using the link I provided in the post above.

And it's doing that because I forgot to edit my updated script to have 7005. So the script should be this:

Code:
#org @setup
#raw 0x2
#raw pointer @setup1
#raw 0x0

#org @setup1
#raw word 0x7005
#raw word 0x0
#raw pointer @start
#raw word 0x0

#org @start
lockall
msgbox @string1 0x4
closeonkeypress
applymovement MOVE_PLAYER @move1
waitmovement 0x0
msgbox @string2 0x4
closeonkeypress
setvar 0x7005 0x1
releaseall
end

#org @string1
= text

#org @string2
= text

#org @move1
// movements
#raw 0xFE // you need to have #raw 0xfe at the end of movement commands.

Sorry for the typo!
 
72
Posts
12
Years
  • Seen Sep 30, 2017
And it now works perfectly.

Sir, you have made my week. Thank you so much! I've been shouting and cursing at this script for days now and it finally works. You deserve a medal!
 
25
Posts
13
Years
  • Seen Nov 13, 2020
I'm now having trouble with a script that checks to see if you have a pokemon, but it just freezes. I've tried setting the offset as the map script offset, but it doesn't work.

Spoiler:
 
72
Posts
12
Years
  • Seen Sep 30, 2017
I have 2 little problem with the movement script I mentioned earlier.
I have made 3 different versions, because eventually you come to a place where you have to go left, up or right.

These are the 3 versions:
Spoiler:
Spoiler:
Spoiler:

The first version works perfectly. However, I can't seem to get the updatecoins line OUT of the code. Deleting and compiling doesn't seem to work, strange enough. Even worse, I can't seem to change anything anymore. I can delete 5 lines out of it and compile, but the next time I open it, the lines are just the way they were before the deleting.

Second of all, the second and third version work almost perfect, except that the sprite that talks to me (0x1) doesn't move. It does in the first one, but it does not in the second and third version. When I look at the place where it stands before the script is called, it's still there, so it's not invisible.

Any help?
 
Last edited:
25
Posts
13
Years
  • Seen Nov 13, 2020
I have 2 little problem with the movement script I mentioned earlier.
I have made 3 different versions, because eventually you come to a place where you have to go left, up or right.

These are the 3 versions:
Spoiler:
Spoiler:
Spoiler:

The first version works perfectly. However, I can't seem to get the updatecoins line OUT of the code. Deleting and compiling doesn't seem to work, strange enough. Even worse, I can't seem to change anything anymore. I can delete 5 lines out of it and compile, but the next time I open it, the lines are just the way they were before the deleting.

Second of all, the second and third version work almost perfect, except that the sprite that talks to me (0x1) doesn't move. It does in the first one, but it does not in the second and third version. When I look at the place where it stands before the script is called, it's still there, so it's not invisible.

Any help?

For the first code, you probably just need an end. It continues to run when it decompiles. The end tells it to stop.
 
72
Posts
12
Years
  • Seen Sep 30, 2017
Nope. I can delete the script untill I only have

lockall
releaseall
end

But after I enter the script without the other line and with releaseall and end, releaseall/end turns into the updatecoins line.

Edit: Without the setvar 0x7000 0x1 line it works without adding the updatecoins line, but then I have the problem of the script repeating itself everytime I step on the scripttile.
 
Last edited:
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Nope. I can delete the script untill I only have

lockall
releaseall
end

But after I enter the script without the other line and with releaseall and end, releaseall/end turns into the updatecoins line.

Edit: Without the setvar 0x7000 0x1 line it works without adding the updatecoins line, but then I have the problem of the script repeating itself everytime I step on the scripttile.

The best advice would be to rewrite the script with fresh @pointers so they all get assigned new offsets, then see if the problem persists.
 
5,256
Posts
16
Years
Yeah, I'd probably change the Decompile settings (Ctrl+D) and check the Refactoring button. Then open the script, remove any messed up lines of code, compile and use the new offset.
 

RetroRoller

Trailer Trash
111
Posts
12
Years
I'm using PKSV and I wrote a script to gain the running shoes (Decompiled from original after amended)
Spoiler:


My problems are
1) The flag isn't set, seeing as I cannot run outside, (I haven't checked the location properties for an outdoor map properly in AdvanceMap yet, which might be the case, but I could run outside before)

2) After Decompiling it in PKSV... The script becomes... well... you'd better just look for yourself.
Spoiler:


Thanks in advance. Knowing me though it was a simple mistake and I was too derpy to find it.
 
25
Posts
13
Years
  • Seen Nov 13, 2020
So... more problems. I got this script to work up to the point where the 2nd message happens, but the 2nd set of movements doesn't happen.

Spoiler:
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
So... more problems. I got this script to work up to the point where the 2nd message happens, but the 2nd set of movements doesn't happen.

Spoiler:

The script looks ok to me, maybe change the pause 0x40 to waitmovement 0x0? The script might be ending and passing over the movements, but waitmovement should mean it waits for the moving to finish before continuing to 'end'.
 
25
Posts
13
Years
  • Seen Nov 13, 2020
The script looks ok to me, maybe change the pause 0x40 to waitmovement 0x0? The script might be ending and passing over the movements, but waitmovement should mean it waits for the moving to finish before continuing to 'end'.

I've already tried that, it does seem to work better at first, but it does the same thing. I doesn't apply the 2nd set of movements.
 
72
Posts
12
Years
  • Seen Sep 30, 2017
I have 2 little problem with the movement script I mentioned earlier.
I have made 3 different versions, because eventually you come to a place where you have to go left, up or right.

These are the 3 versions:
Spoiler:
Spoiler:
Spoiler:

The first version works perfectly. However, I can't seem to get the updatecoins line OUT of the code. Deleting and compiling doesn't seem to work, strange enough. Even worse, I can't seem to change anything anymore. I can delete 5 lines out of it and compile, but the next time I open it, the lines are just the way they were before the deleting.

Second of all, the second and third version work almost perfect, except that the sprite that talks to me (0x1) doesn't move. It does in the first one, but it does not in the second and third version. When I look at the place where it stands before the script is called, it's still there, so it's not invisible.

Any help?

Anyone an idea for the second problem? The sprite not moving on the 2nd and 3rd script, even though the scripts are the same as the first one?
 
Status
Not open for further replies.
Back
Top