Users browsing this thread: 1 Guest(s)
Questions about Event Scripts
04-28-2021, 12:21 PM
According to ZoneDoctor's event script dump, some command bytes' functions are labeled differently than on the FF6 Wiki. My examples, from some script I've been parsing:
CAE381: {FA-02} Pseudo-randomly choose to branch backwards 2 bytes ($CAE37F) with 50 % chance
CAE383: {FC-0D} Branch backwards 13 bytes ($CAE376)
The FF6 Wiki states:
FA $C0B8C7 Stop temporarily played song
C0/9A52: 1A B9 (act. FC: ** NOT USED **)
Wondering which are correct. My concern, outside of accuracy for the wiki, is that I'm parsing events for calls to other subroutines, so I can map given events connected to those directly called. So if these commands don't make these calls, I should ignore them... and I'd also wonder if the program is getting off track with subsequent calls.
CAE381: {FA-02} Pseudo-randomly choose to branch backwards 2 bytes ($CAE37F) with 50 % chance
CAE383: {FC-0D} Branch backwards 13 bytes ($CAE376)
The FF6 Wiki states:
FA $C0B8C7 Stop temporarily played song
C0/9A52: 1A B9 (act. FC: ** NOT USED **)
Wondering which are correct. My concern, outside of accuracy for the wiki, is that I'm parsing events for calls to other subroutines, so I can map given events connected to those directly called. So if these commands don't make these calls, I should ignore them... and I'd also wonder if the program is getting off track with subsequent calls.
Both are correct, they are indeed used for those purposes, it's just that the branching commands are meant to/need to be placed within an action queue, while the stop temporarily played song and unused act. $FC is meant to be a "general action" (first byte command), so the code would know to differentiate them. I'm fairly sure that's how it works anyway!
We are born, live, die and then do the same thing over again.
04-28-2021, 01:57 PM
Oh, I see. I forgot about the list on the Movement Codes page and didn't check the context on the commands. My bad, thanks for clearing that up.
04-28-2021, 01:57 PM
Yeah, within an action queue the commands take on different functions.
So you'll see something like
"Begin action queue for character $04 (8 bytes)"
and then there will be 8 bytes of commands that follow, which do different things than the same hex values when they're NOT in an action queue.
That's why all action queues have a form of parenthesis: they tell the game how long they are going to be in bytes and then they always end with an $FF to resume normal function.
If you're looking to branch outside of an action queue, you will need to check an always-unchanging event bit and do a jump. I use event bit $127 for this, but I know there are at least two more that do so.
EX:
This is a typical 'always branch' in the event code.
So you'll see something like
"Begin action queue for character $04 (8 bytes)"
and then there will be 8 bytes of commands that follow, which do different things than the same hex values when they're NOT in an action queue.
That's why all action queues have a form of parenthesis: they tell the game how long they are going to be in bytes and then they always end with an $FF to resume normal function.
If you're looking to branch outside of an action queue, you will need to check an always-unchanging event bit and do a jump. I use event bit $127 for this, but I know there are at least two more that do so.
EX:
Code:
CA0039: {C0-27-01-08-01-00} If ($1E80($127) [$1EA4, bit 7] is clear), branch to $ CA0108
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)