-
Notifications
You must be signed in to change notification settings - Fork 0
Spawns Basics
Basically, the game loads stuff like this:
- World
- Room
- Door
- Map
- Battle
- Event
- Room
While there are unique World IDs, Room IDs are shared between worlds. A room in one world can have the same Room ID as a room in another world. The Door, Map, Battle, and Event ID's all depend on the Room ID. The latter three IDs are collectively called Spawn ID.
World and Room IDs together determine the currently loaded room. Door ID determines where your party spawns. Map ID controls objects and room transitions (like Central Station's trains). Battle ID determines enemies and partners. Event ID determines NPC and cutscenes.
Spawnscripts are what determine which Spawn ID does what. They control what are spawned, where they're spawned, etc. Changing spawnscripts allows for enemy replacement which is used currently for boss/enemy rando. All spawnscripts for a room are loaded no matter the spawn ID, so we only need the room and world conditionals. It's very complicated, but these are some potentially valuable offsets for us:
Offset | Type | Content |
---|---|---|
0 | Int | UCM |
4 | Float | Position X |
8 | Float | Position Y |
C | Float | Position Z |
10 | Float | Rotation X |
14 | Float | Rotation Y |
18 | Float | Rotation Z |
20 | Int | Sub-UCM 1 |
24 | Int | Sub-UCM 2 |
28 | Int | Talk/Examine Text |
2C | Int | Reaction Command |
The spawnscripts are part of ARD files, which also affect event-specific battle level, BGM, party, etc. Further reading can be found here. They are loaded dynamically, but they're usually within 1CXXXXX address.
The Door ID will always be set by the room transition script while the Spawn ID is usually checked from the save file upon entering the room. There are however some cases where the spawn ID is also controlled by the room transition script. The addresses for them can be found here.
The values there are updated when story flags are set. Failure to update these might result in repeated/broken cutscenes, enemies appearing where they're not supposed to, barriers blocking your destinations, or other miscellaneous issues.
Progress flags are bitmasks that control different aspects of the game. Their addresses and values can be seen here.
/*
This is sorta jank sounding
Most progress flags updated the spawn ID in the save file when tripped by the game. This means that if they are already set, those spawn IDs won't be updated, which will break some stuff. These progression-based flags will also affect Jiminy's Journal. Non-progression-based flags can affect party members or GoA portal colors.
*/
Some cutscenes won't work properly if the respective progression flags have been set. These flags are honestly very weird, so it's not recommended to mess with them too much.
- Coding
- Item Modification
- Stats
- World Codes
- Miscellaneous