Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Misc. updates. #26

Merged
merged 26 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
89b88cf
chore: ID updates. (#10)
FlenarnTemp Jul 10, 2024
f0c9020
misc re and id updates (#11)
FlenarnTemp Jul 14, 2024
34f57a6
Further reverse engineering. (#12)
FlenarnTemp Jul 18, 2024
7ed7ff5
misc re (#13)
FlenarnTemp Jul 21, 2024
d7dc506
events and pr madness (#14)
FlenarnTemp Jul 23, 2024
8c1243b
a lot more stuff (#15)
FlenarnTemp Jul 30, 2024
0d3e66c
fixes (#16)
FlenarnTemp Jul 30, 2024
dae0e27
oopsies (#17)
FlenarnTemp Jul 30, 2024
1884a18
misc adjustments (#18)
FlenarnTemp Jul 30, 2024
afe2eea
misc work here and there (#19)
FlenarnTemp Aug 13, 2024
3b032bf
ExamineMenu related work. (#20)
FlenarnTemp Aug 26, 2024
fa86596
Update BGSMod.h
FalloutCascadia Aug 26, 2024
b13e4e6
Update TESForms.h
FalloutCascadia Aug 26, 2024
54edc26
Update TESForms.h
FalloutCascadia Aug 26, 2024
e7f30bd
misc (#21)
FlenarnTemp Aug 26, 2024
77c6b0c
ids and misc funcs (#22)
FlenarnTemp Sep 7, 2024
1fbc8eb
Merge branch 'shad0wshayd3-FO4:master' into master
FalloutCascadia Sep 7, 2024
f5f8562
Merge branch 'shad0wshayd3-FO4:master' into master
FalloutCascadia Nov 2, 2024
74769a8
feat: IDs and misc. function declaration. (#23)
FlenarnTemp Nov 2, 2024
cc75a95
feat: PipboyPrimitiveValue (#24)
FlenarnTemp Nov 18, 2024
ff28b6b
Merge branch 'shad0wshayd3-FO4:master' into master
FalloutCascadia Nov 18, 2024
861fa6c
maintenance
FalloutCascadia Nov 18, 2024
73753ec
Merge branch 'shad0wshayd3-FO4:master' into master
FalloutCascadia Nov 23, 2024
0a2d0e4
Merge branch 'shad0wshayd3-FO4:master' into master
FalloutCascadia Dec 10, 2024
375e350
Actor Utils (#25)
FalloutCascadia Dec 10, 2024
631b286
Appease compiler gods. (#26)
FlenarnTemp Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CommonLibF4/cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(SOURCES
include/RE/Bethesda/AITimeStamp.h
include/RE/Bethesda/ActiveEffect.h
include/RE/Bethesda/Actor.h
include/RE/Bethesda/ActorUtils.h
include/RE/Bethesda/ActorValueInfo.h
include/RE/Bethesda/Archive2.h
include/RE/Bethesda/Atomic.h
Expand Down Expand Up @@ -197,10 +198,25 @@ set(SOURCES
include/RE/Bethesda/Movement.h
include/RE/Bethesda/NavMesh.h
include/RE/Bethesda/NavMeshInfoMap.h
include/RE/Bethesda/PipboyArray.h
include/RE/Bethesda/PipboyDataGroup.h
include/RE/Bethesda/PipboyDataManager.h
include/RE/Bethesda/PipboyInventoryData.h
include/RE/Bethesda/PipboyInventoryUtils.h
include/RE/Bethesda/PipboyLogData.h
include/RE/Bethesda/PipboyManager.h
include/RE/Bethesda/PipboyMapData.h
include/RE/Bethesda/PipboyPerksData.h
include/RE/Bethesda/PipboyPlayerInfoData.h
include/RE/Bethesda/PipboyPrimitiveValue.h
include/RE/Bethesda/PipboyQuestData.h
include/RE/Bethesda/PipboyRadioData.h
include/RE/Bethesda/PipboySpecialData.h
include/RE/Bethesda/PipboyStatsData.h
include/RE/Bethesda/PipboyStatusData.h
include/RE/Bethesda/PipboyThrottleManager.h
include/RE/Bethesda/PipboyValue.h
include/RE/Bethesda/PipboyWorkshopData.h
include/RE/Bethesda/PlayerCharacter.h
include/RE/Bethesda/PlayerControls.h
include/RE/Bethesda/PowerArmor.h
Expand Down
228 changes: 141 additions & 87 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

namespace RE
{
enum class ACTOR_CRITICAL_STAGE;
enum class ACTOR_LIFE_STATE;
enum class ACTOR_LOS_LOCATION;
enum class ATTACK_STATE_ENUM;
enum class COMMAND_TYPE;
enum class DEFAULT_OBJECT;
Expand Down Expand Up @@ -112,53 +109,89 @@ namespace RE
struct PerkEntryUpdatedEvent;
}

enum class ACTOR_CRITICAL_STAGE : std::int32_t
{
kNone = 0x0,
kGooStart = 0x1,
kGooEnd = 0x2,
kDisintegrateStart = 0x3,
kDisintegrateEnd = 0x4,
kFreezeStart = 0x5,
kFreezeEnd = 0x6,
kCount = 0x7
};

enum class ACTOR_LIFE_STATE : std::int32_t
{
kAlive = 0x0,
kDying = 0x1,
kDead = 0x2,
kUnconscious = 0x3,
kReanimate = 0x4,
kRecycle = 0x5,
kRestrained = 0x6,
kEssentialDown = 0x7,
kBleedout = 0x8
};

enum class ACTOR_LOS_LOCATION : std::int32_t
{
kNone = 0x0,
kEye = 0x1,
kHead = 0x2,
kTorse = 0x3,
kFeet = 0x4,
kCount = 0x5
};

enum class PTYPE : std::int32_t
{
kExplore = 0,
kFollow = 1,
kEscore = 2,
kEat = 3,
kSleep = 4,
kWander = 5,
kTravel = 6,
kAccompany = 7,
kUseItemAt = 8,
kAmbush = 9,
kFleeNonCombat = 10,
kCastMagic = 11,
kSandbox = 12,
kPatrol = 13,
kGuard = 14,
kDialogue = 15,
kUseWeapon = 16,
kFind = 17,
kCustom = 18,
kTemplate = 19,
kActivate = 20,
kAlarm = 21,
kFlee = 22,
kTrespass = 23,
kSpectator = 24,
kGreet = 25,
kGetUp = 26,
kDoNothing = 27,
kInGameDialogue = 28,
kSurface = 29,
kSearchForAttacker = 30,
kAvoidReference = 31,
kBumpReaction = 32,
kGrenadeMineReaction = 33,
kStealWarning = 34,
kPickpocketWarning = 35,
kMovementBlocked = 36,
kVampireFeed = 37,
kCannibal = 38,
kLand = 39,
kUnused = 40,
kMountActor = 41,
kDismountActor = 42,
kClearMountPosition = 43,
kClearPowerArmorExit = 44,
kExplore = 0x0,
kFollow = 0x1,
kEscore = 0x2,
kEat = 0x3,
kSleep = 0x4,
kWander = 0x5,
kTravel = 0x6,
kAccompany = 0x7,
kUseItemAt = 0x8,
kAmbush = 0x9,
kFleeNonCombat = 0xA,
kCastMagic = 0xB,
kSandbox = 0xC,
kPatrol = 0xD,
kGuard = 0xE,
kDialogue = 0xF,
kUseWeapon = 0x10,
kFind = 0x11,
kCustom = 0x12,
kTemplate = 0x13,
kActivate = 0x14,
kAlarm = 0x15,
kFlee = 0x16,
kTrespass = 0x17,
kSpectator = 0x18,
kGreet = 0x19,
kGetUp = 0x1A,
kDoNothing = 0x1B,
kInGameDialogue = 0x1C,
kSurface = 0x1D,
kSearchForAttacker = 0x1E,
kAvoidReference = 0x1F,
kBumpReaction = 0x20,
kGrenadeMineReaction = 0x21,
kStealWarning = 0x22,
kPickpocketWarning = 0x23,
kMovementBlocked = 0x24,
kVampireFeed = 0x25,
kCannibal = 0x26,
kLand = 0x27,
kUnused = 0x28,
kMountActor = 0x29,
kDismountActor = 0x2A,
kClearMountPosition = 0x2B,
kClearPowerArmorExit = 0x2C,
kCount = 0x2D
};

struct MiddleLowProcessData
Expand Down Expand Up @@ -490,9 +523,9 @@ namespace RE

enum class WEAPON_CULL_TYPE
{
kGeneral,
kAnimation,
kWeaponSwitch,
kGeneral = 0x0,
kAnimation = 0x1,
kWeaponSwitch = 0x2,
};

class AITimer
Expand Down Expand Up @@ -537,7 +570,7 @@ namespace RE
void KnockExplosion(Actor* a_actor, const NiPoint3& a_location, float a_magnitude)
{
using func_t = decltype(&AIProcess::KnockExplosion);
static REL::Relocation<func_t> func{ REL::ID(533106) };
static REL::Relocation<func_t> func{ REL::ID(2232384) };
return func(this, a_actor, a_location, a_magnitude);
}

Expand All @@ -556,7 +589,7 @@ namespace RE
bool RequestLoadAnimationsForWeaponChange(Actor& a_actor)
{
using func_t = decltype(&AIProcess::RequestLoadAnimationsForWeaponChange);
static REL::Relocation<func_t> func{ REL::ID(666002) };
static REL::Relocation<func_t> func{ REL::ID(2231758) };
return func(this, a_actor);
}

Expand Down Expand Up @@ -697,46 +730,46 @@ namespace RE

enum class LIFE_STATE : std::uint32_t
{
kAlive,
kDying,
kDead,
kUnconscious,
kReanimate,
kRecycle,
kRestrained,
kEssentialDown,
kBleedout
kAlive = 0x0,
kDying = 0x1,
kDead = 0x2,
kUnconscious = 0x3,
kReanimate = 0x4,
kRecycle = 0x5,
kRestrained = 0x6,
kEssentialDown = 0x7,
kBleedout = 0x8
};

enum class WEAPON_STATE : std::uint32_t
{
kSheathed,
kWantToDraw,
kDrawing,
kDrawn,
kWantToSheathe,
kSheathing
kSheathed = 0x0,
kWantToDraw = 0x1,
kDrawing = 0x2,
kDrawn = 0x3,
kWantToSheathe = 0x4,
kSheathing = 0x5
};

enum class GUN_STATE : std::uint32_t
{
kDrawn,
kRelaxed,
kBlocked,
kAlert,
kReloading,
kThrowing,
kSighted,
kFire,
kFireSighted
kDrawn = 0x0,
kRelaxed = 0x1,
kBlocked = 0x2,
kAlert = 0x3,
kReloading = 0x4,
kThrowing = 0x5,
kSighted = 0x6,
kFire = 0x7,
kFireSighted = 0x8
};

enum class INTERACTING_STATE : std::uint32_t
{
kNotInteracting,
kWaitingToInteract,
kInteracting,
kWaitingToStopInteracting
kNotInteracting = 0x0,
kWaitingToInteract = 0x1,
kInteracting = 0x2,
kWaitingToStopInteracting = 0x3
};

class __declspec(novtable) ActorState :
Expand Down Expand Up @@ -881,12 +914,12 @@ namespace RE

enum class DETECTION_PRIORITY
{
kNone = 0,
kVeryLow = 1,
kLow = 2,
kNormal = 3,
kHigh = 4,
kCritical = 5,
kNone = 0x0,
kVeryLow = 0x1,
kLow = 0x2,
kNormal = 0x3,
kHigh = 0x4,
kCritical = 0x5,
};

// add
Expand Down Expand Up @@ -1265,6 +1298,20 @@ namespace RE
return func(this, a_refr, a_owner, a_crime);
}

void UpdateVoiceTimer(bool a_force)
{
using func_t = decltype(&Actor::UpdateVoiceTimer);
static REL::Relocation<func_t> func{ REL::ID(2230178) };
return func(this, a_force);
}

BGSBodyPartData* GetBodyPartData()
{
using func_t = decltype(&Actor::GetBodyPartData);
static REL::Relocation<func_t> func{ REL::ID(2229571) };
return func(this);
}

// members
NiTFlags<std::uint32_t, Actor> niFlags; // 2D0
float updateTargetTimer; // 2D4
Expand Down Expand Up @@ -1366,6 +1413,13 @@ namespace RE
static REL::Relocation<func_t> func{ REL::ID(2231395) };
return func(this, a_actor, a_object, a_number, a_slot, a_stackID, a_queueEquip, a_forceEquip, a_playSounds, a_applyNow, a_slotBeingReplaced);
}

void UnequipItem(Actor* a_actor, const EquippedItem* a_equippedItem, bool a_queueEquip)
{
using func_t = decltype(&ActorEquipManager::UnequipItem);
static REL::Relocation<func_t> func{ REL::ID(2231399) };
return func(this, a_actor, a_equippedItem, a_queueEquip);
}
};
static_assert(sizeof(ActorEquipManager) == 0x60);
}
60 changes: 60 additions & 0 deletions CommonLibF4/include/RE/Bethesda/ActorUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#pragma once

#include "RE/Bethesda/TESBoundObjects.h"

namespace RE
{
namespace ActorUtils
{
class __declspec(novtable) ArmorRatingVisitorBase
{
public:
static constexpr auto RTTI{ RTTI::ActorUtils__ArmorRatingVisitorBase };
static constexpr auto VTABLE{ VTABLE::ActorUtils__ArmorRatingVisitorBase };

ArmorRatingVisitorBase()
{
stl::emplace_vtable(this);
}

virtual bool ShouldProcess(TESBoundObject*) { return 1; }; // 00
virtual void PostPRocess(TESBoundObject*){}; // 01

Actor* actor; // 08
float rating; // 10
float armorPerks; // 14
bool checkEquipped; // 18

void ctor(const Actor* a_actor, bool a_checkEquipped)
{
using func_t = decltype(&ArmorRatingVisitorBase::ctor);
REL::Relocation<func_t> func{ REL::ID(2227205) };
return func(this, a_actor, a_checkEquipped);
}

ArmorRatingVisitorBase(const Actor* a_actor, bool a_checkEquipped)
{
ctor(a_actor, a_checkEquipped);
}

std::int64_t operator()(const BGSInventoryItem* a_item, std::uint32_t a_stackID)
{
using func_t = decltype(&ArmorRatingVisitorBase::operator());
REL::Relocation<func_t> func{ REL::ID(2227206) };
return func(this, a_item, a_stackID);
}
};
static_assert(offsetof(ArmorRatingVisitorBase, rating) == 0x10);
static_assert(sizeof(ArmorRatingVisitorBase) == 0x20);

class __declspec(novtable) ArmorRatingVisitor :
public ArmorRatingVisitorBase // 00
{
static constexpr auto RTTI{ RTTI::ActorUtils__ArmorRatingVisitor };
static constexpr auto VTABLE{ VTABLE::ActorUtils__ArmorRatingVisitor };

BSScrapArray<TESBoundObject*> foundArmor; // 20
};
static_assert(sizeof(ArmorRatingVisitor) == 0x40);
}
}
Loading
Loading