The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other 386 Patching: Legendary Encounters

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 May 3rd, 2014 (10:32 AM).
mainstreet's Avatar
mainstreet mainstreet is offline
 
Join Date: Apr 2014
Location: California
Gender: Male
Posts: 7
Posted this on Script Help Thread, didn't get a response, will try here.

Game: Pokemon FireRed
Type: Person event (Scripted Legendary Encounter)
Editor: PKSV-UI by Score_Under (via AdvanceMap 1.95)
Script:
Spoiler:

#org 0x83B9410
'-----------------------------------
special INIT_STEPCOUNT
compare LASTRESULT 0x2
if == jump 0x81A7AE0 ' Equal To
special GET_STEPCOUNT
lock
faceplayer
battle ENTEI 50 NONE
checksound
cry ENTEI 0x2
message 0x83B947F ' Brm!
showmsg
waitcry
pause 0xA
playsound 0x2 0x2
waitbutton
setflag 0x807
special BATTLE_PIXELLATE
waitspecial
clearflag 0x807
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if == jump 0x824F0F7 ' Equal To
compare LASTRESULT 0x4
if == jump 0x8163824 ' Equal To
compare LASTRESULT 0x5
if == jump 0x8163824 ' Equal To
setflag 0x228
release
end

#org 0x81A7AE0
'-----------------------------------
release
end

#org 0x824F0F7
'-----------------------------------
setflag 0x228
jump 0x81A922D

#org 0x81A922D
'-----------------------------------
fadescreen FADEOUT_BLACK
disappear LASTTALKED
fadescreen FADEIN_BLACK
release
end

#org 0x8163824
'-----------------------------------
setvar 0x8004 0xF4
jump 0x81A9236

#org 0x81A9236
'-----------------------------------
fadescreen FADEOUT_BLACK
disappear LASTTALKED
fadescreen FADEIN_BLACK
storepokemon 0x0 0x8004
msgbox 0x81A63C4 ' The \v\h02 flew away...
callstd MSG_NOCLOSE ' Non-closing message
release
' Release commands close any open messages
end


#org 0x83B947F
= Brm!

#org 0x81A63C4
= The \v\h02 flew away!


The goal for this script: I have all three legendary dogs in a spot. What I want them to do is act like all the other legendary encounters here. I examined other legendary scripts to try to determine how they differed, and then could make my own to do this. Eventually I want to make all of the Gen II legendaries available somewhere. Ultimately I want the game to be a 386 patch (I'll do more stuff beyond this to start making a new game, but I wanted to start simple ) -- and will need to do this for all the legendaries (or at least, the ones with sprites) so figuring out how to make this work is important.

What's actually happening:Catching the Pokemon does nothing. That is, it's still there, available for capture as many times as I want. If I run, the flee message displays, then if I walk away, any of the three that I've already ran from comes back after I take a step. If I make the legendary faint, the message doesn't display, but the pokemon still comes back after the next encounter. From the code examination (I have Entei's in the script, Suicune and Raikou's are similar, just with their own flags and coding) they look to be coded the same way as all the legendaries that work fine (ie: Mewtwo, Zapdos, etc.) but... they don't. So... what am I missing here?

Screenshots and/or videos:
Since I can't post links, apparently, since I'm new here (and this is also my first attempt at hacking), the screencaps aren't available right here... www dot mainstreet52 dot info slash images slash FRIPH slash Dogs1.png is the first image (the others are Dogs2.png and Dogs3.png, and they were taken in numerical order.) I'm not sure how helpful they'll be... this is on fleeing twice. I've fixed the issue where it says ZAPDOS is the one that flees, that was simply fixing the hex var which I hadn't figured out at first.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (10:36 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is online now
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
You need to give each of the Legendary Beasts' overworlds an individual Person ID, and make it so that the script sets the flag that matches that Person ID after the Beast is defeated / captured / flees. For example, if Raikou has the Person ID of 2F0, you should include setflag 0x2F0 somewhere in the script.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (12:12 PM).
mainstreet's Avatar
mainstreet mainstreet is offline
 
Join Date: Apr 2014
Location: California
Gender: Male
Posts: 7
Quote:
Originally Posted by Spherical Ice View Post
You need to give each of the Legendary Beasts' overworlds an individual Person ID, and make it so that the script sets the flag that matches that Person ID after the Beast is defeated / captured / flees. For example, if Raikou has the Person ID of 2F0, you should include setflag 0x2F0 somewhere in the script.
Ahhh, okay. I'd set flags 227/228/229 sort of arbitrarily -- I'd read the big post on flags and figured those were the safest flags to use... had not noticed that the flags matched the person IDs there... that said, I'd been filling the Person IDs in from FFFF and working down because I had no idea what person IDs were already used by something.

So, I'll have to ask which person IDs are safe to use, so I can go ahead and use those for these, to match up with the flags correctly. That said, even if the 2xx person IDs aren't "safe", if I just know where they are, if they aren't going to be a problem, I can always just move the person that has that ID to something else as well...
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (12:32 PM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is online now
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by mainstreet View Post
Ahhh, okay. I'd set flags 227/228/229 sort of arbitrarily -- I'd read the big post on flags and figured those were the safest flags to use... had not noticed that the flags matched the person IDs there... that said, I'd been filling the Person IDs in from FFFF and working down because I had no idea what person IDs were already used by something.

So, I'll have to ask which person IDs are safe to use, so I can go ahead and use those for these, to match up with the flags correctly. That said, even if the 2xx person IDs aren't "safe", if I just know where they are, if they aren't going to be a problem, I can always just move the person that has that ID to something else as well...
Person IDs are literally flags, so safe flags are safe Person IDs. You only need to assign flags to overworlds that are going to be hidden, though, so you shouldn't need to use up too many flags. But yes, safe flags are safe Person IDs, so keeping it within the 2xx range would be wise.
__________________
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (1:09 PM). Edited May 3rd, 2014 by mainstreet.
mainstreet's Avatar
mainstreet mainstreet is offline
 
Join Date: Apr 2014
Location: California
Gender: Male
Posts: 7
Quote:
Originally Posted by Spherical Ice View Post
Person IDs are literally flags, so safe flags are safe Person IDs. You only need to assign flags to overworlds that are going to be hidden, though, so you shouldn't need to use up too many flags. But yes, safe flags are safe Person IDs, so keeping it within the 2xx range would be wise.
It's more all the items that I was adding that are a concern, because if I don't set them properly they come back for infinite collection really easily... I guess I need to cut back on the item addition or something...

Okay, so, it works fine now when I flee from the legendary. It also works fine when I cause it to faint. (That is, the sprite becomes hidden as it should.)

When I catch it, it still stands there though. (I'm using a Master Ball to do it as I gave myself a bunch to test this easier; I wouldn't think that would be a/the problem, but could it?) (Or maybe it's not actually having the national Pokedex? I'm scared to touch the Oak script with how complicated it is, which is what I'd need to do to get the National Pokedex right off the bat.)

(The script up there is exactly what I have still, and Entei's person ID is 0228 now. Similarly for Suicune at 0229 and Raikou at 0227 with their own flags.)
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (1:23 PM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is online now
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by mainstreet View Post
It's more all the items that I was adding that are a concern, because if I don't set them properly they come back for infinite collection really easily... I guess I need to cut back on the item addition or something...

Okay, so, it works fine now when I flee from the legendary. It also works fine when I cause it to faint. (That is, the sprite becomes hidden as it should.)

When I catch it, it still stands there though. (I'm using a Master Ball to do it as I gave myself a bunch to test this easier; I wouldn't think that would be a/the problem, but could it?) (Or maybe it's not actually having the national Pokedex? I'm scared to touch the Oak script with how complicated it is, which is what I'd need to do to get the National Pokedex right off the bat.)

(The script up there is exactly what I have still, and Entei's person ID is 0228 now. Similarly for Suicune at 0229 and Raikou at 0227 with their own flags.)
FireRed seems to use the Person IDs of 100 upwards for items, so I'd assume they are safe to use with MSG_FIND items. Using FFFF and working downwards certainly isn't a good idea though.

As for the issue of them not disappearing upon capture, the variable for special 0xb4 returns 0x7 if it is captured, but you don't seem to check for that n the script. That may be the issue.
__________________
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 3rd, 2014 (1:35 PM).
mainstreet's Avatar
mainstreet mainstreet is offline
 
Join Date: Apr 2014
Location: California
Gender: Male
Posts: 7
Quote:
Originally Posted by Spherical Ice View Post
FireRed seems to use the Person IDs of 100 upwards for items, so I'd assume they are safe to use with MSG_FIND items. Using FFFF and working downwards certainly isn't a good idea though.

As for the issue of them not disappearing upon capture, the variable for special 0xb4 returns 0x7 if it is captured, but you don't seem to check for that n the script. That may be the issue.
For the items: Right, I just have to be careful not to conflict with another item handout. Maybe I should count down from 1FF? Or maybe there's a list of items somewhere... might run a quick search after this, but not sure I'll find one. The alternative might be to just make more of the items be hidden, because it seems that hidden items don't require person IDs...

As to the other: Hmmm. The other legends don't seem to check for that, so I don't have a comparison to figure out how to actually do this. I basically compared the Mewtwo and Zapdos scripts, figured out what was different for each, and made mine different for the new ones, to generate these scripts in the first place.

Also I note that Mewtwo's person ID is 0081 and his flag is 2BC... so they don't seem to have to be the same... but, it does work that way (for it and for mine), so I'll leave it that way (whichever way it is now).
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:12 AM.