Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ff3:ff3us:tutorial:events:branch [2018/05/06 17:26] lockirby2 [Event Bits Higher Than $2FF] |
ff3:ff3us:tutorial:events:branch [2019/02/12 12:44] (current) |
||
---|---|---|---|
Line 8: | Line 8: | ||
* To repeat part of an event many times (perhaps an infinite number of times). | * To repeat part of an event many times (perhaps an infinite number of times). | ||
- | ===== Jumping to a Subroutine | + | ==== Jumping to a Subroutine ==== |
The simplest way to jump to another address is to use the B2 command. | The simplest way to jump to another address is to use the B2 command. | ||
Line 16: | Line 16: | ||
By itself, this command allows us to reuse parts of the event script, as in the innkeeper example above. | By itself, this command allows us to reuse parts of the event script, as in the innkeeper example above. | ||
- | ===== Event Bits ===== | + | ==== Event Bits ==== |
A way to branch based on certain conditions would also be very helpful. | A way to branch based on certain conditions would also be very helpful. | ||
Line 24: | Line 24: | ||
If we use event bits correctly, the game can answer questions like "Has the party met Shadow yet?" or "Has the party defeated my optional superboss?" | If we use event bits correctly, the game can answer questions like "Has the party met Shadow yet?" or "Has the party defeated my optional superboss?" | ||
- | ===== Example | + | ==== Example ==== |
Right now, players can trigger our new Narshe guard cutscene infinitely many times, summoning as many guards as they please. | Right now, players can trigger our new Narshe guard cutscene infinitely many times, summoning as many guards as they please. | ||
Line 44: | Line 44: | ||
Conveniently, | Conveniently, | ||
- | ===== Reading the Event Script Dump ===== | + | ==== Reading the Event Script Dump ==== |
Event bits are represented in different ways depending on which document or tool you are using to view them. In the Event Bits Document, each Event Bit is represented by a number between $000 and $2FF, as you have seen. However, if you look in the Event Script Dump, you may see a line like the following (emphasis mine): | Event bits are represented in different ways depending on which document or tool you are using to view them. In the Event Bits Document, each Event Bit is represented by a number between $000 and $2FF, as you have seen. However, if you look in the Event Script Dump, you may see a line like the following (emphasis mine): | ||
Line 54: | Line 54: | ||
You may have noticed that event bits higher than $2FF are not listed in the Event Bits Document, yet they are often set or cleared in the Event Script Dump. These event bits are used to determine whether NPCs are immediately shown when you load a map. For example, bit $31C controls whether Vargas appears on Mt. Kolts. | You may have noticed that event bits higher than $2FF are not listed in the Event Bits Document, yet they are often set or cleared in the Event Script Dump. These event bits are used to determine whether NPCs are immediately shown when you load a map. For example, bit $31C controls whether Vargas appears on Mt. Kolts. | ||
- | {{: | + | {{ : |
You can cross reference this with the event dump by looking at the following part of lines like this: | You can cross reference this with the event dump by looking at the following part of lines like this: |