The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script Help legendary static encounter script Emerald (https://www.pokecommunity.com/showthread.php?t=446544)

MarcoShinyEmerald March 17th, 2021 3:14 AM

Help legendary static encounter script Emerald
 
Hello everyone!

I'm trying to set a static encounter for Zapdos, Moltres and Articuno. I put the 3 sprites but and set the battle too but I don't know how to hide the sprite if I kill the bird or I catch it.
I haven't founded any detailed guide for static encounter.

Asith March 17th, 2021 7:31 AM

Code:

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x6 0x0
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x2
setflag 0x200

release
end

#org @1
= CHARIZARD: Raaarrgghh!


Never hacked emerald or did a static encounter but this script I found on this forum should have everything you need. Pretty sure these commands don't change between FR and Emerald.
The two commands you have to use are after wildbattle; hidesprite and setflag. Hidesprite hides the sprite with the person event number in the argument (0x2 here). setflag is then used here to make the sprite with that flag ID permanently disappear. For the example script to work, the sprite's "person event no" in advance map must be 2, and the sprite's "Person ID" must be 200. You can switch out those values for your birds' sprites, just make sure the script matches what you put on the sprite in advance map.
The fadescreen is not necessary but looks nice.
If you clear that flag in any script later the sprite will reappear.

MarcoShinyEmerald March 17th, 2021 8:21 AM

It works but how can I hide it OLNY if I catch the bird or kill it?
The script for the other static encounter use LASTRESULT but I haven't founded nothing about that command

Thx for the help Asith

Asith March 17th, 2021 9:58 AM

Quote:

Originally Posted by MarcoShinyEmerald (Post 10315546)
It works but how can I hide it OLNY if I catch the bird or kill it?
The script for the other static encounter use LASTRESULT but I haven't founded nothing about that command

Thx for the help Asith

Other than catching or killing the bird, the only other option is the player running, right?
Unless I'm totally forgetting something, I don't know if there's any way to detect the player running away from battle. LASTRESULT is just a variable that stores data from many processes like YES/NO questions. However, if you post that script you're talking about we can look at it and figure out more

MarcoShinyEmerald March 17th, 2021 11:12 AM

Quote:

Originally Posted by Asith (Post 10315600)
Other than catching or killing the bird, the only other option is the player running, right?
Unless I'm totally forgetting something, I don't know if there's any way to detect the player running away from battle. LASTRESULT is just a variable that stores data from many processes like YES/NO questions. However, if you post that script you're talking about we can look at it and figure out more

'---------------
#org 0x23905A
lock
faceplayer
checksound
cry 0x193 0x2
pause 0x28
waitcry
setwildbattle 0x193 0x28 0x0
setflag 0x8C1
special 0x13B
waitstate
clearflag 0x8C1
special2 LASTRESULT 0xB7
compare LASTRESULT 0x1
if 0x1 goto 0x82390A1
compare LASTRESULT 0x4
if 0x1 goto 0x82390AA
compare LASTRESULT 0x5
if 0x1 goto 0x82390AA
setflag 0x1BD
release
end

'---------------
#org 0x2390A1
setflag 0x1BD
goto 0x827376D

'---------------
#org 0x2390AA
setvar 0x8004 0x193
goto 0x8273776

'---------------
#org 0x27376D
fadescreen3 0x1
hidesprite LASTTALKED
fadescreen3 0x0
release
end

'---------------
#org 0x273776
fadescreen3 0x1
hidesprite LASTTALKED
fadescreen3 0x0
bufferpokemon 0x0 0x8004
msgbox 0x8273204 MSG_KEEPOPEN '"The [buffer1] flew away!"
release
end


'---------
' Strings
'---------
#org 0x273204
= The [buffer1] flew away!

This is for a regi battle

Asith March 18th, 2021 4:11 AM

I'm still unsure what you want to accomplish. In the game's usual static encounters, like the one you showed, the pokemon will disappear when you catch it, kill it, or run away from it. The only difference is that there's also a message if you just run. Do you want to make it so the bird doesn't fly away if you run? If so, you can use the script you've shown but change the block at 0x273776 (the last big block). That's the block for running away. Just remove the hidesprite command from that block, and the rest if you want, and the sprite will stay.

MarcoShinyEmerald March 18th, 2021 4:55 AM

If I use the script you put for Charizard, it wanishes but when I walk it riappears.
And I don't know how to insert the battle music I want or a message like "zapdos flew away" if you beat it.
Sorry, I know they're a lot of things but this zapdos is giving me so much problems ahahah

Asith March 18th, 2021 5:42 AM

Quote:

Originally Posted by MarcoShinyEmerald (Post 10316648)
If I use the script you put for Charizard, it wanishes but when I walk it riappears.
And I don't know how to insert the battle music I want or a message like "zapdos flew away" if you beat it.
Sorry, I know they're a lot of things but this zapdos is giving me so much problems ahahah

Remember the setflag 0x200 in the Charizard script. For that to work you have to put 0200 in the Person ID box of Charizard's sprite. It's right under script offset in advance map.

Just use a simple message box for the message, put it after the wildbattle in the charizard script. If you don't know how to message box, read a basic scripting tutorial like this.

I don't know about battle music, probably a special. Try searching for a tutorial

MarcoShinyEmerald March 18th, 2021 8:03 AM

Quote:

Originally Posted by Asith (Post 10316688)
Remember the setflag 0x200 in the Charizard script. For that to work you have to put 0200 in the Person ID box of Charizard's sprite. It's right under script offset in advance map.

Just use a simple message box for the message, put it after the wildbattle in the charizard script. If you don't know how to message box, read a basic scripting tutorial like this.

I don't know about battle music, probably a special. Try searching for a tutorial

thx mate. Now zapdos go away after the battle. I know hot to use msgbox but now the problem is 'put the message only if I beat it' ahahah

I'll try to resolve by myself.

Thanks a lot!


All times are GMT -8. The time now is 9:19 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.