field_scene.h
games/tbs/include/field_scene.h on GitHub
Structures
SceneEntrance
struct SceneEntrance
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for none).
| Field | Declared as | |
|---|---|---|
entrance | s16 entrance | the entrance number the game state names; -1 ends |
requiredFlag | s16 requiredFlag | a flag that must be set, or -1 for none |
x | s16 x | pixels |
y | s16 y | pixels |
z | s16 z | pixels |
facing | u16 facing | 1/65536 turns (enum Facing) |
unused1 | s16 unused1 | 0 in every table; not read |
cameraLeft | s16 cameraLeft | pixels |
cameraTop | s16 cameraTop | pixels |
cameraRight | s16 cameraRight | pixels |
cameraBottom | s16 cameraBottom | pixels |
unused2 | s16 unused2 | 0 in every table; not read |
Used by AltmillerCave_GetEntrances, BilibinCave_GetEntrances, BilibinInteriors_GetEntrances, Bilibin_GetEntrances, ColosseumEntrance_GetEntrances, ColossoLog_GetEntrances, ColossoRiver_GetEntrances, ImilFuchinFalls_GetEntrances, Imil_GetEntrances, KalayInteriors_GetEntrances, KalayTolbiDocks_GetEntrances, Kalay_GetEntrances, KolimaForestBend_GetEntrances, KolimaForestBridge_GetEntrances, KolimaForestClearing_GetEntrances, KolimaForestRiver_GetEntrances, KolimaForestTree_GetEntrances, KolimaInteriors_GetEntrances, Kolima_GetEntrances, LaliveroInteriors_GetEntrances, Lalivero_GetEntrances, LamakanDesert_GetEntrances, LemurianShip_GetEntrances, MercuryLighthouseAerie_GetEntrances, MercuryLighthouse_GetEntrances, MogallForest_GetEntrances, Scene_ApplyEntrance, Scene_GetEntrances, SolSanctumElementalStarRoom_GetEntrances, SolSanctumEntrance_GetEntrances, SolSanctumEruption_GetEntrances, SolSanctumLunaSolRooms_GetEntrances, SolSanctumStatue_GetEntrances, TolbiInteriors_GetEntrances, TolbiShipDeck_GetEntrances, TolbiShipInteriors_SelectEntrances, TolbiShipMast_GetEntrances, TolbiSpring_GetEntrances, TretTreeBranch_GetEntrances, TunnelRuins_GetEntrances and 204 more.
ScenePlacement
struct ScenePlacement
An actor a scene places: its sprite, the condition for placing it, how it behaves, where it stands and which way it faces, and how it turns to talk.
| Field | Declared as | |
|---|---|---|
sprite | s16 sprite | The actor's sprite; 0 to 7 are the party's characters, each in its own actor slot, and -1 ends the table. |
condition | s16 condition | -1 always, a flag | 0x1000 set, else the flag clear; off the world map, 48 to 127 also need condition + 80 to hold. |
behavior | s32 behavior | A built-in action (enum ActorBehavior, 1 to 7) or an action script, for ObjectMotion_SetActionCallback. |
x | s32 x | 16.16 fixed-point pixels |
y | s32 y | 16.16 fixed-point pixels |
z | s32 z | 16.16 fixed-point pixels |
facing | u16 facing | 1/65536 turns (enum Facing) |
talkFacing | u8 talkFacing | enum ActorTalkFacing; 3 follows the leader afterwards |
flags | u8 flags | PLACEMENT_SHARE_PREVIOUS_SPRITE |
Used by AltmillerCave_GetPlacements, BattleEffect_ClearAllObjects, BilibinCave_GetPlacements, BilibinInteriors_GetPlacements, Bilibin_GetPlacements, ColosseumEntrance_GetPlacements, ColossoLog_GetPlacements, ColossoRiver_GetPlacements, Djinn_ResolvePendingEvent, Event_CallWithLastActiveObjectId, Event_RunObjectHookAndWait, Event_SpawnObjectTable, FieldObject_PlaceSceneActors, Field_RunScene, ImilFuchinFalls_GetPlacements, Imil_GetPlacements, KalayInteriors_GetPlacements, KalayTolbiDocks_GetPlacements, Kalay_GetPlacements, KolimaForestBend_GetPlacements, KolimaForestBridge_GetPlacements, KolimaForestClearing_GetPlacements, KolimaForestRiver_GetPlacements, KolimaForestTree_GetPlacements, KolimaInteriors_GetPlacements, KolimaInteriors_TurnVillagersIntoTrees, Kolima_GetPlacements, Kolima_InitializeCursedVillagers, LaliveroInteriors_GetPlacements, Lalivero_GetPlacements, LamakanDesert_GetPlacements, LemurianShip_GetPlacements, MercuryLighthouseAerie_GetPlacements, MercuryLighthouse_GetPlacements, MogallForest_GetPlacements, ObjectTable_ResetForObject, Scene_AssignViewFlags, Scene_FindActorPlacement, Scene_GetPlacements, Scene_TalkToActor and 315 more.
SceneEvent
struct SceneEvent
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or an event script).
| Field | Declared as | |
|---|---|---|
control | u32 control | The kind and its detail, read by Scene_FindEvent and the item, Psynergy and search lookups; -1 ends the table. The detail bits depend on the kind. bits: 30..28 Psynergy phase | 15..12 touch facing | 15..8 item or ability | 11 short push | 10 facing | 9 walking | 8..4 search target | 7 Psynergy in area | 5..4 exit sound | 4 on an actor | 3..0 kind |
trigger | s16 trigger | What the event answers: an actor id, a tile's collision code, a marker id or a raised value. Item and Psynergy events read it as bits below; bit 10 also skips a search's checking message and a Psynergy's effect. bits: 15..12 facing | 11 needs facing | 10 own message | 7..0 target |
condition | s16 condition | -1 always, a flag | 0x1000 set, else the flag clear |
value | u32 value | A message below 0x10000, else an event function; for an exit, the exit kind its scene's exit table matches, and for a search, a FIND_ value. |
Used by AltmillerCave_GetEvents, BattleFx_FindMatchingEvent, BilibinCave_GetEvents, BilibinInteriors_GetEvents, Bilibin_GetEvents, ColosseumEntrance_GetEvents, ColossoLog_GetEvents, ColossoRiver_GetEvents, Event_SetSceneEvents, FieldEffect_SpawnNearbyMarkers, Field_FindItemEvent, Field_PlaceMapMarkers, Field_SearchTile, Field_UseItem, Field_UsePsynergy, ImilFuchinFalls_GetEvents, Imil_GetEvents, KalayInteriors_GetEvents, KalayTolbiDocks_GetEvents, Kalay_GetEvents, KolimaForestBend_GetEvents, KolimaForestBridge_GetEvents, KolimaForestClearing_GetEvents, KolimaForestRiver_GetEvents, KolimaForestTree_GetEvents, KolimaInteriors_GetEvents, Kolima_GetEvents, LaliveroInteriors_GetEvents, Lalivero_GetEvents, LamakanDesert_GetEvents, LemurianShip_GetEvents, MercuryLighthouseAerie_GetEvents, MercuryLighthouse_GetEvents, MogallForest_GetEvents, Scene_GetEvents, SolSanctumElementalStarRoom_GetEvents, SolSanctumEntrance_GetEvents, SolSanctumEruption_GetEvents, SolSanctumLunaSolRooms_GetEvents, SolSanctumStatue_GetEvents and 284 more.
Enumerations, without a comment: SceneId, Facing, ActorBehavior, ActorTalkFacing, SceneEventKind, SearchTarget.
Macros
PSYNERGY_PHASE_ON_ACTOR
#define PSYNERGY_PHASE_ON_ACTOR(ability, phase)
A Psynergy event on an actor at one phase of the cast, as PSYNERGY_IN_AREA is for an area.
Used by gAltmillerCave_Events4, gBabiLighthouse_EventsOther, gCrossboneIslePillarRoomsEvents5, gSolSanctumStatue_Events, gVenusLighthouseEvents3, gWorldMapEvents.
Also, macros without a comment: FACING_IS_NORTH, IF_FLAG_SET, SCENE_EXITS, SCENE_EXIT, SCENE_EXIT_IF, SCENE_EXITS_END, PLACEMENT_SHARE_PREVIOUS_SPRITE, PIXELS, EVENT_TOUCH_WALKING, EVENT_TOUCH_FACING, TOUCH_WALKING, TOUCH_FACING, TOUCH_WALKING_INTO, EVENT_PSYNERGY_ON_ACTOR, PSYNERGY_ON_ACTOR, EVENT_PSYNERGY_IN_AREA, PSYNERGY_IN_AREA, EVENT_ITEM_ON_ACTOR, USE_ITEM, USE_ITEM_ON_ACTOR, SEARCH, FIND_ITEM, FIND_COINS, FIND_PSYNERGY_STONE, FIND_MESSAGE, EVENT_SCRIPT, SCENE_EVENTS_END.