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

Blah

Free supporter
1,924
Posts
11
Years



Which lastresult, and also it won't work if I press yes, but works if I press no...

First of all, I want you to try understand why it works when you press no and not when you press yes. It's very obvious, and something that you should really look into before continuing. I know I've been just handing you the fixes and such, but this time you must work for it :P

I only give you this example as a hint:

Code:
#dynamic 0x740000

#org @start
lock
faceplayer
msgbox @yesorno 0x5            'A yes no box, whether you hit yes or no gets stored in LASTRESULT
compare LASTRESULT YES      'A check to see if the LASTRESULT was yes, I.E you pressed yes
if == jump @yep
msgbox @no 0x6                   'If the jump wasn't made, then this runs. I.E player said NO for the message
release
end

#org @yesorno
= Can you see what's wrong with your script now?

#org @yep
= Good. I'm too nice, it's spoiling you :P

#org @no
= Think of what determines when the no box is run and when the @yep is run.
 

thetripplenine

tripple.
98
Posts
11
Years
First of all, I want you to try understand why it works when you press no and not when you press yes. It's very obvious, and something that you should really look into before continuing. I know I've been just handing you the fixes and such, but this time you must work for it :P

I only give you this example as a hint:

Code:
#dynamic 0x740000

#org @start
lock
faceplayer
msgbox @yesorno 0x5            'A yes no box, whether you hit yes or no gets stored in LASTRESULT
[B][COLOR="Red"]compare LASTRESULT YES[/COLOR][/B]      'A check to see if the LASTRESULT was yes, I.E you pressed yes
if == jump @yep
msgbox @no 0x6                   'If the jump wasn't made, then this runs. I.E player said NO for the message
release
end

#org @yesorno
= Can you see what's wrong with your script now?

#org @yep
= Good. I'm too nice, it's spoiling you :P

#org @no
= Think of what determines when the no box is run and when the @yep is run.


That didn't really help, lol, i don't know if i'm being stupid or what
 

Blah

Free supporter
1,924
Posts
11
Years
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           [B]'alright the message is being asked now[/B]
compare LASTRESULT 0x1    [B]'If the player said yes it's jumping to @yes, lets go to @yes[/B]
if 0x1 goto @yes
applymovement 0x2 @move  [B]'From here down is executed if you pressed No.[/B]
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        [B]'Cool a message[/B]
release                               [B]'Woah, woah, why are we releasing? Incorrect use[/B]
return                                [B]'Return only works if you used call before it (not goto)[/B]
                                        [B]'Lets go back and see what happens[/B]

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp

Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.

This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded. :)
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           [B]'alright the message is being asked now[/B]
compare LASTRESULT 0x1    [B]'If the player said yes it's jumping to @yes, lets go to @yes[/B]
if 0x1 goto @yes
applymovement 0x2 @move  [B]'From here down is executed if you pressed No.[/B]
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        [B]'Cool a message[/B]
release                               [B]'Woah, woah, why are we releasing? Incorrect use[/B]
return                                [B]'Return only works if you used call before it (not goto)[/B]
                                        [B]'Lets go back and see what happens[/B]

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp

Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.

This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded. :)
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.

Just to add to what my friend FBI agent said:

Call is generally used for quick jumps out of a script like a different message for a boy/girl in which you will 'return' right back to where you were.

Goto/jump will take you to the next section where the script will proceed and you will not be returning to the section of the script you jumped out of. Many times, using a return at the end a script you "jumped" out to, will do nothing.
 

thetripplenine

tripple.
98
Posts
11
Years
OK, lets look at your script.

Code:
#org @start
lock
faceplayer
message @leave 0x5           [B]'alright the message is being asked now[/B]
compare LASTRESULT 0x1    [B]'If the player said yes it's jumping to @yes, lets go to @yes[/B]
if 0x1 goto @yes
applymovement 0x2 @move  [B]'From here down is executed if you pressed No.[/B]
waitmovement 0x2
applymovement 0xFF @move2
waitmovement 0xFF
applymovement 0x1 @move3
applymovement 0xFF @move3
waitmovement 0x1
applymovement 0xFF @exit 
waitmovement 0xFF
applymovement 0x1 @exit2
waitmovement 0x1
release
end

#org @move
movements

#org @move2
movements

#org @move3
movements

#org @exit
movements

#org @exit2
movements

#org @Leave
= Do you want to go to the training\ncamp?

#org @yes
message @pressyes 0x6        [B]'Cool a message[/B]
release                               [B]'Woah, woah, why are we releasing? Incorrect use[/B]
return                                [B]'Return only works if you used call before it (not goto)[/B]
                                        [B]'Lets go back and see what happens[/B]

#org @no
message @pressno 0x6
release
end

#org @pressyes
= Ok lets go!

#org @pressno
= Ok, but tell me if you want to\ngo to the training camp

Do you see what this means? You have a return but it's not doing anything. Sure goto and jump work the same way, but you have no way to get back to your original place in the script. Hence, we use:

Code:
#org @start
lock
faceplayer
call @something
msgbox @text 0x6
release
end

#org @something
msgbox @yay 0x6
return

#org @text
= Hey the script came back here!

#org @something
= Alrighty, we're down here.

This means there are 2 ways you can fix your script. One is by moving all the movements and such to that @yes body. The second is that you move the message @yes back to the main body and check if the user answered NO to the text. If he/she did say no, then you JUMP/GOTO (not call) to @no.

I hope you understand the difference between call & goto. Call is a very useful thing, but in your script it's unneeded. :)
Also, the pattern in your scripts that don't work is mostly logical errors. You need to understand the commands you're using and what they do.

Ya, it still only works if you press no...
 

thetripplenine

tripple.
98
Posts
11
Years
Of course, that's because I never did fix the script. I just commented your broken script and tried to point you to the right direction in order to fix it. I get the feeling you're not reading my suggestions/instructions.

I did... Lol I told you I already tried to change it..

EDIT:
I played around and finally got it to work.

EDIT 2:
Now when you click no it goes to the yes message...
 
Last edited:

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023


I did... Lol I told you I already tried to change it..

EDIT:
I played around and finally got it to work.

EDIT 2:
Now when you click no it goes to the yes message...

As you have stated, you have edited your script.
It would be useful for us to help you if you included your new script.
Though please wrap it within Spoiler or Code tags though...
HTML:
[CODE]script here[/CODE]
 

thetripplenine

tripple.
98
Posts
11
Years


As you have stated, you have edited your script.
It would be useful for us to help you if you included your new script.
Though please wrap it within Spoiler or Code tags though...
HTML:
[CODE]script here[/CODE]

Here's the script uncompiled:

Spoiler:


Here's the compiled script:

Spoiler:
 

Blah

Free supporter
1,924
Posts
11
Years


Here's the script uncompiled:

Spoiler:


Here's the compiled script:

Spoiler:

And here's the error:
Code:
compare LASTRESULT 0x0 [B]'check player pressed no[/B]
if 0x1 goto @yes [B]' goto @yes [/B]
 
5
Posts
11
Years
  • Seen Sep 22, 2013
I have posted it in a wrong category so I thought about posting it in the right category!

I have searched for these problems but with no luck! :-/
I need a little help with pokescript in Fire Red!
I have two issues
1)with messages and how they appear in the rom!
e.g
Code:
#org $script
lock
faceplayer
cry 0xA1 410
#raw 0x33
pause 0x30
message $cry
$cry 1 = De-oxys!
boxset 6
wildbattle 410 10 1
pause 0x70
fadescreen 1
removesprite 0x800F
setflag 0x1211
pause 0x10
fadescreen 0
release
end
it should make the text De-oxys! appear and start the battle
when i import this compiled script via advance map to my rom i get the deoxys event but instead of saying De-oxys! it makes unreadable characters appear and then the event starts with no problems!
-------------------------------------------------------------------------------------------------------------------
2)Another problem i come across is that when i run from the battle or catch it or anyways end the battle in every way possible the deoxys stays in its place instead of disappearing!
P.S. The rom is clean i just named the folder beta 1 because i wanted to create a hack but right now the *.gba file is clean!
Thanks in advance!
 
Last edited:
53
Posts
11
Years
  • Seen Feb 1, 2014
Hi, i'm writing a pokemart script using pksv.

All work fine but when the SELL/BUY/EXIT popup appear, the first option is not selected, and than i cannot do nothing, the play is locked and i must restart.

That's the code:

Spoiler:


ps. now there're offset instead of dynamics because i've still compile the code, but i've write it in dynamic mode.
 

tajaros

Hi I'm dawg
855
Posts
12
Years
I have posted it in a wrong category so I thought about posting it in the right category!

I have searched for these problems but with no luck! :-/
I need a little help with pokescript in Fire Red!
I have two issues
1)with messages and how they appear in the rom!
e.g
Code:
#org $script
lock
faceplayer
cry 0xA1 410
#raw 0x33
pause 0x30
message $cry
$cry 1 = De-oxys!
boxset 6
wildbattle 410 10 1
pause 0x70
fadescreen 1
removesprite 0x800F
setflag 0x1211
pause 0x10
fadescreen 0
release
end
it should make the text De-oxys! appear and start the battle
when i import this compiled script via advance map to my rom i get the deoxys event but instead of saying De-oxys! it makes unreadable characters appear and then the event starts with no problems!
-------------------------------------------------------------------------------------------------------------------
2)Another problem i come across is that when i run from the battle or catch it or anyways end the battle in every way possible the deoxys stays in its place instead of disappearing!
P.S. The rom is clean i just named the folder beta 1 because i wanted to create a hack but right now the *.gba file is clean!
Thanks in advance!

I recommend you using XSE switching to it doesn't take a large amount of time since you already know Pokescript which has some same commands with XSE.

Though I use to script with it I forgot how to script in Pokescript but anyways try compiling this with XSE.
Spoiler:


This should work and also I don't recommend you using flags hgher than 0x900 since they are not safe to use.
 
5
Posts
11
Years
  • Seen Sep 22, 2013
@tajaros
Thanks man!That did the trick!Guess i should now move to XSE!
So, it is recommended to use flags from 200 to 900?
Does it matter if i use the flag 200 for every script i make?
Thanks again :-)
 
416
Posts
11
Years
  • Age 35
  • Seen Feb 10, 2024
So I have a small script issue ;)
I made a new map (in fire red) and put mew in it...

the map script looks like this:

Spoiler:


and the mew event (similar to mewtwo, he only shows up one time) looks like so:
Spoiler:


and the code works fine... mew shows up... in his special new map... and you fight him... he dissapears... never to be seen again... yay

but after i impliment this code I get this odd unrelated glitch...
I would show you a screen shot but it would not let me...
I get these little dots in the text box that describes the HM...

like go to your flying pokemon, select hit and highlight FLY (dont actually fly) and notice the description (it says "Fly to a known Town." it has little pink dots above the text and there is no beveled bottom to the box...
you can still read the text and fly still works (its like this for all out of battle moves)

where did I go wrong... can anyone help me fix my script... if I remove it the box is normal, so its gotta either be mew or the map... the map inserted alone with no script on it works fine... once I add the script about mew not showing up after hes fought and the event where you see and fight mew is when it messes up.

PS another quick one, if anyone knows the offset for the event that releases one of the mystical dogs (after you beat the elite 4) id really appreciate it...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
@tajaros
Thanks man!That did the trick!Guess i should now move to XSE!
So, it is recommended to use flags from 200 to 900?
Does it matter if i use the flag 200 for every script i make?
Thanks again :-)

You must use a different flag for every script. Flags are like one time use.

Here is a good list of flags that are off limits unless you delete the scripts that use them: http://www.pokecommunity.com/showthread.php?p=6829256#post6829256

If you find yourself needing a lot more flags, I have a method, but it is only for dire need cases.

So I have a small script issue ;)
I made a new map (in fire red) and put mew in it...

the map script looks like this:

Spoiler:


and the mew event (similar to mewtwo, he only shows up one time) looks like so:
Spoiler:


and the code works fine... mew shows up... in his special new map... and you fight him... he dissapears... never to be seen again... yay

but after i impliment this code I get this odd unrelated glitch...
I would show you a screen shot but it would not let me...
I get these little dots in the text box that describes the HM...

like go to your flying pokemon, select hit and highlight FLY (dont actually fly) and notice the description (it says "Fly to a known Town." it has little pink dots above the text and there is no beveled bottom to the box...
you can still read the text and fly still works (its like this for all out of battle moves)

where did I go wrong... can anyone help me fix my script... if I remove it the box is normal, so its gotta either be mew or the map... the map inserted alone with no script on it works fine... once I add the script about mew not showing up after hes fought and the event where you see and fight mew is when it messes up.

PS another quick one, if anyone knows the offset for the event that releases one of the mystical dogs (after you beat the elite 4) id really appreciate it...

To take a screenshot of any screen, just hit print screen on the keyboard and paste it into paint. It's a good way if your emulator is not allowing them.

I personally think it is a pallet problem. I'm probably wrong, but it might be that the pallets need to be refreshed after mew disappears. There is a special to refresh maps in JPAN's study on the Special and Special2 commands. Give it a try and see if it works.

Also, try warping after the battle and see if that solves the problem. It could get us closer to solving it with more information.
 
Last edited:

Blah

Free supporter
1,924
Posts
11
Years
To take a screenshot of any screen, just hit print screen on the keyboard and paste it into paint. It's a good way if your emulator is not allowing them.
He only has 1 post, so I assume he means he doesn't know how to post it on PC.

I personally think it is a pallet problem. I'm probably wrong, but it might be that the pallets need to be refreshed after mew disappears. There is a special to refresh maps in JPAN's study on the Special and Special2 commands. Give it a try and see if it works.

Also, try warping after the battle and see if that solves the problem. It could get us closer to solving it with more information.

This is likely too, however there are also incosistencies within the script.

#org 0x81624C9
'-----------------------------------
checkflag 0x807
if true call 0x81624D3 ' Flag is set
end

#org 0x81624D3
'-----------------------------------
special2 LASTRESULT 0xB4
compare LASTRESULT 0x7
if != jump 0x81A77A9 'Using jump implies you don't want to run the rest of the code given the if condition is true.
disappear LASTTALKED Only disappears if you captured it. Intended?
return

#org 0x81A77A9
'-----------------------------------
return -- Without a place to return to

#org 0x8456735
'-----------------------------------
checkflag 0x1FE
if false call 0x8456745 ' Flag is unset
end

#org 0x8456745
'-----------------------------------
clearflag 0x1FF
return

That random return there is probably causing the random text appearing (at least I hope it is).
 
Status
Not open for further replies.
Back
Top