Jump to content

Get global variable value in C++ using SKSE?


bvn

Recommended Posts

I am working on a mod that requires getting the actual value of a global variable.

 

I have the GLOB FormID # of the variable and from my C++ plugin code I want to get its value, is this possible using C++ and SKSE's resource files?

 

I know the papyrus script has that function explained here:

https://www.creationkit.com/index.php?title=GlobalVariable_Script

 

but I'm trying not to deal with a script if possible.

 

Thank you!

Link to comment
Share on other sites

  • 2 weeks later...

I found the solution for anyone interested. I already emailed Ian from SKSE.


class TESGlobal : public TESForm

{

public:

enum { kTypeID = kFormType_Global };


BSString unk20; // 20

UInt8 unk1C; // 30 - type? - init'd to 115

UInt8 pad[3]; // 31 0

UInt32 unk34; // 34 107793612 dec = 066CCCCC hex

}


if you change the last line from UInt32 unk34; to float value; this will give you the actual value of the GLOB form. :)



class TESGlobal : public TESForm

{

public:

enum { kTypeID = kFormType_Global };


BSString unk20; // 20

UInt8 unk1C; // 30 - type? - init'd to 115

UInt8 pad[3]; // 31

// UInt32 unk34; // 34 //either remove this line or comment out, I commented it out and it worked)

float value; // 34 corrected type which shows the FLTV (Value) of the GLOB form


};

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...