- 23
- Posts
- 11
- Years
- Seen Aug 29, 2019
I am learning to hack emerald and wish to script an event that calls on the in game time to allow certain events/maps to be accessible at certain times of the day, I have scoured the internet, and thus far my efforts have returned empty handed.
I, therefore, turned to reverse engineering existing time-based events, my study was the Shoal Cave tide events, however, I feel my knowledge is still a little too poor to understand how to manipulate this. Looking at the Level scripts in XSE it seems it It calls on a special 0xD5, which sets/clears a flag 0x89A. This flag is used to set the map footer for Shoal Cave as either the flooded or low tide variant.
I therefore quickly concluded that there is likely no simple way to just 'call on the time' and see if it matches my desired value, and set events to appear accordingly, so I did some further digging and found some research by someone else on the 0xD5 Special script https://sites.google.com/site/hackroms/documents-researchs/shoal-cave
In his research, he concluded that there is a table that dictates at which hours the tide is high, leaving the map flooded. The structure of that table is 24 bytes (24 hours), and if a certain hour byte is 1, the script will set the flag, and we get a high tide.
Ideally, I could use the RTC data to just call on the current time, but it doesn't look that simple for event creation, so it appears that setting flags are the way forward here. So my idea is that I suppose it could be possible to manipulate the table for tide times somehow (may be too limiting) or write a new special script in a similar fashion to set 24 individual flags for each hour of the day, and use those to check the time and only allow my scripts to activate if the desired flags are set, but I don't understand where this information was actually decompiled from or how I would go about changing it (I've only been using Advanced Map and XSE so far)
So my questions are:
-Is there any info on creating time-Based Events already I simply haven't found yet that can save me all this hassle?
-If not, where was this info about the special script decompiled from so I may access and study the tables myself?
-Is there a way I can edit this or create a new script to have the desired effect?
Thank you for you advice
I, therefore, turned to reverse engineering existing time-based events, my study was the Shoal Cave tide events, however, I feel my knowledge is still a little too poor to understand how to manipulate this. Looking at the Level scripts in XSE it seems it It calls on a special 0xD5, which sets/clears a flag 0x89A. This flag is used to set the map footer for Shoal Cave as either the flooded or low tide variant.
I therefore quickly concluded that there is likely no simple way to just 'call on the time' and see if it matches my desired value, and set events to appear accordingly, so I did some further digging and found some research by someone else on the 0xD5 Special script https://sites.google.com/site/hackroms/documents-researchs/shoal-cave
In his research, he concluded that there is a table that dictates at which hours the tide is high, leaving the map flooded. The structure of that table is 24 bytes (24 hours), and if a certain hour byte is 1, the script will set the flag, and we get a high tide.
Ideally, I could use the RTC data to just call on the current time, but it doesn't look that simple for event creation, so it appears that setting flags are the way forward here. So my idea is that I suppose it could be possible to manipulate the table for tide times somehow (may be too limiting) or write a new special script in a similar fashion to set 24 individual flags for each hour of the day, and use those to check the time and only allow my scripts to activate if the desired flags are set, but I don't understand where this information was actually decompiled from or how I would go about changing it (I've only been using Advanced Map and XSE so far)
So my questions are:
-Is there any info on creating time-Based Events already I simply haven't found yet that can save me all this hassle?
-If not, where was this info about the special script decompiled from so I may access and study the tables myself?
-Is there a way I can edit this or create a new script to have the desired effect?
Thank you for you advice