CommonLibSSE (powerof3)
AIProcess.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/A/ActorPackage.h"
4 #include "RE/A/ActorValues.h"
6 #include "RE/B/BSTArray.h"
7 #include "RE/B/BSTList.h"
8 #include "RE/B/BSTSmartPointer.h"
9 
10 namespace RE
11 {
12  enum class RESET_3D_FLAGS;
13  class Actor;
14  class bhkCharacterController;
15  class BipedAnim;
16  class NiAVObject;
17  class NiPoint3;
18  class TESForm;
19  class TESShout;
20  struct HighProcessData;
21  struct MiddleHighProcessData;
22 
23  enum class PROCESS_TYPE
24  {
25  kNone = static_cast<std::underlying_type_t<PROCESS_TYPE>>(-1),
26  kHigh = 0,
27  kMiddleHigh = 1,
28  kMiddleLow = 2,
29  kLow = 3
30  };
31 
33  {
34  public:
35  // members
36  std::int32_t hourPackageEvaluated; // 0
37  };
38  static_assert(sizeof(MiddleLowProcessData) == 0x4);
39 
41  {
42  public:
43  // members
44  float value; // 0
45  bool invalid; // 4
46  std::uint8_t pad5; // 5
47  std::uint16_t pad6; // 6
48  };
49  static_assert(sizeof(CachedValueData) == 0x8);
50 
51  struct CachedValues
52  {
53  public:
54  enum class Flags
55  {
56  kNone = 0,
57  kRadius = 1 << 0,
58  kWidth = 1 << 1,
59  kLength = 1 << 2,
60  kDPS = 1 << 3,
62  kEyeLevel = 1 << 9,
63  kConditionPreventsRun = 1 << 10,
64  kForwardLength = 1 << 11,
65  kActorIsGhost = 1 << 20,
66  kHealthDamaged = 1 << 21,
67  kMagickaPointsDamaged = 1 << 22,
68  kStaminaDamaged = 1 << 23,
69  kOwnerIsNPC = 1 << 25,
70  kOwnerIsUndead = 1 << 26,
72  };
73 
74  enum class BooleanValue
75  {
76  kNone = 0,
77  kConditionPreventsRun = 1 << 0,
78  kOwnerIsNPC = 1 << 1,
79  kOwnerIsUndead = 1 << 2,
81  };
82 
83  float cachedRadius; // 00
84  float cachedWidth; // 04
85  float cachedLength; // 08
86  float cachedForwardLength; // 0C
87  float cachedDPS; // 10
88  float cachedEyeLevel; // 14
89  float cachedWalkSpeed; // 18
90  float cachedRunSpeed; // 1C
91  float cachedJogSpeed; // 20
92  float cachedFastWalkSpeed; // 24
97  };
98  static_assert(sizeof(CachedValues) == 0x60);
99 
101  {
102  public:
103  // members
104  std::uint64_t unk00; // 00
105  std::uint64_t unk08; // 08
106  std::uint64_t unk10; // 10
107  std::uint64_t unk18; // 18
108  std::uint64_t unk20; // 20
109  };
110  static_assert(sizeof(ObjectstoAcquire) == 0x28);
111 
112  class AIProcess
113  {
114  public:
115  enum class LowProcessFlags : std::uint8_t
116  {
117  kNone = 0,
118  kTargetActivated = 1 << 0,
119  kCurrentActionComplete = 1 << 1,
120  kAlert = 1 << 3,
121  kFollower = 1 << 4,
122  kPackageDoneOnce = 1 << 5,
123  kPackageIdleDone = 1 << 6
124  };
125 
126  struct Hands
127  {
128  enum Hand : std::uint32_t
129  {
132  kTotal
133  };
134  };
135  using Hand = Hands::Hand;
136 
138  {
139  TESForm* object; // 00
141  };
142  static_assert(sizeof(EquippedObject) == 0x10);
143 
144  struct Data0B8
145  {
146  public:
147  // members
148  void* unk00; // 00
149  Data0B8* unk08; // 08
150  void* unk10; // 10
151  void* unk18; // 18
152  std::uint64_t unk20; // 20
153  void* unk28; // 28
154  std::uint32_t unk30; // 30
155  std::uint32_t pad34; // 34
156  };
157  static_assert(sizeof(Data0B8) == 0x38);
158 
159  void AddToProcedureIndexRunning(Actor* a_actor, std::uint32_t a_num);
160  void ClearActionHeadtrackTarget(bool a_defaultHold);
163  float GetCachedHeight() const;
170  [[nodiscard]] bool GetIsSummonedCreature() const noexcept;
173  float GetRegenDelay(ActorValue a_actorvalue) const;
175  Actor* GetUserData() const;
176  float GetVoiceRecoveryTime() const;
178  bool InHighProcess() const;
179  bool InMiddleHighProcess() const;
180  bool InMiddleLowProcess() const;
181  bool InLowProcess() const;
182  bool IsArrested() const;
183  bool IsGhost() const;
184  bool IsInCommandState() const;
185  void KnockExplosion(Actor* a_actor, const NiPoint3& a_location, float a_magnitude);
186  bool PlayIdle(Actor* a_actor, TESIdleForm* a_idle, TESObjectREFR* a_target);
188  void SetActorsDetectionEvent(Actor* a_actor, const NiPoint3& a_location, std::int32_t a_soundLevel, TESObjectREFR* a_ref);
189  void SetArrested(bool a_arrested);
190  void SetCachedHeight(float a_height);
191  void SetHeadtrackTarget(Actor* a_owner, NiPoint3& a_targetPosition);
193  void SetRunOncePackage(TESPackage* a_package, Actor* a_actor);
194  bool SetupSpecialIdle(Actor* a_actor, DEFAULT_OBJECT a_action, TESIdleForm* a_idle, bool a_arg5, bool a_arg6, TESObjectREFR* a_target);
195  void StopCurrentIdle(Actor* a_actor, bool a_forceIdleStop);
196  void Update3DModel(Actor* a_actor);
197  void UpdateRegenDelay(ActorValue a_actorValue, float a_regenDelay);
198 
199  // members
204  float hourLastProcessed; // 048
205  float dateLastProcessed; // 04C
207  std::int32_t numberItemsActivate; // 058
208  std::uint32_t pad05C; // 05C
213  float essentialDownTimer; // 090
214  float deathTime; // 094
215  float trackedDamage; // 098
216  std::uint32_t pad09C; // 09C
218  Data0B8 unk0B8; // 0B8
219  TESForm* equippedObjects[Hand::kTotal]; // 0F0
220  std::uint64_t unk100; // 100
221  std::uint64_t unk108; // 108
225  std::uint64_t unk120; // 120
226  std::uint64_t unk128; // 128
227  std::uint32_t unk130; // 130
228  std::uint16_t unk134; // 134
232  bool ignoringCombat; // 139
233  bool endAlarmOnActor; // 13A
234  bool escortingPlayer; // 13B
235  std::uint32_t pad13C; // 13C
236 
237  protected:
238  void Update3DModel_Impl(Actor* a_actor);
239  };
240  static_assert(sizeof(AIProcess) == 0x140);
241 }
Definition: AIProcess.h:113
CachedValues * cachedValues
Definition: AIProcess.h:206
float deathTime
Definition: AIProcess.h:214
std::uint32_t pad09C
Definition: AIProcess.h:216
float GetCachedHeight() const
bool endAlarmOnActor
Definition: AIProcess.h:233
std::int32_t numberItemsActivate
Definition: AIProcess.h:207
NiAVObject * GetWeaponNode(const BSTSmartPointer< BipedAnim > &a_biped) const
float hourLastProcessed
Definition: AIProcess.h:204
void KnockExplosion(Actor *a_actor, const NiPoint3 &a_location, float a_magnitude)
void AddToProcedureIndexRunning(Actor *a_actor, std::uint32_t a_num)
void SetCachedHeight(float a_height)
std::uint32_t unk130
Definition: AIProcess.h:227
TESForm * equippedObjects[Hand::kTotal]
Definition: AIProcess.h:219
TESForm * GetEquippedRightHand()
MiddleLowProcessData * middleLow
Definition: AIProcess.h:200
bool ignoringCombat
Definition: AIProcess.h:232
bool GetIsSummonedCreature() const noexcept
RefHandle followTarget
Definition: AIProcess.h:222
bool InMiddleHighProcess() const
ObjectRefHandle GetHeadtrackTarget() const
float GetRegenDelay(ActorValue a_actorvalue) const
TESPackage * GetRunningPackage() const
ObjectstoAcquire * savedAcquireObject
Definition: AIProcess.h:212
Data0B8 unk0B8
Definition: AIProcess.h:218
bool skippedTimeStampForPathing
Definition: AIProcess.h:231
BSSimpleList< TESObjectREFR * > genericLocations
Definition: AIProcess.h:210
bool InLowProcess() const
void SetRunOncePackage(TESPackage *a_package, Actor *a_actor)
REX::EnumSet< PROCESS_TYPE, std::uint8_t > processLevel
Definition: AIProcess.h:230
bool escortingPlayer
Definition: AIProcess.h:234
ActorPackage currentPackage
Definition: AIProcess.h:203
bool IsInCommandState() const
bool InMiddleLowProcess() const
ObjectstoAcquire * acquireObject
Definition: AIProcess.h:211
void Update3DModel_Impl(Actor *a_actor)
float GetVoiceRecoveryTime() const
std::uint64_t unk128
Definition: AIProcess.h:226
BSSimpleList< ObjectstoAcquire * > objects
Definition: AIProcess.h:209
void ClearActionHeadtrackTarget(bool a_defaultHold)
void ComputeLastTimeProcessed()
bool PlayIdle(Actor *a_actor, TESIdleForm *a_idle, TESObjectREFR *a_target)
void ClearMuzzleFlashes()
void SetActorsDetectionEvent(Actor *a_actor, const NiPoint3 &a_location, std::int32_t a_soundLevel, TESObjectREFR *a_ref)
bool IsGhost() const
RefHandle arrestTarget
Definition: AIProcess.h:224
bhkCharacterController * GetCharController()
std::uint64_t unk108
Definition: AIProcess.h:221
ObjectRefHandle GetOccupiedFurniture() const
void SetHeadtrackTarget(Actor *a_owner, NiPoint3 &a_targetPosition)
RefHandle target
Definition: AIProcess.h:223
std::uint16_t unk134
Definition: AIProcess.h:228
bool SetupSpecialIdle(Actor *a_actor, DEFAULT_OBJECT a_action, TESIdleForm *a_idle, bool a_arg5, bool a_arg6, TESObjectREFR *a_target)
TESShout * GetCurrentShout()
float trackedDamage
Definition: AIProcess.h:215
bool InHighProcess() const
std::uint64_t unk120
Definition: AIProcess.h:225
MiddleHighProcessData * middleHigh
Definition: AIProcess.h:201
NiAVObject * GetMagicNode(const BSTSmartPointer< BipedAnim > &a_biped) const
std::uint32_t pad05C
Definition: AIProcess.h:208
std::uint32_t pad13C
Definition: AIProcess.h:235
void StopCurrentIdle(Actor *a_actor, bool a_forceIdleStop)
LowProcessFlags
Definition: AIProcess.h:116
void RandomlyPlaySpecialIdles(Actor *a_actor)
void Set3DUpdateFlag(RESET_3D_FLAGS a_flags)
float dateLastProcessed
Definition: AIProcess.h:205
float essentialDownTimer
Definition: AIProcess.h:213
std::uint64_t unk100
Definition: AIProcess.h:220
HighProcessData * high
Definition: AIProcess.h:202
void Update3DModel(Actor *a_actor)
Actor * GetUserData() const
ActorHandle GetCommandingActor() const
TESForm * GetEquippedLeftHand()
bool IsArrested() const
void SetArrested(bool a_arrested)
void UpdateRegenDelay(ActorValue a_actorValue, float a_regenDelay)
BSTArray< EquippedObject > equippedForms
Definition: AIProcess.h:217
REX::EnumSet< LowProcessFlags, std::uint8_t > lowProcessFlags
Definition: AIProcess.h:229
Definition: ActorPackage.h:12
Definition: Actor.h:133
Definition: BGSEquipSlot.h:10
Definition: BSTList.h:10
Definition: BSTArray.h:378
Definition: BSTSmartPointer.h:37
Definition: BipedAnim.h:42
Definition: AIProcess.h:33
std::int32_t hourPackageEvaluated
Definition: AIProcess.h:36
Definition: NiAVObject.h:51
Definition: NiPoint3.h:6
Definition: TESForm.h:36
Definition: TESIdleForm.h:37
Definition: TESObjectREFR.h:114
Definition: TESPackage.h:310
Definition: TESShout.h:18
Definition: bhkCharacterController.h:73
Definition: BSDirectInputManager.h:8
EnumSet(Args...) -> EnumSet< std::common_type_t< Args... >, std::underlying_type_t< std::common_type_t< Args... >>>
Definition: AbsorbEffect.h:6
RESET_3D_FLAGS
Definition: MiddleHighProcessData.h:41
ActorValue
Definition: ActorValues.h:6
PROCESS_TYPE
Definition: AIProcess.h:24
std::uint32_t RefHandle
Definition: BSCoreTypes.h:6
Definition: EffectArchetypes.h:65
Definition: AIProcess.h:145
void * unk28
Definition: AIProcess.h:153
std::uint32_t unk30
Definition: AIProcess.h:154
std::uint64_t unk20
Definition: AIProcess.h:152
void * unk00
Definition: AIProcess.h:148
std::uint32_t pad34
Definition: AIProcess.h:155
void * unk18
Definition: AIProcess.h:151
Data0B8 * unk08
Definition: AIProcess.h:149
void * unk10
Definition: AIProcess.h:150
Definition: AIProcess.h:138
BGSEquipSlot * slot
Definition: AIProcess.h:140
TESForm * object
Definition: AIProcess.h:139
Definition: AIProcess.h:127
Hand
Definition: AIProcess.h:129
@ kRight
Definition: AIProcess.h:131
@ kLeft
Definition: AIProcess.h:130
@ kTotal
Definition: AIProcess.h:132
Definition: AIProcess.h:41
float value
Definition: AIProcess.h:44
std::uint16_t pad6
Definition: AIProcess.h:47
std::uint8_t pad5
Definition: AIProcess.h:46
bool invalid
Definition: AIProcess.h:45
Definition: AIProcess.h:52
float cachedDPS
Definition: AIProcess.h:87
float cachedRunSpeed
Definition: AIProcess.h:90
BooleanValue
Definition: AIProcess.h:75
float cachedLength
Definition: AIProcess.h:85
REX::EnumSet< BooleanValue, std::uint32_t > booleanValues
Definition: AIProcess.h:93
BSTArray< CachedValueData > actorValueCache
Definition: AIProcess.h:95
float cachedJogSpeed
Definition: AIProcess.h:91
Flags
Definition: AIProcess.h:55
REX::EnumSet< Flags, std::uint32_t > flags
Definition: AIProcess.h:94
float cachedEyeLevel
Definition: AIProcess.h:88
float cachedFastWalkSpeed
Definition: AIProcess.h:92
float cachedForwardLength
Definition: AIProcess.h:86
float cachedWidth
Definition: AIProcess.h:84
float cachedRadius
Definition: AIProcess.h:83
BSTArray< CachedValueData > maxActorValueCache
Definition: AIProcess.h:96
float cachedWalkSpeed
Definition: AIProcess.h:89
DEFAULT_OBJECT
Definition: BGSDefaultObjectManager.h:12
Definition: HighProcessData.h:61
Definition: MiddleHighProcessData.h:133
Definition: AIProcess.h:101
std::uint64_t unk20
Definition: AIProcess.h:108
std::uint64_t unk00
Definition: AIProcess.h:104
std::uint64_t unk18
Definition: AIProcess.h:107
std::uint64_t unk10
Definition: AIProcess.h:106
std::uint64_t unk08
Definition: AIProcess.h:105