Skip to content

Commit

Permalink
update for 1.7.29
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpatt committed Sep 13, 2023
1 parent d7c9c18 commit 7c13aec
Show file tree
Hide file tree
Showing 22 changed files with 13,218 additions and 13,212 deletions.
4 changes: 2 additions & 2 deletions cmake/versioning.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
set(SFSE_VERSION_MAJOR 0)
set(SFSE_VERSION_MINOR 1)
set(SFSE_VERSION_PATCH 0)
set(SFSE_VERSION_PATCH 1)

set(RUNTIME_VERSION_MAJOR 1)
set(RUNTIME_VERSION_MINOR 7)
set(RUNTIME_VERSION_PATCH 23)
set(RUNTIME_VERSION_PATCH 29)
set(RUNTIME_VERSION_TYPE 0)

math(
Expand Down
1 change: 1 addition & 0 deletions sfse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ source_group(
GameReflection.h
GameRTTI.cpp
GameRTTI.h
GameRTTI.inl
GameScript.cpp
GameScript.h
GameSettings.cpp
Expand Down
4 changes: 2 additions & 2 deletions sfse/GameConsole.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "sfse/GameConsole.h"
#include <stdarg.h>

RelocPtr <ConsoleLog*> g_console(0x058F6C50);
RelocPtr <ConsoleLog*> g_console(0x058F7A90);

void Console_Print(const char* fmt, ...)
{
Expand All @@ -15,4 +15,4 @@ void Console_Print(const char* fmt, ...)

va_end(args);
}
}
}
4 changes: 2 additions & 2 deletions sfse/GameConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class ConsoleLog
{
public:
MEMBER_FN_PREFIX(ConsoleLog);
DEFINE_MEMBER_FN(VPrint, void, 0x02883B48, const char* fmt, va_list args);
DEFINE_MEMBER_FN(VPrint, void, 0x02883978, const char* fmt, va_list args);
};

extern RelocPtr <ConsoleLog*> g_console;

void Console_Print(const char* fmt, ...);
void Console_Print(const char* fmt, ...);
2 changes: 1 addition & 1 deletion sfse/GameEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ struct MenuOpenCloseEvent
{
void*/*BSFixedString*/ MenuName;
bool bOpening;
};
};
2 changes: 1 addition & 1 deletion sfse/GameFormComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ class BGSNativeTerminalForm : public BaseFormComponent
public:
BGSTerminal* pTerminal; // 08
};
static_assert(sizeof(BGSNativeTerminalForm) == 0x10);
static_assert(sizeof(BGSNativeTerminalForm) == 0x10);
2 changes: 1 addition & 1 deletion sfse/GameForms.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ struct OBJ_REFR
static_assert(sizeof(OBJ_REFR) == 0x30);

//using _LookupByEDID = TESForm * (*)(const char* a_edid);
//inline RelocAddr<_LookupByEDID> LookupByEDID(0x014D7F7C);
//inline RelocAddr<_LookupByEDID> LookupByEDID(0x014D7F0C);
2 changes: 1 addition & 1 deletion sfse/GameObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ class TESNPC :
/*static_assert(offsetof(TESNPC, raceForm) == 0x298);
static_assert(offsetof(TESNPC, overridePackCollection) == 0x2A8);
static_assert(offsetof(TESNPC, forcedLocRefType) == 0x2F0);
static_assert(offsetof(TESNPC, terminalForm) == 0x308);*/
static_assert(offsetof(TESNPC, terminalForm) == 0x308);*/
2 changes: 1 addition & 1 deletion sfse/GameRTTI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

typedef void* (*_Runtime_DynamicCast_Internal)(void* srcObj, u32 arg1, const void* fromType, const void* toType, u32 arg4);

RelocAddr <_Runtime_DynamicCast_Internal> Runtime_DynamicCast_Internal(0x034C6C30); // __RTDynamicCast
RelocAddr <_Runtime_DynamicCast_Internal> Runtime_DynamicCast_Internal(0x034C7500); // __RTDynamicCast

void* Runtime_DynamicCast(void* srcObj, const void* fromType, const void* toType)
{
Expand Down
13,169 changes: 6,584 additions & 6,585 deletions sfse/GameRTTI.h

Large diffs are not rendered by default.

13,157 changes: 6,578 additions & 6,579 deletions sfse/GameRTTI.inl

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sfse/GameReferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ class TESObjectREFR : public TESForm
u8 unk10B; // 10B

MEMBER_FN_PREFIX(TESObjectREFR);
DEFINE_MEMBER_FN(IsInSpaceship, bool, 0x02B3A8D4)
DEFINE_MEMBER_FN(IsInSpace, bool, 0x01A0E208)
DEFINE_MEMBER_FN(HasKeyword, bool, 0x0139EE28, BGSKeyword*);
DEFINE_MEMBER_FN(IsInSpaceship, bool, 0x02B3A714)
DEFINE_MEMBER_FN(IsInSpace, bool, 0x01A0E1C8)
DEFINE_MEMBER_FN(HasKeyword, bool, 0x0139EDB8, BGSKeyword*);
};
static_assert(sizeof(TESObjectREFR) == 0x110);

Expand Down Expand Up @@ -384,4 +384,4 @@ class Actor : public TESObjectREFR
// More...
};

//inline RelocPtr<Actor*> g_playerCharacter(0x05594D28);
//inline RelocPtr<Actor*> g_playerCharacter(0x05595BA8);
4 changes: 2 additions & 2 deletions sfse/GameScript.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "GameScript.h"

RelocPtr <Script::SCRIPT_FUNCTION> g_firstScriptCommand(0x055110B0);
RelocPtr <Script::SCRIPT_FUNCTION> g_firstConsoleCommand(0x05504840);
RelocPtr <Script::SCRIPT_FUNCTION> g_firstScriptCommand(0x05511F30);
RelocPtr <Script::SCRIPT_FUNCTION> g_firstConsoleCommand(0x055056C0);
8 changes: 4 additions & 4 deletions sfse/GameSettings.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "sfse/GameSettings.h"

decltype(SettingT<INISettingCollection>::pCollection) SettingT<INISettingCollection>::pCollection(0x05912DC8);
decltype(SettingT<INIPrefSettingCollection>::pCollection) SettingT<INIPrefSettingCollection>::pCollection(0x05912DE8);
decltype(SettingT<RegSettingCollection>::pCollection) SettingT<RegSettingCollection>::pCollection(0x059119E8);
decltype(SettingT<INISettingCollection>::pCollection) SettingT<INISettingCollection>::pCollection(0x05913B98);
decltype(SettingT<INIPrefSettingCollection>::pCollection) SettingT<INIPrefSettingCollection>::pCollection(0x05913BB8);
decltype(SettingT<RegSettingCollection>::pCollection) SettingT<RegSettingCollection>::pCollection(0x059127A8);

u32 Setting::GetType(void) const
{
Expand Down Expand Up @@ -57,4 +57,4 @@ bool Setting::SetDouble(double value)
}

return true;
}
}
2 changes: 1 addition & 1 deletion sfse/GameSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ class SettingT
{
public:
static RelocPtr<T*> pCollection;
};
};
2 changes: 1 addition & 1 deletion sfse/Hooks_Script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool GetSFSEVersion_Execute(const SCRIPT_PARAMETER* paramInfo, const char*, TESO
}

typedef bool (*_ConsoleCommandInit)(void* unk1);
RelocAddr <_ConsoleCommandInit> ConsoleCommandInit(0x01AEB8B0);
RelocAddr <_ConsoleCommandInit> ConsoleCommandInit(0x01AEB870);
_ConsoleCommandInit ConsoleCommandInit_Original = nullptr;

void ConsoleCommandInit_Hook(void* unk1)
Expand Down
2 changes: 1 addition & 1 deletion sfse/Hooks_Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const char * kHook_ShowVersion_FormatString =
"%08x v%s [SFSE " __PREPRO_TOKEN_STR__(SFSE_VERSION_INTEGER) "."
__PREPRO_TOKEN_STR__(SFSE_VERSION_INTEGER_MINOR) "."
__PREPRO_TOKEN_STR__(SFSE_VERSION_INTEGER_BETA) "]";
RelocAddr <uintptr_t> kHook_ShowVersion_Offset(0x02079A7D);
RelocAddr <uintptr_t> kHook_ShowVersion_Offset(0x02079A4D);

void Hooks_Version_Apply()
{
Expand Down
2 changes: 1 addition & 1 deletion sfse/NiTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class alignas(0x10) NiPoint3A :
{
public:
};
static_assert(sizeof(NiPoint3A) == 0x10);
static_assert(sizeof(NiPoint3A) == 0x10);
17 changes: 8 additions & 9 deletions sfse/PapyrusNativeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class NativeFunctionBase : public IFunction
u16 unk0A; // 0A

MEMBER_FN_PREFIX(ParameterInfo);
DEFINE_MEMBER_FN(GetParam, u64 *, 0x030775DC, u32 idx, BSFixedString * nameOut, u64 * typeOut);
DEFINE_MEMBER_FN(GetParam, u64 *, 0x0307728C, u32 idx, BSFixedString * nameOut, u64 * typeOut);
};

virtual BSFixedString * GetName(void) override { return &m_fnName; }
Expand Down Expand Up @@ -132,14 +132,14 @@ class NativeFunctionBase : public IFunction
virtual u8 GetUnk41(void) override { return unk41; }
virtual void SetUnk41(u8 arg) override { unk41 = arg; }
virtual bool HasCallback() = 0;
virtual void Run() = 0;
virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, u32 arg2, VMValue * resultValue, VMState * state) = 0;

MEMBER_FN_PREFIX(NativeFunctionBase);
DEFINE_MEMBER_FN(Impl_Invoke, u32, 0x030772B4, u64 unk0, u64 unk1, VMClassRegistry * registry, VMState * unk3);
DEFINE_MEMBER_FN(Impl_Invoke, u32, 0x03076F64, u64 unk0, u64 unk1, VMClassRegistry * registry, VMState * unk3);
// ??_7?$NativeFunction1@VActiveEffect@@XPEAVTESForm@@@BSScript@@6B@ entry 0x10
DEFINE_MEMBER_FN(Impl_Fn10, BSFixedString *, 0x03077644);
DEFINE_MEMBER_FN(Impl_GetParamInfo, bool, 0x030776E0, u32 idx, void * out);
DEFINE_MEMBER_FN(Impl_Fn15, void *, 0x0307764C, u64 arg0, u64 arg1);
DEFINE_MEMBER_FN(Impl_Fn10, BSFixedString *, 0x030772F4);
DEFINE_MEMBER_FN(Impl_GetParamInfo, bool, 0x03077390, u32 idx, void * out);
DEFINE_MEMBER_FN(Impl_Fn15, void *, 0x030772FC, u64 arg0, u64 arg1);

protected:
BSFixedString m_fnName; // 10
Expand Down Expand Up @@ -171,11 +171,10 @@ class NativeFunction : public NativeFunctionBase
virtual ~NativeFunction() { CALL_MEMBER_FN(this, Impl_dtor)(); }

virtual bool HasCallback(void) override { return m_callback != 0; }
virtual bool Run(VMValue * baseValue, VMClassRegistry * registry, u32 arg2, VMValue * resultValue, VMState * state) = 0;

MEMBER_FN_PREFIX(NativeFunction);
DEFINE_MEMBER_FN(Impl_ctor, NativeFunction *, 0x03077138, const char * fnName, const char * className, u8 unk0, u32 numParams);
DEFINE_MEMBER_FN(Impl_dtor, void, 0x030771F4); // same as NativeFunctionBase dtor
DEFINE_MEMBER_FN(Impl_ctor, NativeFunction *, 0x03076DE8, const char * fnName, const char * className, u8 unk0, u32 numParams);
DEFINE_MEMBER_FN(Impl_dtor, void, 0x03076EA4); // same as NativeFunctionBase dtor

protected:
void * m_callback; // 50
Expand Down
19 changes: 10 additions & 9 deletions sfse_common/sfse_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// these have to be macros so they can be used in the .rc
#define SFSE_VERSION_INTEGER 0
#define SFSE_VERSION_INTEGER_MINOR 1
#define SFSE_VERSION_INTEGER_BETA 0
#define SFSE_VERSION_VERSTRING "0, 0, 1, 0"
#define SFSE_VERSION_INTEGER_BETA 1
#define SFSE_VERSION_VERSTRING "0, 0, 1, 1"
#define SFSE_VERSION_PADDEDSTRING "0001"
#define SFSE_VERSION_RELEASEIDX 1
#define SFSE_VERSION_RELEASEIDX 2

#define MAKE_EXE_VERSION_EX(major, minor, build, sub) ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | (((build) & 0xFFF) << 4) | ((sub) & 0xF))
#define MAKE_EXE_VERSION(major, minor, build) MAKE_EXE_VERSION_EX(major, minor, build, 0)
Expand All @@ -22,18 +22,19 @@
#define RUNTIME_TYPE_EPIC 2
#define RUNTIME_TYPE_MSSTORE 3

#define RUNTIME_VERSION_0_0_3 MAKE_EXE_VERSION(0, 0, 3) // 0x00000030 ms store early versions
#define RUNTIME_VERSION_1_0_17 MAKE_EXE_VERSION(1, 0, 17) // 0x01000110 ms store early versions
#define RUNTIME_VERSION_1_2_20 MAKE_EXE_VERSION(1, 2, 20) // 0x01020140 ms store early versions
#define RUNTIME_VERSION_1_6_35 MAKE_EXE_VERSION(1, 6, 35) // 0x01060230 version reported by ms store before release
#define RUNTIME_VERSION_0_0_3 MAKE_EXE_VERSION(0, 0, 3) // 0x00000030 ms store early versions (no one has these)
#define RUNTIME_VERSION_1_0_17 MAKE_EXE_VERSION(1, 0, 17) // 0x01000110 ms store early versions (no one has these)
#define RUNTIME_VERSION_1_2_20 MAKE_EXE_VERSION(1, 2, 20) // 0x01020140 ms store early versions (no one has these)
#define RUNTIME_VERSION_1_6_35 MAKE_EXE_VERSION(1, 6, 35) // 0x01060230 version reported by ms store before release (no one has these)
#define RUNTIME_VERSION_1_7_23 MAKE_EXE_VERSION(1, 7, 23) // 0x01070170 early access/wide release patch
#define RUNTIME_VERSION_1_7_29 MAKE_EXE_VERSION(1, 7, 29) // 0x010701D0

#define PACKED_SFSE_VERSION MAKE_EXE_VERSION(SFSE_VERSION_INTEGER, SFSE_VERSION_INTEGER_MINOR, SFSE_VERSION_INTEGER_BETA)

// information about the state of the game at the time of release
#define SFSE_TARGETING_BETA_VERSION 0
#define CURRENT_RELEASE_RUNTIME RUNTIME_VERSION_1_7_23
#define CURRENT_RELEASE_SFSE_STR "0.1.0"
#define CURRENT_RELEASE_RUNTIME RUNTIME_VERSION_1_7_29
#define CURRENT_RELEASE_SFSE_STR "0.1.1"

#if GET_EXE_VERSION_SUB(RUNTIME_VERSION) == RUNTIME_TYPE_BETHESDA
#define SAVE_FOLDER_NAME "Starfield"
Expand Down
8 changes: 4 additions & 4 deletions sfse_readme.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Starfield Script Extender v0.1.0 pre-alpha
by Ian Patterson
Starfield Script Extender v0.1.1 pre-alpha
by Ian Patterson, Stephen Abel, and Expired

The Starfield Script Extender, or SFSE for short, is a modder's resource that expands the scripting capabilities of Starfield. As the game has literally just released, it's mostly a plugin loader for now. Depending on where modders show interest, this will expand to Scaleform and Papyrus (or other things) over time.

[ Compatibility ]

SFSE will support the latest version of Starfield available on Steam, currently 1.7.23. The Gamepass/MS Store version is unsupported. Do not email asking for support.
SFSE will support the latest version of Starfield available on Steam, currently 1.7.29. The Gamepass/MS Store version is unsupported. Do not email asking for support.

[ Installation ]

Expand All @@ -25,7 +25,7 @@ SFSE will support the latest version of Starfield available on Steam, currently
- No; the suggested method for extending SFSE is to write a plugin. If this does not meet your needs, please email the contact addresses listed below.

* Can I include SFSE as part of a mod pack/collection or otherwise rehost the files?
- No. Providing a link to https://www.nexusmods.com/starfield/mods/106 is the suggested method of distribution. Exceptions may be given under applicable circumstances; contact us at the email addresses below. This means that if you see this file available for download anywhere other than https://www.github.com/ianpatt/sfse, or on Nexus by any user other than https://www.nexusmods.com/users/2166624, that service is violating copyright. I don't like having to explicitly spell this out, but my hand has been forced.
- No. Providing a link to https://www.nexusmods.com/starfield/mods/106 is the suggested method of distribution. Exceptions may be given under applicable circumstances; contact us at the email addresses below. This means that if you see this file available for download anywhere other than https://sfse.silverlock.org, https://www.github.com/ianpatt/sfse, or on Nexus by any user other than https://www.nexusmods.com/users/2166624, that service is violating copyright. I don't like having to explicitly spell this out, but my hand has been forced.

* Where did the log files go?
- <My Documents>\My Games\Starfield\SFSE\Logs\
Expand Down
9 changes: 8 additions & 1 deletion sfse_whatsnew.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.1.1
- GetSFSEVersion console command
- preliminary custom papyrus native function support
- internal class decoding
- support for 1.7.29

0.1.0
- plugin manager
- SFSE version shown in pause menu
- SFSE version shown in pause menu
- support for 1.7.23

0 comments on commit 7c13aec

Please sign in to comment.