mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-02 22:14:33 +00:00
Document NPC talking and player tracking (#1426)
* Rename npc dialog state variable * Rename and doc NPC actor talking funtion * Introduce NpcTalkState enum * Rename NPC_TALK_STATE enum values * Document NpcPlayerInteractionState and related functions * Rename player tracking opt enum variants * Rename npc functions, interact info * Minor npc actor function tweaks * Minor comment fixes for npc * Generalize NPC player tracking to point tracking * Change unused NpcInteractInfo field type and name Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Rename headRot and torsoRot * Rename GetTalkState to UpdateTalkState * Minor comment fixes * Rename rotateActorShape and clarify related comments * Remove unneeded parentheses in z_en_heishi4.c * Reformat * Remove unclear comment * Rename yPosOffset to yOffset Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
parent
9c35716fe2
commit
b57f2162ee
66 changed files with 936 additions and 808 deletions
|
@ -19,8 +19,8 @@ struct Lights;
|
|||
|
||||
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
|
||||
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
|
||||
typedef u16 (*callback1_800343CC)(struct PlayState*, struct Actor*);
|
||||
typedef s16 (*callback2_800343CC)(struct PlayState*, struct Actor*);
|
||||
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
|
||||
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
|
||||
|
||||
typedef struct {
|
||||
Vec3f pos;
|
||||
|
@ -532,4 +532,31 @@ typedef enum {
|
|||
#define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples
|
||||
#define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check?
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
|
||||
/* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
|
||||
/* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation
|
||||
/* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done
|
||||
} NpcTalkState;
|
||||
|
||||
typedef enum {
|
||||
/* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn
|
||||
/* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player)
|
||||
/* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso
|
||||
/* 0x3 */ NPC_TRACKING_HEAD, // Track target by turning the head
|
||||
/* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head
|
||||
} NpcTrackingMode;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 talkState;
|
||||
/* 0x02 */ s16 trackingMode;
|
||||
/* 0x04 */ s16 autoTurnTimer;
|
||||
/* 0x06 */ s16 autoTurnState;
|
||||
/* 0x08 */ Vec3s headRot;
|
||||
/* 0x0E */ Vec3s torsoRot;
|
||||
/* 0x14 */ f32 yOffset; // Y position offset to add to actor position when calculating angle to target
|
||||
/* 0x18 */ Vec3f trackPos;
|
||||
/* 0x24 */ char unk_24[0x4];
|
||||
} NpcInteractInfo; // size = 0x28
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue