• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.
Don't use the map script. Just set the flag in Mew's person ID after the hidesprite commands in your script.

Like this?

Code:
'-----------------------
#org 0x1A922D
fadescreen 0x1
hidesprite LASTTALKED
[COLOR=Red][B]setflag 0x9A[/B][/COLOR]
fadescreen 0x0
release
end

'-----------------------
#org 0x1A9236
fadescreen 0x1
hidesprite LASTTALKED
[COLOR=Red][B]setflag 0x9A[/B][/COLOR]
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 '"The [buffer1] flew away!"
callstd 0x4
release
end

It didn't work. Its Person ID is $009A.
 
Spoiler:


I need help with this script. As hack base I use Firered. The idea is that you enter a trainingplace and the trainer asks you if you want to battle his 2 students. If you answer with yes Red, the 1st student and his Pokemon will walk up to the combat zone. Then the battle begins and after you beat him he'll step aside and the other student takes his place. This is where thing start to mess up. When the 2nd students Pokemon starts moving, the camera does too. It seems like the camera follows the 2nd students Pokemon. After you won the fight the 2nd students pokemon sprite is messed up, it now looks like Red. Also the map starts to glitch, some houses are now in the trainingplace and you can't see any sprites. If you open your Pokemon overview and close it everythings back to normal.
Except for the camera ,it's disposed. Red now isnt in the center of the screen anymore. Hes close to the left bottom corner.
Also if you stand beside the trainingfield and you open your pokemon overview, you take control of the 2nd students Pokemon. Instead of Red youre now controlling the 2nd students Pokemon.
Thanks to anybody who helps me in advance.
 
Game: Pokemon Fire Red
Editor: XSE 1.1.1
Script: Rival Encounter
Spoiler:


I'n not sure if this belongs in the Simple Questions or in the Script help thread, I feel like its just some stupid mistake I'm making.
Basically Im trying to make a rival encounter - step on a tile, sprite walks down and battles you, leaves and disappears.
When the player steps on the tile, nothing happens.

Spoiler:


I feel like the error is in the applymovement commands, as I cant seem to get those to work on their own either. I also do not know if I should be setting the Person ID of the sprite in AdvanceMap to something in particular? Like I said, I feel like this is just an obvious beginner mistake.

Any help would be greatly appreciated.
 
Game: Pokemon Fire Red
Editor: XSE 1.1.1
Script: Rival Encounter
Spoiler:


I'n not sure if this belongs in the Simple Questions or in the Script help thread, I feel like its just some stupid mistake I'm making.
Basically Im trying to make a rival encounter - step on a tile, sprite walks down and battles you, leaves and disappears.
When the player steps on the tile, nothing happens.

Spoiler:


I feel like the error is in the applymovement commands, as I cant seem to get those to work on their own either. I also do not know if I should be setting the Person ID of the sprite in AdvanceMap to something in particular? Like I said, I feel like this is just an obvious beginner mistake.

Any help would be greatly appreciated.

Have you correctly set the Unknown and Var Number of the script tile through A-Map?
Spoiler:


Spoiler:


I need help with this script. As hack base I use Firered. The idea is that you enter a trainingplace and the trainer asks you if you want to battle his 2 students. If you answer with yes Red, the 1st student and his Pokemon will walk up to the combat zone. Then the battle begins and after you beat him he'll step aside and the other student takes his place. This is where thing start to mess up. When the 2nd students Pokemon starts moving, the camera does too. It seems like the camera follows the 2nd students Pokemon. After you won the fight the 2nd students pokemon sprite is messed up, it now looks like Red. Also the map starts to glitch, some houses are now in the trainingplace and you can't see any sprites. If you open your Pokemon overview and close it everythings back to normal.
Except for the camera ,it's disposed. Red now isnt in the center of the screen anymore. Hes close to the left bottom corner.
Also if you stand beside the trainingfield and you open your pokemon overview, you take control of the 2nd students Pokemon. Instead of Red youre now controlling the 2nd students Pokemon.
Thanks to anybody who helps me in advance.

It's possible that the cause is not related to your script, but because of the NPC (the 2nd poke of the 2nd trainer).
Check and see the Unknown and Movement values of the NPC.
Spoiler:
 
Last edited:
Not quite sure what was wrong, but I appreciate the help destinyjagold.
After reworking it a bit more, I got it to work.
Spoiler:
 
Last edited:
0x9A is actually for Birth Island's triangle but I've deleted it, that's why I was using it. I've tried with 200, 205, etc but it didn't work.

Birth Islands triangle resets when you leave the map. The flag is temporary.

Game: Pokemon Fire Red
Editor: XSE 1.1.1
Script: Rival Encounter
Spoiler:


I'n not sure if this belongs in the Simple Questions or in the Script help thread, I feel like its just some stupid mistake I'm making.
Basically Im trying to make a rival encounter - step on a tile, sprite walks down and battles you, leaves and disappears.
When the player steps on the tile, nothing happens.

Spoiler:


I feel like the error is in the applymovement commands, as I cant seem to get those to work on their own either. I also do not know if I should be setting the Person ID of the sprite in AdvanceMap to something in particular? Like I said, I feel like this is just an obvious beginner mistake.

Any help would be greatly appreciated.

Look at this lovely tutorial: https://www.pokecommunity.com/threads/302347

Spoiler:


I need help with this script. As hack base I use Firered. The idea is that you enter a trainingplace and the trainer asks you if you want to battle his 2 students. If you answer with yes Red, the 1st student and his Pokemon will walk up to the combat zone. Then the battle begins and after you beat him he'll step aside and the other student takes his place. This is where thing start to mess up. When the 2nd students Pokemon starts moving, the camera does too. It seems like the camera follows the 2nd students Pokemon. After you won the fight the 2nd students pokemon sprite is messed up, it now looks like Red. Also the map starts to glitch, some houses are now in the trainingplace and you can't see any sprites. If you open your Pokemon overview and close it everythings back to normal.
Except for the camera ,it's disposed. Red now isnt in the center of the screen anymore. Hes close to the left bottom corner.
Also if you stand beside the trainingfield and you open your pokemon overview, you take control of the 2nd students Pokemon. Instead of Red youre now controlling the 2nd students Pokemon.
Thanks to anybody who helps me in advance.

I have encountered this bug before. I still don't know what causes it, but it is a problem. For some reason, after certain scripts run (most notably battle scripts), if the screen changes you end up controling someone else. This, I have only found one way to fix:

Take the 2nd student in A-map, set his Person ID to 828 and drag him somewhere else on the map. Now, make a new 2nd student and adjust scripts accordingly. DO NOT DELETE THE ORIGINAL or else the problem will just shift to a different sprite.

Spoiler:


I need help with this script. As hack base I use Firered. The idea is that you enter a trainingplace and the trainer asks you if you want to battle his 2 students. If you answer with yes Red, the 1st student and his Pokemon will walk up to the combat zone. Then the battle begins and after you beat him he'll step aside and the other student takes his place. This is where thing start to mess up. When the 2nd students Pokemon starts moving, the camera does too. It seems like the camera follows the 2nd students Pokemon. After you won the fight the 2nd students pokemon sprite is messed up, it now looks like Red. Also the map starts to glitch, some houses are now in the trainingplace and you can't see any sprites. If you open your Pokemon overview and close it everythings back to normal.
Except for the camera ,it's disposed. Red now isnt in the center of the screen anymore. Hes close to the left bottom corner.
Also if you stand beside the trainingfield and you open your pokemon overview, you take control of the 2nd students Pokemon. Instead of Red youre now controlling the 2nd students Pokemon.
Thanks to anybody who helps me in advance.

I have encountered this bug before. I still don't know what causes it, but it is a problem. For some reason, after certain scripts run (most notably battle scripts), if the screen changes you end up controling someone else. This, I have only found one way to fix:

Take the 2nd student in A-map, set his Person ID to 828 and drag him somewhere else on the map. Now, make a new 2nd student and adjust scripts accordingly. DO NOT DELETE THE ORIGINAL or else the problem will just shift to a different sprite.
 
Last edited:
I have encountered this bug before. I still don't know what causes it, but it is a problem. For some reason, after certain scripts run (most notably battle scripts), if the screen changes you end up controling someone else. This, I have only found one way to fix:

Take the 2nd student in A-map, set his Person ID to 828 and drag him somewhere else on the map. Now, make a new 2nd student and adjust scripts accordingly. DO NOT DELETE THE ORIGINAL or else the problem will just shift to a different sprite.

Thank you so far. Almost everything worked accordingly to the script, I didn't take control of any other sprite and the sprites stayed as they were. But now I'm back to my original problem, the new sprite doesn't move at all. I've adjusted the script to the new sprite but it just stays where it is.
But anyway the script is now almost completely working so thank you for that.
 
Thank you so far. Almost everything worked accordingly to the script, I didn't take control of any other sprite and the sprites stayed as they were. But now I'm back to my original problem, the new sprite doesn't move at all. I've adjusted the script to the new sprite but it just stays where it is.
But anyway the script is now almost completely working so thank you for that.

Oh, oh, oh. I'm sorry, I missread your problem. Let me reread it a couple times and see if I can find a reason.
 
Oh, oh, oh. I'm sorry, I missread your problem. Let me reread it a couple times and see if I can find a reason.

^^ no I didn' meant that. What I was trying to say is that I made a new map because in the map before my current one the persons Ids were messed up, because i deleted one.
Anyway in the map before my current one the 2nd students Pokemon wouldn't move.
I tried editing the person ids and so on but no matter what I did it wouldn't move.
So i came to the conclusion that it would be better if I just made a new map.
Copy the tiles, make new persons and adjust the scripts.
But then I encountered the problem you helped me to fix (I took control of the 2nd students Pokemon).
But now I'm back to the problem i had on my first map (the 2nd students Pokemon won't move)
 
^^ no I didn' meant that. What I was trying to say is that I made a new map because in the map before my current one the persons Ids were messed up, because i deleted one.
Anyway in the map before my current one the 2nd students Pokemon wouldn't move.
I tried editing the person ids and so on but no matter what I did it wouldn't move.
So i came to the conclusion that it would be better if I just made a new map.
Copy the tiles, make new persons and adjust the scripts.
But then I encountered the problem you helped me to fix (I took control of the 2nd students Pokemon).
But now I'm back to the problem i had on my first map (the 2nd students Pokemon won't move)

Hmmm, I did notice that flags are an issue (https://www.pokecommunity.com/threads/302347) but that shouldn't prevent movement. Let me keep thinking....
 
Birth Islands triangle resets when you leave the map. The flag is temporary.

Thanks for the clarification. I went back to the script, removed the setflags after the hidesprite, changed some flags that were part of the Mewtwo event, and now everything works fine. He just doesn't disappear when I lose (everything else works great). If I add "setflag 0x2FF" (his ID is 2FF) after every hidesprite it not only doesn't solve the problem but when I catch him the message "The ???????? flew away!" appears. Now I only need to make him disappear when I lose without affecting the other outcomes.

Here's the script as I have it now:

Spoiler:
 
Thanks for the clarification. I went back to the script, removed the setflags after the hidesprite, changed some flags that were part of the Mewtwo event, and now everything works fine. He just doesn't disappear when I lose (everything else works great). If I add "setflag 0x2FF" (his ID is 2FF) after every hidesprite it not only doesn't solve the problem but when I catch him the message "The ???????? flew away!" appears. Now I only need to make him disappear when I lose without affecting the other outcomes.

Here's the script as I have it now:

Spoiler:

The number 0x2FF is not in here at all. Not once. There should be a setflag 0x2FF in here somewhere.....
 
Yes, but I removed them because it gave that bugged message when I catch it. It seems to work fine as it is when I catch or defeat Mew (don't know why).

Setting the flag will not give the bugged message. Here:

Code:
'-----------------------
#org 0x165271
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x188
lock
faceplayer
checksound
cry 0x97 0x2
msgbox2 0x8177F9F '"Mew!"
waitmsgbox
waitcry
pause 0x14
playsong 0x156 0x0
waitkeypress
startwildbattle 0x97 0x3 0x0
setflag 0x200
special 0x138
waitstate
clearflag 0x200
special2 LASTRESULT 0xB4
compare LASTRESULT 0x7
if 0x1 goto 0x8162558
compare LASTRESULT 0x1
if 0x1 goto 0x8162561
compare LASTRESULT 0x4
if 0x1 goto 0x8162561
setflag 0x201
release
end

'-----------------------
#org 0x1A7AE0
release
end

'-----------------------
#org 0x162558
setflag 0x201
goto 0x81A922D
end

'-----------------------
#org 0x162561
setvar 0x8004 0x97
goto 0x81A9236
end

'-----------------------
#org 0x1A922D
fadescreen 0x1
[B]Setflag 0x2FF[/b]
hidesprite LASTTALKED
fadescreen 0x0
release
end

'-----------------------
#org 0x1A9236
fadescreen 0x1
[B]Setflag 0x2FF[/b]
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 '"The [buffer1] flew away!"
callstd 0x4
release
end


'---------
' Strings
'---------
#org 0x177F9F
= Mew!

#org 0x1A63C4
= The [buffer1] flew away!
 
Setting the flag will not give the bugged message. Here:

It does to me, when I catch it:

[PokeCommunity.com] Script Help Thread (DO NOT REQUEST SCRIPTS)


Also, it seems that after I set the flag, compile and run the game, this part of the code:

Code:
#org 0x1A922D
fadescreen 0x1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x0
release
end
changes to this:

Code:
#org 0x1A922D
fadescreen 0x1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x97
nop1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 '"The [buffer1] flew away!"
callstd 0x4
release
end

And Mew still doesn't disappear when I lose.
 
It does to me, when I catch it:

[PokeCommunity.com] Script Help Thread (DO NOT REQUEST SCRIPTS)


Also, it seems that after I set the flag, compile and run the game, this part of the code:

Code:
#org 0x1A922D
fadescreen 0x1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x0
release
end
changes to this:

Code:
#org 0x1A922D
fadescreen 0x1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x97
nop1
setflag 0x2FF
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x81A63C4 '"The [buffer1] flew away!"
callstd 0x4
release
end

And Mew still doesn't disappear when I lose.

I just realized your problem: you are editing scripts that are used for all legendary battles. So, by adding to these scripts, it is affecting others. I would take my script that I posted and change it all to dynamic offsets in the 74000s.
 
I guess I'll try asking this again because I honestly don't know why this isn't working...
Game: Emerald

I need some help. I'm utterly confused at the moment... I have a script where you can battle somebody 3 different times, each time having stronger Pokémon. He should give you 3 different items each time you beat him, until he is rebattle-able. He's suppose to give you Leftovers the first time you beat him, PP Max the second, and a Master ball the third. When rebattle-able, he should give a PP Up each time you beat him. As of right now, he only gives the Leftovers and Master ball. No PP Max and no PP Up. What is going on with this script?

Code:
#dynamic 0x6C4340

#org @start
checkflag 0x850
if 0x1 goto @start1
trainerbattle 0x1 0xa1 0x0 @before @after @later
end

#org @start1
checkflag 0x851
if 0x1 goto @start2
trainerbattle 0x1 0x29b 0x0 @before1 @after1 @later1
end

#org @start2
settrainerflag 0x29d
trainerbattle 0x1 0x29d 0x0 @before2 @after2 @later2
end

#org @later
setflag 0x850
msgbox @msg1 0x2
giveitem 0xc8 0x1 0x0
release
end

#org @later1
setflag 0x851
msgbox @msg2 0x2
giveitem 0x47 0x1 0x0
release
end

#org @later2
checkflag 0x852
if 0x1 goto @beaten
setflag 0x852
msgbox @msg3 0x2
giveitem 0x1 0x1 0x0
release
end

#org @beaten
msgbox @msg4 0x2
giveitem 0x45 0x1 0x0
release
end

#org @before
= I am legend.

#org @after
= I... am...\pI'm speechless...

#org @msg1
= You are truly gifted...\lBut next time, you will fail.\pTake this, and remember me.

#org @before1
= This time, you will not be so\nlucky.

#org @after1
= How is this possible!?

#org @msg2
= I promise...\nI will defeat you.

#org @before2
= This time, you will lose.

#org @after2
= Again, I am beaten...

#org @msg3
= You are a King among peasants.

#org @msg4
= For the umpteenth time, I have\nfailed.\pClearly, you are the greatest.\pSo long as you defeat me, you\nmay have this.
 
Status
Not open for further replies.
Back
Top