Jump to content

handling refs passed as strings in a skse64 plugin


Recommended Posts

I am working on a version of callglobalfunction for skyrimse and while i could figure out how to handle the base types like int,string,float.

I don't know how to convert `0000014` to say `Actor`.

 

for the base for the skse64 plugin i am making use of this library. https://github.com/Ryan-rsm-McKenzie/CommonLibSSE

 

My current thought process is to use this function https://en.cppreference.com/w/cpp/string/basic_string/stol to convert the ref to an int and figure out if there exists a kind of keyval store or array that the game populates.

 

My current code is here https://github.com/jfmherokiller/QuickjsSKSE64Plugin its more meant to implement a javascript modding environment so i might split off the callglobalfunction part to a separate plugin.

Link to comment
Share on other sites

  • 2 weeks later...

I figured out a way todo it

RE::TESForm* StringToForm(const std::string& formHex)
{
	const RE::FormID Playerform = std::strtoul(formHex.c_str(), nullptr, 16);
	const auto RefTesting2 = RE::TESForm::LookupByID(Playerform);
	return RefTesting2;
}
template <typename T>
T* StringToForm(const std::string& formHex)
{
	const RE::FormID Playerform = std::strtoul(formHex.c_str(), nullptr, 16);
	const auto RefTesting2 = RE::TESForm::LookupByID<T>(Playerform);
	return RefTesting2;
}

also both the lookup function and the well table of references exist.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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