The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Events based on first pokemon in party

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 June 7th, 2019 (6:00 AM).
MobAcc MobAcc is offline
 
Join Date: Jun 2019
Posts: 15
Is there a way to script an event that will only occur if you have a specific pokemon in the first slot in ur party?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 10th, 2019 (9:51 AM).
STADIUM_TOKEN STADIUM_TOKEN is offline
 
Join Date: Mar 2019
Posts: 20
Yes indeed there is a way to do that. I don't know how good your scripting understanding is but here is what I know about variables.

Variables are different from normal Flags
They can have different Values, and it's Value can be changed by scripts

If you pick a Starter the value of the variable will be one two or three.

Depending on which Starter you picked one of the Legendary Johto Dogs will appear using the Variables Value as condition for it.

In your case you can use Variables just like this but be sure you use an unused Variable for safety reasons.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old June 10th, 2019 (1:09 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
If you're using FR, you can do this pretty easily with special 0xFF. It takes the value of variable 0x8004, selects the party position indicated by it and then returns the species number of that Pokemon. Here's an example of it in action:

Code:
...
setvar 0x8004 0x0 // 0x0 makes special 0xFF check the first party slot
special2 0x8000 0xFF // Stores the species number in variable 0x8000
compare 0x8000 0x19 // Checks if Pikachu was the returned result
if 0x1 goto @PikachuIsFirst // Branches the script if true
...
Hopefully that's what you're after.
__________________
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old June 11th, 2019 (9:33 PM).
Hillsy13's Avatar
Hillsy13 Hillsy13 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 157
Quote:
Originally Posted by DrFuji View Post
If you're using FR, you can do this pretty easily with special 0xFF. It takes the value of variable 0x8004, selects the party position indicated by it and then returns the species number of that Pokemon. Here's an example of it in action:

Code:
...
setvar 0x8004 0x0 // 0x0 makes special 0xFF check the first party slot
special2 0x8000 0xFF // Stores the species number in variable 0x8000
compare 0x8000 0x19 // Checks if Pikachu was the returned result
if 0x1 goto @PikachuIsFirst // Branches the script if true
...
Hopefully that's what you're after.
Is there an Emerald equivalent of that method friend?
__________________
Pokémon Emerald Genesis [Beta 2.0]
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old June 13th, 2019 (2:17 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Quote:
Originally Posted by Hillsy13 View Post
Is there an Emerald equivalent of that method friend?
Aye, special2 0x149 is the equivalent in Emerald and works exactly the same way. Its used by the Name Rater to check if you have an egg, but it can be used to check for other Pokemon as well.
__________________
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old June 13th, 2019 (5:47 AM).
Hillsy13's Avatar
Hillsy13 Hillsy13 is offline
 
Join Date: Aug 2016
Gender: Male
Posts: 157
Quote:
Originally Posted by DrFuji View Post
Aye, special2 0x149 is the equivalent in Emerald and works exactly the same way. Its used by the Name Rater to check if you have an egg, but it can be used to check for other Pokemon as well.
Legend. Had no clue you were a fellow Aussie! Also, the screenshots for Lilac look amazing so far. I hope it all goes well for you with that project.
__________________
Pokémon Emerald Genesis [Beta 2.0]
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old June 15th, 2019 (1:56 PM).
MobAcc MobAcc is offline
 
Join Date: Jun 2019
Posts: 15
Perfect thank you so much
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

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.