Jump to content

Event Flag Editor for previous Gens


Blackwing

Recommended Posts

 Hello, I am quite fond of this feature and I find it very useful (re-battling legendaries is always nice if you look to trade or obtain a specific nature).

Would it be possible to add this feature to the rest generations, since it is available on 6th and 7th  ?

 

Thank you !

Link to comment
Share on other sites

  • 1 year later...

I would like to bump this topic, since I'm really interested in this as well.  I found out battling Rayquaza in Pokemon Emerald when you first start the game causes the game to believe that the event has already happened later on when you are taken to the Cave of Origins to talk with Wallace, which causes you to be stuck with Groudon and Kyogre battling in Sootopolis with no way around it.

Link to comment
Share on other sites

The thing is, I haven't found anyone who knows the offsets in PKHex that alter the in game events.  I know editing the events is in PKHex, but there's no guide to it, plus the information I can find doesn't match up with how PKHex handles the constants.  This link, https://github.com/pret/pokeemerald/blob/eb65458b67412cc4fc01eb3a4fb1c37d88829b54/data/scripts/maps/SkyPillar_Top.inc#L31-L68 seems really good,but there's no explanation of what constants affect what.  It would be valuable to include a guide in how to affect the in game events.

Edited by johnsom
Link to comment
Share on other sites

13 minutes ago, johnsom said:

The thing is, I haven't found anone who knows the offsets in PKHex that alter the in game events.  I know editing the events is in PKHex, but there's no guide to it, plus the information I can find doesn't match up with how PKHex handles the constants.  This link, https://github.com/pret/pokeemerald/blob/eb65458b67412cc4fc01eb3a4fb1c37d88829b54/data/scripts/maps/SkyPillar_Top.inc#L31-L68 seems really good,but there's no explanation of what constants affect what.  It would be valuable to include a guide in how to affect the in game events.

Refer here.

 

checkflag / setflag / clearflag do exactly what their names imply:

checkflag: is flag set (on/off)

setflag: sets the flag (on)

clearflag: un-sets the flag (off)

 

The script that Rayquaza uses should be obvious based of what is highlighted:

SkyPillar_Top_EventScript_239722:: @ 8239722
	lockall
	waitse
	playmoncry SPECIES_RAYQUAZA, 2
	delay 40
	waitmoncry
	setwildbattle SPECIES_RAYQUAZA, 70, ITEM_NONE
	setflag FLAG_SYS_CTRL_OBJ_DELETE
	special BattleSetup_StartLegendaryBattle
	waitstate
	clearflag FLAG_SYS_CTRL_OBJ_DELETE
	specialvar VAR_RESULT, sub_8138B80
	compare VAR_RESULT, 1
	goto_eq SkyPillar_Top_EventScript_239768
	compare VAR_RESULT, 4
	goto_eq SkyPillar_Top_EventScript_239771
	compare VAR_RESULT, 5
	goto_eq SkyPillar_Top_EventScript_239771
	setflag FLAG_0x1C0
	releaseall
	end

Flag 0x1C0 is set when you're done battling, hence preventing him from appearing further.

 

If you search the name of the script, you can see which entity uses it.:

https://github.com/pret/pokeemerald/blob/24f6484643ed3d7115fd4ebd92f254f224f1ca97/data/maps/SkyPillar_Top/events.inc#L3

SkyPillar_Top_EventObjects: @ 8537170
	object_event 1, EVENT_OBJ_GFX_RAYQUAZA_2, 0, 14, 7, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, 0x0, 773
	object_event 2, EVENT_OBJ_GFX_RAYQUAZA_1, 0, 14, 6, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, SkyPillar_Top_EventScript_239722, 80

If you look at the last parameter for the entity that uses the script (as already described here), it appears its spawn flag is 80d (0x050), this flag is used to hide the entity.

 

Again, like the linked thread, play with the event flags (0x50 & 0x1C0) until you get a result.

Link to comment
Share on other sites

29 minutes ago, Kaphotics said:

Refer here.

 

checkflag / setflag / clearflag do exactly what their names imply:

checkflag: is flag set (on/off)

setflag: sets the flag (on)

clearflag: un-sets the flag (off)

 

The script that Rayquaza uses should be obvious based of what is highlighted:


SkyPillar_Top_EventScript_239722:: @ 8239722
	lockall
	waitse
	playmoncry SPECIES_RAYQUAZA, 2
	delay 40
	waitmoncry
	setwildbattle SPECIES_RAYQUAZA, 70, ITEM_NONE
	setflag FLAG_SYS_CTRL_OBJ_DELETE
	special BattleSetup_StartLegendaryBattle
	waitstate
	clearflag FLAG_SYS_CTRL_OBJ_DELETE
	specialvar VAR_RESULT, sub_8138B80
	compare VAR_RESULT, 1
	goto_eq SkyPillar_Top_EventScript_239768
	compare VAR_RESULT, 4
	goto_eq SkyPillar_Top_EventScript_239771
	compare VAR_RESULT, 5
	goto_eq SkyPillar_Top_EventScript_239771
	setflag FLAG_0x1C0
	releaseall
	end

Flag 0x1C0 is set when you're done battling, hence preventing him from appearing further.

 

If you search the name of the script, you can see which entity uses it.:

https://github.com/pret/pokeemerald/blob/24f6484643ed3d7115fd4ebd92f254f224f1ca97/data/maps/SkyPillar_Top/events.inc#L3


SkyPillar_Top_EventObjects: @ 8537170
	object_event 1, EVENT_OBJ_GFX_RAYQUAZA_2, 0, 14, 7, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, 0x0, 773
	object_event 2, EVENT_OBJ_GFX_RAYQUAZA_1, 0, 14, 6, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, SkyPillar_Top_EventScript_239722, 80

If you look at the last parameter for the entity that uses the script (as already described here), it appears its spawn flag is 80d (0x050), this flag is used to hide the entity.

 

Again, like the linked thread, play with the event flags (0x50 & 0x1C0) until you get a result.

This wasn't what I was referring to.  In PKHex, I can't seem to find any real way of accessing that flag 0x1C0, which was what I wanted to know about.  PKHex doesn't use any letters in the Flag and Constant sections, only numbers 0-2399 fo Flag and 0-255 for Constant.

Edited by johnsom
Link to comment
Share on other sites

1 minute ago, johnsom said:

This wasn't what I was referring to.  In PKHex, I can't seem to find any real way of accessing that flag 0x1C0, which was what I wanted to know about.  PKHex doesn't use any letters in the Flag and Constant sections, only numbers 0-2399 fo Flag and 0-255 for Constant.

https://en.wikipedia.org/wiki/Hexadecimal

The prefix 0x is used in C and related languages, which would denote this value by 0x2AF3.

80d = 0x50, 448d = 0x1C0

Link to comment
Share on other sites

So I unchecked flag 448 (or 0x1C0) and all I get is just the rebattle with Rayquaza, which wasn't what I intended.  I wanted to replay the event that occurs there for him to fly away to Sootopolis.

Edited by johnsom
Link to comment
Share on other sites

56 minutes ago, johnsom said:

So I unchecked flag 448 (or 0x1C0) and all I get is just the rebattle with Rayquaza, which wasn't what I intended.  I wanted to replay the event that occurs there for him to fly away to Sootopolis.

You'd have to do a similar process to determine what flags need to be messed with for other events; have fun digging around the disassembly ;)

773 is used by the other "RAYQUAZA" entity, so you can try that.

SkyPillar_Top_EventObjects: @ 8537170
	object_event 1, EVENT_OBJ_GFX_RAYQUAZA_2, 0, 14, 7, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, 0x0, 773
	object_event 2, EVENT_OBJ_GFX_RAYQUAZA_1, 0, 14, 6, 3, MOVEMENT_TYPE_FACE_DOWN, 1, 1, 0, 0, SkyPillar_Top_EventScript_239722, 80
Link to comment
Share on other sites

2 minutes ago, Kaphotics said:

You'd have to do a similar process to determine what flags need to be messed with for other events; have fun digging around the disassembly ;)

Already on it lol.  Unchecking 773 and 774 have made Rayquaza reappear at Sky Pillar and he's sleeping, but can't be interacted with.  I'm really close lol.

Edited by johnsom
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...