Skip to content

Commit

Permalink
misc re and id updates (#11)
Browse files Browse the repository at this point in the history
* feat: Scaleform IDs updated.

* feat: NiController ID update.

* feat: Actor IDs updated.

* chore: Update 'BSInputEnableManager' IDs.

* chore: More misc. IDs updated.
feat: Functions delcared in BGSScene.

* chore: More IDs updated.

* chore: Single ID update.
feat: ´Float´ & ´Float0To1´ added to BSRandom.

* feat: Few more functions.

* feat: Further implementation of BGSSceneAction classes.
  • Loading branch information
FlenarnTemp authored Jul 14, 2024
1 parent 89b88cf commit f0c9020
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 49 deletions.
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,13 @@ 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);
}

// members
NiTFlags<std::uint32_t, Actor> niFlags; // 2D0
float updateTargetTimer; // 2D4
Expand Down
52 changes: 36 additions & 16 deletions CommonLibF4/include/RE/Bethesda/BGSSceneAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,26 @@ namespace RE
virtual ~BGSSceneAction(); // 00

// add
virtual void Unk_01(void); // 01
virtual void Unk_02(void); // 02
virtual void Unk_03(void); // 03
virtual void Unk_04(void); // 04
virtual void Unk_05(void); // 05
virtual void Load(void); // 01
virtual void InitItem(void); // 02
virtual void OnDelete(void); // 03
virtual void ClearData(void); // 04
virtual void Copy(void); // 05
virtual bool QIsLooping(void); // 06
virtual bool QFaceHeadTrackTarget(const BGSScene* scene); // 07
virtual SCENE_ACTION_TYPE GetActionType() const = 0; // 08
virtual bool QActionCanEnd(); // 09
virtual bool IsPackageActive(BGSScene* scene, TESPackage* package, Actor* actor); // 0A
virtual void Unk_0B(void); // 0B
virtual void Unk_0C(void); // 0C
virtual void Unk_0D(void); // 0D
virtual void Unk_0E(void); // 0E
virtual void Unk_0F(void); // 0F
virtual void Unk_10(void); // 10
virtual void Unk_11(void); // 11
virtual void LoadGame(void); // 0B
virtual void SaveGame(void); // 0C
virtual void Revert(void); // 0D
virtual void InitLoadGame(void); // 0E
virtual void ResetActionData(void); // 0F
virtual void SetInput(void); // 10
virtual float GetActionPercentDone(const BGSScene* scene); // 11
virtual void StartAction(BGSScene* scene); // 12
virtual void EndAction(BGSScene* scene); // 13
virtual void CleanUpActionActor(void); // 14
virtual void CleanUpActionActor(BGSScene* scene); // 14
virtual void UpdateAction(BGSScene* scene); // 14

// members
Expand Down Expand Up @@ -158,12 +158,32 @@ namespace RE
TESTopic* pNPCResponseTopics[4]; // 98
BGSKeyword* pNPCResponseSubtypeKeywords[4]; // B8
TESTopic* pTopic; // D8
SCENE_ACTION_PLAYER_RESPONSE_TYPE playerInput; // E0
std::uint32_t playerInput; // E0

TESTopicInfo* GetCurrentTopicInfo(BGSScene* a_parentScene, TESObjectREFR* a_target, std::uint32_t a_type)
{
using func_t = decltype(&BGSSceneActionPlayerDialogue::GetCurrentTopicInfo);
static REL::Relocation<func_t> func{ REL::ID(2196825) };
return func(this, a_parentScene, a_target, a_type);
}
};
static_assert(sizeof(BGSSceneActionPlayerDialogue) == 0xE8);

class __declspec(novtable) BGSSceneActionNPCResponseDialogue : public BGSSceneActionConversationBase
{};
class __declspec(novtable) BGSSceneActionNPCResponseDialogue :
public BGSSceneActionConversationBase
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionNPCResponseDialogue };
static constexpr auto VTABLE{ VTABLE::BGSSceneActionNPCResponseDialogue };

TESTopicInfo* GetCurrentTopicInfo(BGSScene* a_parentScene)
{
using func_t = decltype(&BGSSceneActionNPCResponseDialogue::GetCurrentTopicInfo);
static REL::Relocation<func_t> func{ REL::ID(2196825) };
return func(this, a_parentScene);
}
};
static_assert(sizeof(BGSSceneActionNPCResponseDialogue) == 0x90);

class __declspec(novtable) BGSSceneActionStartScene :
public BGSSceneAction
Expand Down
10 changes: 5 additions & 5 deletions CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace RE
[[nodiscard]] std::uint32_t DecRef() const
{
using func_t = decltype(&BSInputEnableLayer::DecRef);
static REL::Relocation<func_t> func{ REL::ID(659989) };
static REL::Relocation<func_t> func{ REL::ID(2268272) };
return func(this);
}

Expand Down Expand Up @@ -77,14 +77,14 @@ namespace RE

[[nodiscard]] static BSInputEnableManager* GetSingleton()
{
static REL::Relocation<BSInputEnableManager**> singleton{ REL::ID(781703) };
static REL::Relocation<BSInputEnableManager**> singleton{ REL::ID(2689007) };
return *singleton;
}

bool AllocateNewLayer(BSTSmartPointer<BSInputEnableLayer>& a_layer, const char* a_debugName)
{
using func_t = decltype(&BSInputEnableManager::AllocateNewLayer);
static REL::Relocation<func_t> func{ REL::ID(537494) };
static REL::Relocation<func_t> func{ REL::ID(2268244) };
return func(this, a_layer, a_debugName);
}

Expand All @@ -98,14 +98,14 @@ namespace RE
bool EnableUserEvent(std::uint32_t a_layerID, UEFlag a_userEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID)
{
using func_t = decltype(&BSInputEnableManager::EnableUserEvent);
static REL::Relocation<func_t> func{ REL::ID(1432984) };
static REL::Relocation<func_t> func{ REL::ID(2268263) };
return func(this, a_layerID, a_userEventFlags, a_enable, a_senderID);
}

bool EnableOtherEvent(std::uint32_t a_layerID, OEFlag a_otherEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID)
{
using func_t = decltype(&BSInputEnableManager::EnableOtherEvent);
static REL::Relocation<func_t> func{ REL::ID(1419268) };
static REL::Relocation<func_t> func{ REL::ID(2268265) };
return func(this, a_layerID, a_otherEventFlags, a_enable, a_senderID);
}

Expand Down
14 changes: 14 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSRandom.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,19 @@ namespace RE
static REL::Relocation<func_t> func{ REL::ID(2267950) };
return func(a_min, a_max);
}

inline float Float(float a_min, float a_max)
{
using func_t = decltype(&BSRandom::Float);
static REL::Relocation<func_t> func{ REL::ID(2267953) };
return func(a_min, a_max);
}

inline float Float0To1()
{
using func_t = decltype(&BSRandom::Float0To1);
static REL::Relocation<func_t> func{ REL::ID(2267954) };
return func();
}
}
}
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BSUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace RE::BSUtilities
inline NiAVObject* GetObjectByName(NiAVObject* a_root, const BSFixedString& a_name, bool a_tryInternal, bool a_dontAttach)
{
using func_t = decltype(&GetObjectByName);
static REL::Relocation<func_t> func{ REL::ID(843650) };
static REL::Relocation<func_t> func{ REL::ID(2274841) };
return func(a_root, a_name, a_tryInternal, a_dontAttach);
}
}
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MagicItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace RE
void GetDescription(BSStringT<char>* a_buffer, const char* a_beginTagFormat, const char* a_endTagFormat, float a_magnitude, float a_duration)
{
using func_t = decltype(&EffectItem::GetDescription);
static REL::Relocation<func_t> func{ REL::ID(949839) };
static REL::Relocation<func_t> func{ REL::ID(2189612) };
return func(this, a_buffer, a_beginTagFormat, a_endTagFormat, a_magnitude, a_duration);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MenuControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace RE
public:
[[nodiscard]] static MenuControls* GetSingleton()
{
static REL::Relocation<MenuControls**> singleton{ REL::ID(520890) };
static REL::Relocation<MenuControls**> singleton{ REL::ID(2689089) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MenuTopicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace RE

[[nodiscard]] static MenuTopicManager* GetSingleton()
{
static REL::Relocation<MenuTopicManager**> singleton{ REL::ID(520890) }; // TODO: Update
static REL::Relocation<MenuTopicManager**> singleton{ REL::ID(2689089) };
return *singleton;
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/MessageMenuManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace RE
public:
[[nodiscard]] static MessageMenuManager* GetSingleton()
{
static REL::Relocation<MessageMenuManager**> singleton{ REL::ID(959572) };
static REL::Relocation<MessageMenuManager**> singleton{ REL::ID(2689087) };
return *singleton;
}

Expand All @@ -104,7 +104,7 @@ namespace RE
bool a_ensureUnique = false)
{
using func_t = decltype(&MessageMenuManager::Create);
static REL::Relocation<func_t> func{ REL::ID(89563) };
static REL::Relocation<func_t> func{ REL::ID(2249456) };
return func(this, a_headerText, a_bodyText, a_callback, a_warningContext, a_button1Text, a_button2Text, a_button3Text, a_button4Text, a_ensureUnique);
}

Expand Down
23 changes: 8 additions & 15 deletions CommonLibF4/include/RE/Bethesda/PipboyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,63 +62,56 @@ namespace RE

[[nodiscard]] static PipboyManager* GetSingleton()
{
static REL::Relocation<PipboyManager**> singleton{ REL::ID(553234) };
static REL::Relocation<PipboyManager**> singleton{ REL::ID(2691945) };
return *singleton;
}

void AddMenuToPipboy(IMenu& a_menu, const NiRect<float>& a_standVP, const NiRect<float>& a_powerVP)
{
using func_t = decltype(&PipboyManager::AddMenuToPipboy);
static REL::Relocation<func_t> func{ REL::ID(394568) };
static REL::Relocation<func_t> func{ REL::ID(2225453) };
return func(this, a_menu, a_standVP, a_powerVP);
}

void ClosedownPipboy()
{
using func_t = decltype(&PipboyManager::ClosedownPipboy);
static REL::Relocation<func_t> func{ REL::ID(731410) };
return func(this);
}

void DisablePipboyShader()
{
using func_t = decltype(&PipboyManager::DisablePipboyShader);
static REL::Relocation<func_t> func{ REL::ID(662519) };
static REL::Relocation<func_t> func{ REL::ID(2225480) };
return func(this);
}

void EnablePipboyShader()
{
using func_t = decltype(&PipboyManager::EnablePipboyShader);
static REL::Relocation<func_t> func{ REL::ID(157921) };
static REL::Relocation<func_t> func{ REL::ID(2225484) };
return func(this);
}

void InitPipboy()
{
using func_t = decltype(&PipboyManager::InitPipboy);
static REL::Relocation<func_t> func{ REL::ID(1477369) };
static REL::Relocation<func_t> func{ REL::ID(2225479) };
return func(this);
}

void LowerPipboy(LOWER_REASON a_reason)
{
using func_t = decltype(&PipboyManager::LowerPipboy);
static REL::Relocation<func_t> func{ REL::ID(1444875) };
static REL::Relocation<func_t> func{ REL::ID(2225454) };
return func(this, a_reason);
}

void OnPipboyCloseAnim()
{
using func_t = decltype(&PipboyManager::OnPipboyCloseAnim);
static REL::Relocation<func_t> func{ REL::ID(1231000) };
static REL::Relocation<func_t> func{ REL::ID(2225457) };
return func(this);
}

void OnPipboyCloseAnimFailed()
{
using func_t = decltype(&PipboyManager::OnPipboyCloseAnimFailed);
static REL::Relocation<func_t> func{ REL::ID(1362084) };
static REL::Relocation<func_t> func{ REL::ID(2225459) };
return func(this);
}

Expand Down
64 changes: 57 additions & 7 deletions CommonLibF4/include/RE/Bethesda/TESForms.h
Original file line number Diff line number Diff line change
Expand Up @@ -1765,12 +1765,12 @@ namespace RE
CC_CHALLENGE_COUNT = 0x8,
};

enum CHARISMA_CHALLENGE_SUCCESS : std::uint32_t
enum CHARISMA_CHALLENGE_SUCCESS : int32_t
{
CC_SUCCESS_NONE = 0xFFFFFFFF,
CC_SUCCESS_FAIL = 0x0,
CC_SUCCESS_SUCCEED = 0x1,
CC_SUCCESS_COUNT = 0x2,
CC_SUCCESS_FAIL = 0,
CC_SUCCESS_SUCCEED = 1,
CC_SUCCESS_COUNT = 2,
CC_SUCCESS_NONE = -1,
};

// Returns nullptr if no parent.
Expand All @@ -1781,9 +1781,9 @@ namespace RE
return func(this);
}

CHARISMA_CHALLENGE_DIFFICULTY GetSpeechChallengeLevel()
CHARISMA_CHALLENGE_DIFFICULTY GetChallengeLevel()
{
using func_t = decltype(&TESTopicInfo::GetSpeechChallengeLevel);
using func_t = decltype(&TESTopicInfo::GetChallengeLevel);
static REL::Relocation<func_t> func{ REL::ID(2208441) };
return func(this);
}
Expand Down Expand Up @@ -2912,6 +2912,42 @@ namespace RE
public IKeywordFormBase // 20
{
public:
enum class FLAG
{
kBeginOnQuestStart = 0x0,
kStopQuestOnEnd = 0x1,
kShowAllTextInEditor = 0x2,
kRepeats = 0x3,
kInterruptible = 0x4,
kPlayerDialogue = 0x5,
kNoPlayerExitDialogue = 0x6,
kPlayerRadioStation = 0x7,
kBroadCastScene = 0x8,
kPauseActorsCurrentSceneinDialogue = 0x9,
kLookAhead = 0xA,
kAllowDialogueCamera = 0xB,
kNoFollowerIdleChatter = 0xC,
};

enum class BOOL_BITS
{
kActive = 0x1,
kPhaseActionDone = 0x2,
KPauseScene = 0x4,
kSceneScriptFinished = 0x8,
kNeedsToEnd = 0x10,
kRandom = 0x20,
kCombatPause = 0x40,
kDialoguePause = 0x80,
kObserveCombatPause = 0x100,
kPlayerWalkedAway = 0x200,
kNoUpdate = 0x400,
kInheritedPhases = 0x800,
kQueueActive = 0x100000,
kSceneJumpActive = 0x200000,
kGamePause = 0x400000,
};

static constexpr auto RTTI{ RTTI::BGSScene };
static constexpr auto VTABLE{ VTABLE::BGSScene };
static constexpr auto FORM_ID{ ENUM_FORM_ID::kSCEN };
Expand All @@ -2934,6 +2970,20 @@ namespace RE
float maxREFDistanceCenter; // D8
ObjectRefHandle targetRef; // DC
bool shouldNotRotateToTrack; // E0

void ResetAllSceneActions()
{
using func_t = decltype(&BGSScene::ResetAllSceneActions);
static REL::Relocation<func_t> func{ REL::ID(2206864) };
return func(this);
}

void SetSceneActive(bool abFlag)
{
using func_t = decltype(&BGSScene::SetSceneActive);
static REL::Relocation<func_t> func{ REL::ID(2206845) };
return func(this, abFlag);
}
};
static_assert(sizeof(BGSScene) == 0xE8);

Expand Down

0 comments on commit f0c9020

Please sign in to comment.