Jump to content

B2W2 Editting Script for 'Fateful Encounter' Events


Recommended Posts

Hi there

I am trying to make some of the special events in the game that are normally locked behind special versions of a Pokemon work for non-event versions of the Pokemon.

For example- the Reveal Glass event at the Abundant Shrine for when you bring a Dream Radar Therian Forme Landorus to the area
As well as bringing an Event Keldeo to Pledge Grove etc.

I have been trying to edit the Reveal Glass event, so that it appears if you bring a Landorus of any forme (whether it is caught in game, traded from BW etc.)

However I struggling to work what needs editting from the script....

I have attached the script file for 752 (it is the first script I believe) as well as the hex to see if anyone can help shed some light on the commands if possible.


I assume the variables 8023, 8024 and 8025 are it's Forme, the game it is from and checking the Trainer ID differs - but I could be wrong....

Well I know I am wrong as so far the best I have managed to get, if the man to appear if I put in a Landorus encounter in the shrine - however that is as far as I have got so far....Editting that first script I must be doing something wrong as I have made it crash multiple times...

Any help would be greatly appreciated!

 

6_752 Abundant Shrine Script B2W2

Link to comment
Share on other sites

I think I have made some progress on this...


I wasn't having much luck with the original script to start with, so I looked at the Regigigas script for where it calls on the species of the Regi's to awaken Regigigas.
So I have been able to get the event to work as intended by swapping that in, instead of the current 0x285 0 0x8023 0x8024 command in the original 752 Abundant Shrine script.

The script I now have for the event is as follows:
 

Editted Abundant Shrine Script - Using Regi script to identify species in party

=== Script 1 === 

Offset: 44 SetVarEqVal 0x8023 0 
Offset: 50 0x114 645 0x8023 
Offset: 56 StoreVar 0x4150 
Offset: 60 CompareTo 0 
Offset: 64 Condition EQUAL
Offset: 68 StoreVar 0x8023 
Offset: 72 CompareTo 1 
Offset: 76 Condition EQUAL
Offset: 80 If FALSE Function 0 (103 )
Offset: 87 ClearFlag 1028 
Offset: 91 SetVarEqVal 0x4150 1 
Offset: 97 Jump  Function 1 (132 )

=== Function0=== 

Offset: 103 SetFlag 1028 
Offset: 107 StoreVar 0x4150 
Offset: 111 CompareTo 1 
Offset: 115 Condition EQUAL
Offset: 119 If FALSE Function 1 (132 )
Offset: 126 SetVarEqVal 0x4150 0 
Offset: 132 StoreVar 0x4155 
Offset: 136 CompareTo 0 
Offset: 140 Condition EQUAL
Offset: 144 If FALSE Function 2 (155 )
Offset: 151 ClearFlag 1038 
Offset: 155 SetVarEqVal 0x8023 0 
Offset: 161 End 

Var 4150 is needed for the actual script that runs when the man gives you the reveal glass.

The only issue I have, is that the man will appear there each time you revisit the area with Landorus in your party - even if you have already received the Reveal Glass.

When you dont have him in your party, he doesn't appear - so that all works as planned.

The ClearFlag for the event is in the script still, for when Landorus is in your party the same as the original script above.
A SetFlag for the man and the event (1028)  is at the end of the script from receiving the Reveal Glass.

This is also in the original event script. Which I have pasted below for reference:

Original Abundant Shrine 752 Script (Landorus Event Trigger)

=== Script 1 === 

Offset: 44 SetVarEqVal 0x8023 0 
Offset: 50 SetVarEqVal 0x8024 0 
Offset: 56 SetVarEqVal 0x8025 0 
Offset: 62 0x20D 
Offset: 64 0x285 0 0x8023 0x8024 
Offset: 72 0x2F2 
Offset: 74 Logic07 0x8025 
Offset: 78 StoreVar 0x8024 
Offset: 82 CompareTo 1 
Offset: 86 Condition EQUAL
Offset: 90 StoreVar 0x4150 
Offset: 94 CompareTo 2 
Offset: 98 Condition DIFFERENT
Offset: 102 StoreVar 0x8025 
Offset: 106 CompareTo 1 
Offset: 110 Condition EQUAL
Offset: 114 Condition BOTH
Offset: 118 Condition BOTH
Offset: 122 If FALSE Function 0 (145 )
Offset: 129 ClearFlag 1028 
Offset: 133 SetVarEqVal 0x4150 1 
Offset: 139 Jump  Function 1 (174 )

=== Function0=== 

Offset: 145 SetFlag 1028 
Offset: 149 StoreVar 0x4150 
Offset: 153 CompareTo 1 
Offset: 157 Condition EQUAL
Offset: 161 If FALSE Function 1 (174 )
Offset: 168 SetVarEqVal 0x4150 0 
Offset: 174 StoreVar 0x4155 
Offset: 178 CompareTo 0 
Offset: 182 Condition EQUAL
Offset: 186 If FALSE Function 2 (197 )
Offset: 193 ClearFlag 1038 
Offset: 197 SetVarEqVal 0x8025 0 
Offset: 203 SetVarEqVal 0x8024 0 
Offset: 209 SetVarEqVal 0x8023 0 
Offset: 215 End 



Do I need to add an additional SetVarEqVal into this script to define the amount of times he appears as 1?
 

I saw this post by @Kaphotics in the B2W2 General Rom Info regarding the Vars involved in item scripts
 

Where in his NPRE notes, the first variable set was the Item Hex, second was the quantity and the third was the flag.

Does this work the same way in the original script for the Landorus event?

Apologies if it sounds like an amateur question - I haven't really got my head around the variables for scripting yet outside of Static Encounter battles and Trainer battles

 

Edited by Monty3540
Link to comment
Share on other sites

From what I know, if you want to remove the person after a flag is set, you must state the flag used in the overworld data for the person in the 8th and 9th byte.

eg:

00 00 20 00 02 00 00 00 (FLAG) 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 05 00 00 00 00 00

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...