Skip to content

Commit d235a76

Browse files
committed
Add some new decoded stuffs, particularly for processes
1 parent d35952e commit d235a76

File tree

5 files changed

+264
-120
lines changed

5 files changed

+264
-120
lines changed

obse/obse/GameForms.h

Lines changed: 132 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "obse/GameActorValues.h"
1111
#include "obse/GameTypes.h"
1212
#include "obse/GameBSExtraData.h"
13+
1314
#include "obse/NiNodes.h"
1415
#include "Utilities.h"
1516

@@ -367,15 +368,15 @@ class TESForm : public BaseFormComponent
367368
virtual void Unk_17(void);
368369
virtual void Unk_18(void);
369370
virtual void Unk_19(void);
370-
virtual void Unk_1A(void);
371+
virtual bool SeekRecordType(void* file); //Saw SeekWorldInFileFast (formerly FindCellInFileFast) in TESWorldSpace (only if master). MAybe SeekRecordType (todo check if only for master and for records that have offsets)
371372
virtual void DoPostFixup(void); // initialize form after other forms loaded
372373
virtual FormType GetFormType(void);
373374
virtual void GetDescription(BSStringT * dst);
374375
virtual bool IsQuestItem(void);
375376
virtual bool IsBorderRegion(void);
376-
virtual bool Unk_20(void); // 20 //flags 1<<16
377+
virtual bool IsFromMaster(void); // 20 //flags 1<<16
377378
virtual bool IsOffLimits(void);
378-
virtual bool IsDangerous(void); //same flag TODO check
379+
virtual bool IsDangerous(void); //same flag TODO check. TESFurniture, TESWorldSpace have the same function in this spot
379380
virtual void SetDeleted(bool bSet);
380381
virtual void SetFromActiveFile(bool fromActiveFile);
381382
virtual void SetQuestItem(bool isQuestItem);
@@ -392,7 +393,7 @@ class TESForm : public BaseFormComponent
392393
virtual void CreateGroupRecord(void); // 30
393394
virtual void Unk_31(void);
394395
virtual void Unk_32(void);
395-
virtual bool Unk_33(TESObjectREFR* refr0, TESObjectREFR* refr1, UInt32 unk2); // related to activate, refr1 is activating refr, refr0 is a reference to this TESForm being activated, seen unk2 == 0
396+
virtual bool ActivateActionForReference(TESObjectREFR* refr0, TESObjectREFR* refr1, UInt32 unk2); // related to activate, refr1 is activating refr, refr0 is a reference to this TESForm being activated, seen unk2 == 0. In TESFurniture case, the function seems to check Player and the TESfurnitre This object isn't used at all.
396397
virtual const char * GetName(void); // not sure which objects this works on, doesn't seem to work on player or random objects
397398
virtual const char * GetEditorName(void); // returns nothing at run-time
398399
virtual void SetName(const char * name);
@@ -2119,6 +2120,22 @@ class SpellItem : public MagicItemForm
21192120
SpellItem();
21202121
~SpellItem();
21212122

2123+
2124+
//TODO OBME have a different enum here
2125+
/*
2126+
* enum MagicItemType // This does NOT match the OBSE standard enum, which appears
2127+
* { // to have been invented entirely by them for internal purposes
2128+
* kMagItm_Spell = 0,
2129+
* kMagItm_Disease,
2130+
* kMagItm_Power,
2131+
* kMagItm_LesserPower,
2132+
* kMagItm_Ability,
2133+
* kMagItm_Poison, // Generally not used, actual poisons are alchemy items w/ all hostile effects
2134+
* kMagItm_Enchantment = 6,
2135+
* kMagItm_AlchemyItem,
2136+
* kMagItm_Ingredient,
2137+
};
2138+
*/
21222139
enum {
21232140
kType_Spell = 0,
21242141
kType_Disease,
@@ -2832,6 +2849,7 @@ class TESLevCreature : public TESBoundObject
28322849
TESActorBase* templateForm; //044
28332850
};
28342851

2852+
//74
28352853
class TESSoulGem : public TESBoundObject
28362854
{
28372855
public:
@@ -2845,8 +2863,8 @@ class TESSoulGem : public TESBoundObject
28452863
TESModel model; // 030
28462864
TESIcon icon; // 048
28472865
TESScriptableForm scriptable; // 054
2848-
TESValueForm value; // 064
2849-
TESWeightForm weight; // 072
2866+
TESValueForm value; // 060
2867+
TESWeightForm weight; // 068
28502868

28512869
enum {
28522870
kSoul_None = 0,
@@ -2857,11 +2875,13 @@ class TESSoulGem : public TESBoundObject
28572875
kSoul_Grand,
28582876
};
28592877

2860-
UInt8 soul;
2861-
UInt8 capacity;
2878+
UInt8 soul; // 070
2879+
UInt8 capacity; // 071
28622880
UInt8 padding[2];
28632881
};
2864-
2882+
#if OBLIVION
2883+
STATIC_ASSERT(sizeof(TESSoulGem) == 0x74);
2884+
#endif
28652885
// 70
28662886
class TESKey : public TESObjectMISC
28672887
{
@@ -3251,6 +3271,7 @@ class TESObjectCELL : public TESForm
32513271
UInt32 rotZ;
32523272
float directionalFade;
32533273
float fogClipDistance;
3274+
void* unk028; //Offset
32543275
};
32553276

32563277
// members
@@ -3415,7 +3436,12 @@ class TESWorldSpace : public TESForm
34153436
Character * character; // 074
34163437
void * ptr078; // 078
34173438
TESWorldSpace * parentWorldspace; // 07C
3418-
UInt32 unk080[(0xC0 - 0x80) >> 2]; // 080
3439+
TESWaterForm *WaterForm;
3440+
UInt32 unk084[5];
3441+
float unk9C[4];
3442+
UInt32 *cellOffsetsArray; //Repurposed inside OffsetGenerator with different type, DO NOT Access without care
3443+
float unk0AC[4];
3444+
UInt32 recordOffsetFromFileBeginning; //Repurposed inside OffsetGenerator with different type, DO NOT Access without care
34193445
BSStringT editorID; // 0C0
34203446
NiTPointerMap <void> map0C8; // 0C8 - ?$NiTPointerMap@I_N@@
34213447
UInt32 unk0D8[(0xE0 - 0xD8) >> 2]; // 0D8
@@ -3425,7 +3451,11 @@ class TESWorldSpace : public TESForm
34253451
bool CanFastTravel() const { return (worldFlags & kFlag_NoFastTravel) ? false : true; }
34263452
void SetCanFastTravel(bool bCan) { if (bCan) worldFlags &= ~kFlag_NoFastTravel; else worldFlags |= kFlag_NoFastTravel; }
34273453
};
3428-
3454+
#if OBLIVION
3455+
STATIC_ASSERT(sizeof(TESWorldSpace) == 0xE0);
3456+
STATIC_ASSERT(offsetof(TESWorldSpace, cellOffsetsArray) == 0xA8);
3457+
STATIC_ASSERT(offsetof(TESWorldSpace, map0C8) == 0xC8);
3458+
#endif
34293459
// 28
34303460
class TESObjectLAND : public TESForm
34313461
{
@@ -4361,3 +4391,94 @@ class TESIdleForm : public TESForm
43614391
TESIdleForm* parent; // 40
43624392
TESIdleForm* previous; // 44
43634393
};
4394+
4395+
class ActorSkinInfo {
4396+
public:
4397+
NiNode* Bip01Node; // 000
4398+
UInt32 unk004;
4399+
NiNode* HeadNode; // 008
4400+
UInt32 unk00C;
4401+
NiNode* Finger1Node; // 010
4402+
UInt32 unk014;
4403+
NiNode* LFinger1Node; // 018
4404+
UInt32 unk01C;
4405+
NiNode* WeaponNode; // 020
4406+
UInt32 unk024;
4407+
NiNode* BackWeaponNode; // 028
4408+
UInt32 unk02C;
4409+
NiNode* SideWeaponNode; // 030
4410+
UInt32 unk034;
4411+
NiNode* QuiverNode; // 038
4412+
UInt32 unk03C;
4413+
NiNode* LForearmTwistNode; // 040
4414+
UInt32 unk044;
4415+
NiNode* TorchNode; // 048
4416+
UInt32 unk04C;
4417+
UInt32 unk050;
4418+
Actor* Actor054; // 054
4419+
UInt32 unk058;
4420+
TESForm* unk05C;
4421+
TESModel* unk060;
4422+
NiNode* unk064;
4423+
UInt32 unk068;
4424+
TESForm* UpperBodyForm; // 06C
4425+
TESModel* UpperBodyModel; // 070
4426+
NiNode* UpperBodyObject; // 074
4427+
UInt32 unk078;
4428+
TESForm* LowerBodyForm; // 07C
4429+
TESModel* LowerBodyModel; // 080
4430+
NiNode* LowerBodyObject; // 084
4431+
UInt32 unk088;
4432+
TESForm* HandForm; // 08C
4433+
TESModel* HandModel; // 090
4434+
NiNode* HandObject; // 094
4435+
UInt32 unk098;
4436+
TESForm* FootForm; // 09C
4437+
TESModel* FootModel; // 0A0
4438+
NiNode* FootObject; // 0A4
4439+
UInt32 unk0A8;
4440+
UInt32 unk0AC;
4441+
UInt32 unk0B0;
4442+
NiNode* unk0B4;
4443+
UInt32 unk0B8;
4444+
UInt32 unk0BC;
4445+
UInt32 unk0C0;
4446+
NiNode* unk0C4;
4447+
UInt32 unk0C8;
4448+
UInt32 unk0CC;
4449+
UInt32 unk0D0;
4450+
NiNode* unk0D4;
4451+
UInt32 unk0D8;
4452+
TESObjectWEAP* WeaponForm; // 0DC
4453+
TESModel* WeaponModel; // 0E0
4454+
NiNode* WeaponObject; // 0E4
4455+
UInt32 unk0E8;
4456+
TESForm* unk0EC;
4457+
TESModel* unk0F0;
4458+
NiNode* unk0F4;
4459+
UInt32 unk0F8;
4460+
TESForm* unk0FC;
4461+
TESModel* unk100;
4462+
NiNode* unk104;
4463+
UInt32 unk108;
4464+
TESForm* AmmoForm; // 10C
4465+
TESModel* AmmoModel; // 110
4466+
NiNode* AmmoObject; // 114
4467+
UInt32 unk118;
4468+
TESObjectARMO* ShieldForm; // 11C
4469+
TESModel* ShieldModel; // 120
4470+
NiNode* ShieldObject; // 124
4471+
UInt32 unk128;
4472+
TESObjectLIGH* LightForm; // 12C
4473+
TESModel* LightModel; // 130
4474+
NiNode* LightObject; // 134
4475+
UInt32 unk138;
4476+
UInt32 unk13C;
4477+
UInt32 unk140;
4478+
UInt32 unk144;
4479+
UInt32 unk148;
4480+
UInt32 unk14C;
4481+
Actor* Actor150; // 150
4482+
};
4483+
STATIC_ASSERT(sizeof(ActorSkinInfo) == 0x154);
4484+

obse/obse/GameMagicEffects.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@ class ActiveEffect
4242
bool bTerminated; // 11 set to 1 when effect is to be removed
4343
UInt8 bRemoved; // 12
4444
UInt8 pad13; // 13
45-
UInt32 aeFlags; // 14
45+
UInt32 aeFlags; // 14 use unk, but frequently appears as 0xE when no HitEffects are present, 0 otherwise (OBME)
4646
float magnitude; // 18 - adjusted based on target?
4747
float duration; // 1C - adjusted based on target?
4848
MagicTarget * target; // 20
4949
MagicCaster * caster; // 24
5050
UInt32 spellType; // 28 e.g. SpellItem::kType_Ability
5151
UInt32 unk2C; // 2C
52-
TESForm * enchantObject; // 30 enchanted obj responsible for effect
52+
TESForm * enchantObject; // 30 enchanted obj responsible for effect . on Enchantment on Armor this is TESARMO
5353
TESForm * data; // 34 - in ScriptEffect this is a Script *
54+
//TODO OBME
55+
// simple linked list of active magic hit effects
56+
// non-null for light, detectlife, shield, and possibly others
5457

5558
void Remove(bool bRemoveImmediately);
5659
bool IsApplied() const { return bApplied; }

obse/obse/GameObjects.h

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ class TESObjectREFR : public TESForm
563563
virtual void Unk_47(void) = 0;
564564
virtual MagicCaster* GetMagicCaster(void) = 0;
565565
virtual MagicTarget* GetMagicTarget(void) = 0;
566-
virtual TESForm* GetTemplateForm(void) = 0; //Reported inlined
566+
virtual TESForm* GetTemplateForm(void) = 0; //Reported inlined. No relvant function except for Actor and derived VTBLs
567567
virtual void SetTemplateForm(TESForm* form) = 0; //Reported inlined
568568
virtual BSFaceGenNiNode* GetFacegenNiNodeBiped(NiNode arg0) = 0; //arg seem ignored for all 4 methods
569569
virtual BSFaceGenNiNode* GetFacegenNiNodeSkinned(NiNode arg0) = 0;
@@ -658,7 +658,7 @@ class MobileObject : public TESObjectREFR
658658
virtual void Move(float arg0, float* pos, UInt32 arg2) = 0; //TODO check. This function is a mess
659659
// virtual void Jump(void) = 0; // jump?
660660
virtual void FallImpact(float a2, float a3, Actor* a4, int a5) = 0; //At least seems relevant to fall and/or pain sounds
661-
virtual void Unk_6F(void) = 0;
661+
virtual void Unk_6F(void) = 0; //SOmething for bhkCharacterProxy
662662
virtual void Unk_70(void) = 0; // 70
663663
virtual void Unk_71(void) = 0;
664664
virtual void Unk_72(void) = 0;
@@ -692,7 +692,7 @@ class Actor : public MobileObject
692692

693693
virtual SInt32 GetFame(void) = 0; // 81
694694
virtual SInt32 GetInfamy(void) = 0; // 82
695-
virtual void Resurrect(UInt8 unk1, UInt8 unk2, UInt8 unk3) = 0; //If unk3 is 1, it try to use the bhkProxyController. MAybe relative to animations? unk3 == 0, recreate the processes
695+
virtual void Resurrect(UInt32 unk1, UInt8 unk2, bool unk3) = 0; //If unk3 is 1, it try to use the bhkProxyController. MAybe relative to animations? unk3 == 0, recreate the processes
696696
virtual void Unk_84(void) = 0;
697697
virtual void Unk_85(void) = 0;
698698
virtual void Unk_86(void) = 0;
@@ -869,6 +869,7 @@ class Actor : public MobileObject
869869
float GetAVModifier(eAVModifier mod, UInt32 avCode);
870870
float GetCalculatedBaseAV(UInt32 avCode);
871871
bool IsAlerted();
872+
872873
void SetAlerted(bool bAlerted);
873874
void EvaluatePackage();
874875
// bool IsTalking();
@@ -878,13 +879,22 @@ class Actor : public MobileObject
878879
STATIC_ASSERT(sizeof(Actor) == 0x104);
879880
#endif
880881

881-
// 104+
882-
class Character : public Actor
883-
{
882+
class Creature : public Actor {
883+
public:
884+
UInt32 unk104; // 104 should be similar to ActorSkinInfo
885+
};
886+
#if OBLIVION
887+
STATIC_ASSERT(sizeof(Creature) == 0x108);
888+
#endif
889+
890+
class Character : public Actor {
884891
public:
885-
Character();
886-
~Character();
892+
ActorSkinInfo* ActorSkinInfo; // 104
893+
UInt32 unk108; // 108
887894
};
895+
#if OBLIVION
896+
STATIC_ASSERT(sizeof(Character) == 0x10C);
897+
#endif
888898

889899
// 800
890900
class PlayerCharacter : public Character
@@ -972,7 +982,7 @@ class PlayerCharacter : public Character
972982
// +658 UInt32, misc stat array
973983
// +70C 'initial state' buffer
974984

975-
UInt32 unk104[(0x118 - 0x104) >> 2]; // 104
985+
UInt32 unk10C[(0x118 - 0x10C) >> 2]; // 10C
976986
DialoguePackage * dialoguePackage; // 118
977987
UInt32 unk11C[(0x130 - 0x11C) >> 2]; // 11C
978988
float skillExp[21]; // 130 current experience for each skill
@@ -1086,13 +1096,6 @@ class PlayerCharacter : public Character
10861096
STATIC_ASSERT(sizeof(PlayerCharacter) == 0x800);
10871097
#endif
10881098

1089-
class Creature : public Character
1090-
{
1091-
public:
1092-
Creature();
1093-
~Creature();
1094-
};
1095-
10961099
extern PlayerCharacter ** g_thePlayer;
10971100

10981101
class SkyObject {

0 commit comments

Comments
 (0)