The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Help legendary static encounter script Emerald

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old March 17th, 2021 (3:14 AM).
MarcoShinyEmerald MarcoShinyEmerald is offline
 
Join Date: Dec 2020
Posts: 18
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.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old March 17th, 2021 (7:31 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
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.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old March 17th, 2021 (8:21 AM). Edited March 17th, 2021 by MarcoShinyEmerald.
MarcoShinyEmerald MarcoShinyEmerald is offline
 
Join Date: Dec 2020
Posts: 18
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
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old March 17th, 2021 (9:58 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by MarcoShinyEmerald View Post
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
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old March 17th, 2021 (11:12 AM).
MarcoShinyEmerald MarcoShinyEmerald is offline
 
Join Date: Dec 2020
Posts: 18
Quote:
Originally Posted by Asith View Post
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
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old March 18th, 2021 (4:11 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
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.
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old March 18th, 2021 (4:55 AM).
MarcoShinyEmerald MarcoShinyEmerald is offline
 
Join Date: Dec 2020
Posts: 18
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
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old March 18th, 2021 (5:42 AM).
Asith's Avatar
Asith Asith is offline
Uwao
 
Join Date: Nov 2020
Posts: 204
Quote:
Originally Posted by MarcoShinyEmerald View Post
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
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old March 18th, 2021 (8:03 AM).
MarcoShinyEmerald MarcoShinyEmerald is offline
 
Join Date: Dec 2020
Posts: 18
Quote:
Originally Posted by Asith View Post
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!
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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