Giter Club home page Giter Club logo

commonlibsse's People

Contributors

aers avatar ahzaab avatar caketheliar avatar covey-j avatar exit-9b avatar fireundubh avatar gottyduke avatar jfm535 avatar jfmherokiller avatar kernalsegg avatar kkengine avatar max-su-2019 avatar metricexpansion avatar nukem9 avatar qudix avatar r-neal-kelly avatar ryan-rsm-mckenzie avatar slavicpotato avatar slaynot avatar spectralplatypus avatar vermunds avatar zax-ftw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commonlibsse's Issues

Problems getting started

I followed the Getting Started tutorial up to the last step.
After unpacking SkyrimSE.exe with Steamless and replacing the executable, running the game through skse64_loader in MO2 will not open the game.
I tried to run the game with the normal SkyrimSE.exe, but it seems SKSE doesn't work in my game anymore, I get error 1 (it says it is not running).
The Steamless error may be because my Skyrim SE is shared through Family Sharing. I do not actually own Skyrim SE. I didn't get it for free when I could have (I have only bought LE). Could this be the case?

"Cast Spell" function?

Just to make sure is the real member function that registery in the VM's "Spell Script"
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native current contains in the library?
https://www.creationkit.com/index.php?title=Cast_-_Spell

I already dig out the offset of this function in VM, you can call it as below:

void CastSpell(RE::BSScript::IVirtualMachine* a_vm, RE::SpellItem* thisSpell, RE::TESObjectREFR* Caster, RE::TESObjectREFR* Target)
	
{
		
  using func_t = void(*)(RE::BSScript::IVirtualMachine* a_vm, std::uint32_t stackId, RE::SpellItem* thisSpell, RE::TESObjectREFR* Caster, RE::TESObjectREFR* Target);
		  
  REL::Relocation<func_t> func{ REL::ID(55149) };
		  
  return func(a_vm, 0, thisSpell, Caster, Target);
	
}

Just want to know if that real member function already dig out now?

Unable to build any plugin

The library itself compiles just fine.
However, any plugin that relies on it fails to compile with the same error messages. Example output here.
From what I can tell, it seems like the problem is caused by conflicts between the constants defined in SKSE/Impl/WinAPI.h and in Winnt.h.
Just including RE/Skyrim.h or SKSE/SKSE.h in my projects seems to include both implicitly (without including them these constants are not defined at all).
Any advice/fix would be appreciated.

Rename function "IAnimationGraphManagerHolder::NotifyAnimationGraph" to "SendAnimationEvent"?

I thinks the function name "NotifyAnimationGraph" is a little confused and may easily cause people don't know the meaning and features of this function.(At least it confuse me for a period )

Why not rename it as "SendAnimationEvent" which is a much familiar name that most of Bethesda game modder will know? It actually do the almost same thing with "SendAnimationEvent" papryus function and console command, right?

https://www.creationkit.com/index.php?title=SendAnimationEvent_-_Debug

CommonLib Sample Plugin Tutorial

Hi,Ryan.Do you have any plan to write a tutorial about how to create the first plugin with your CommonLib?I follow the tutorial on this website but I still can't build the project.PS:I am not familiar with C++ 😞
微信图片_20190730220118
微信图片_20190730220124

Help?

may sound stupid but i follow ur get started step for step the first part was working and my dll is working
but evrything after commonlibsse dont make sense to me u using commands my system say not found and pointing to files they just dont exist.

what i', doing wrong could u maybe help me?

BSTHashMap.h

Hey Ryan,
First, thank you for all the time spent making this library. I was hoping to figure out If I missed a step in configuring the build.
When I clone the repo, have all dependencies set to go, and then build this library via cmake, it generates perfectly fine. However, when I open up vs2019 and build CommonLibSSE - it throws a few errors in compilation pertaining to the bit functions. When I add #include <bit> to BSTHashMap.h, it finishes the build without any issues and while I haven't tested linking to it yet, seems to be fine now. Not sure if it was an oversight on my part for a file or external dependency that already provides the definition for those or not.

Thank you in advance

Before/After Photos

Before:
Before

After:
After

How to find class vtables using RTTI addresses in database?

It seems like one would be able to use the class RTTI ids to get an address inside that class' TypeDescriptor and then read the corresponding vtable address from it. When I try this I get what looks like bogus vtable addresses, and in fact all of the pointers to function pointers in between the ".?AVxxx" mangled names in SkyrimSE.exe appear to be the same.

This is with me trying something like:
(RE::msvc::type_info*)(RE::RTTI_PlayerCharacter.address())->_vftable

This is consistent with what I see when I inspect the same bits of memory in SkyrimSE.exe eg. in Ghidra. So, I'm not suggesting anything is broken or wrong, but I'm very curious how one would use the RTTI offsets in the db together with the CommonLIbSSE utilities to find any particular vtable. Am I doing this entirely wrong and I'm meant to use the RTTI offsets for something else entirely?

Example plugin compile error

Hi, thank you for this library and your very helpful tutorial.

I'm new to C++, and I'm having trouble setting up the example plugin. I added span-lite to the includes directory of CommonLibSSE and managed to successfully compile that lib.

However I can't get the MyFirstPlugin CommonLibSSE example plugin to compile:

ForceIncludes

I'm getting the error Cannot open include file: 'ForceInclude.h': No such file or directory. I'm very confused because I don't see this ForceIncludes.h file mentioned anywhere. It's pointing to the #include "version.h" in main.cpp.

Don't know if this is helpful but these are the properties of the project:

properties

Edit: I got rid of that error by removing ForceInclude.h from the "Forced Include File" option in Configuration Properties > C/C++ > Advanced but I still have 3022 compiler errors so I clearly have something set up incorrectly.

Trampoline allocation failing

I haven't examined Trampoline.h in great detail, but it looks like it would benefit from a similar approach as below. The below commit fixed the Trampoline under wine/proton (not that it isn't also a wine bug).

ianpatt/skse64@4a1e121

PerkEntry virtual method override returns incorrect value

I wrote some code to analyze certain perks, had to manually get public field rather than call GetEntryPoint() to make it work. Example code below. Not urgent for me, more of a heads up.

void DataCase::AnalyzePerks(void)
{
	RE::TESDataHandler* dhnd = RE::TESDataHandler::GetSingleton();
	if (!dhnd)
		return;

	for (RE::TESForm* form : dhnd->GetFormArray(RE::FormType::Perk))
	{
		const RE::BGSPerk* perk(form->As<RE::BGSPerk>());
		if (!perk)
			continue;
#if _DEBUG
		_MESSAGE("Perk %s/0x%08x being checked", perk->GetName(), perk->GetFormID());
#endif
		for (const RE::BGSPerkEntry* perkEntry : perk->perkEntries)
		{
			if (perkEntry->GetType() != RE::BGSPerkEntry::Type::kEntryPoint)
				continue;

			const RE::BGSEntryPointPerkEntry* entryPoint(static_cast<const RE::BGSEntryPointPerkEntry*>(perkEntry));
			// Note that use of entryPoint->GetEntryPoint() here results in the incorrect value being returned
			if (entryPoint->entryData.entryPoint == RE::BGSEntryPoint::ENTRY_POINT::kAddLeveledListOnDeath &&
				entryPoint->entryData.function == RE::BGSEntryPointPerkEntry::EntryData::Function::kAddLeveledList)
			{
#if _DEBUG
				_MESSAGE("Leveled items added on death by perk %s/0x%08x", perk->GetName(), perk->GetFormID());
#endif
				m_leveledItemOnDeathPerks.insert(perk);
				break;
			}
		}
	}
}

Can not open source file

After updating the boost,I have this error:
image
Does this have something to do with the boost update?

typo in serialization example

Don't tell me : this is just a competency test? :-)

	serialization->SetSaveCallback(SaveCallback);
	serialization->SetSaveCallback(LoadCallback);

Compiler errors while following the CommonLibSSE section of the Getting Start guide

I apologize for what is sure to be an inane question, but I'm having trouble following the Getting Started guide for a CommonLibSSE plugin. When I try to build ExamplePlugin-CommonLibSSE, I get compiler errors. This happens whether I invoke cmake from the command line and open the generated sln or use VS2019's built-in CMake support:

Help

Thank you for your help and for an amazing library.

cmake support

please, i'm just trying to make a mod
DONT CLOSE
i just wanted to get some help

i don't know what to do when people are like this

please just mail me those files

i just want to make a mod :<

Binary-io

first thing sry for posting here i found no support or something like that.

I tried it with "vcpkg install rsm-binary-io:x64-windows-static-md" and "rsm-binary-io:x64-windows-custom"
it still give me this error when i run "cmake -B build -S ." on CommonLibSSE

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
CMake Error at CMakeLists.txt:16 (find_package):
Could not find a package configuration file provided by "binary_io" with
any of the following names:

binary_ioConfig.cmake
binary_io-config.cmake

Add the installation prefix of "binary_io" to CMAKE_PREFIX_PATH or set
"binary_io_DIR" to a directory containing one of the above files. If
"binary_io" provides a separate development package or SDK, be sure it has
been installed.

what i do wrong

How to call papyrus methods/functions inside c++ plugin?

I have really limited knowledge about the papyrus VM. My problem is that I don't know how to properly call any papyrus functions or methods (like placeatme).

I tried to execute the DispatchMethodCall, but it just doesn't work in the game. (all arguments are fully filled in)
return vm.DispatchMethodCall2((*self)->handle, className, functionName, args, functor);

Can you give an example of how to use any of the papyrus methods through a virtual machine? For example, PlaceAtMe.
(I am using latest CommonLibSSE version)

linux guide

Linux users don't have msvc
but i'd like to make a mod
can you make a guide for linux?

Backwardscomparibility with Older SkyrimSE Versions

Hello,

I was looking into Commonlib for use in an skse plugin I wanted to make and began with you example plugin but when I want to load it into my skyrim I get an error because the file data/skse/plugins/versionlib-1-5-97.bin cannot be found after a bit of diggin I reallized that has to do with the change to the new versionlib format and a change to the new name. the "Address Library for SKSE Plugins" mod for SE still provides the old files but it seems current ComonLib won't load those.

Are there plans to provide backwards compartibility?
Should I ask the creator of "Address Library for SKSE Plugins" to update the se file?
Or should I use an older version of commonlib? (In this case wich one? is the last one before the breaking change usable? (A tag for the recommended SE version would really be appreciated))

Thanks for your Work.

Error compiling example plugin

I tried following the Getting Started instructions from scratch, but I'm getting this error when I try to compile the MyFirstPlugin example:

Error	C2398	Element '2': conversion from 'size_t' to 'nonstd::span_lite::span<REL::IDDatabase::mapping_t,-1>::index_type' requires a narrowing conversion	MyFirstPlugin	E:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\src3\CommonLibSSE\include\REL\Relocation.h	735	

I git cloned this repo the HEAD was at 66e1e3c

As far as I can tell, span-lite is up to date:

.\vcpkg upgrade span-lite:x64-windows-custom
The following packages are up-to-date:
    span-lite:x64-windows-custom

I was able to compile an older version of the example plugin and CommonLibSSE (around 6/28).

Unable to Compile Example Project

Latest Skyrim Anniversary Edition
Latest skse64 Github, built with cmake
Latest CommonLibSSE, built with cmake
( Replaced fmt version with fmt version 8.0.1 in order to get CommonLibSSE to build/compile without logger.h errors )
Latest ExamplePlugin-CommonLibSSE

However, whenever I try and build the ExamplePlugin project with cmake (or VS) the compilation fails w/ logger.h errors:

C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(340,18): error C2220: the following warning is treated as an error (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\SKSE\IAT.cpp) [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(340,18): warning C4996: 'fmt::v8::format_to': was declared deprecated (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\SKSE\IAT.cpp) [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(86): message : see reference to function template instantiation 'void spdlog::logger::log_<spdlog::string_view_t,std::string_view&,std::string_view&>(spdlog::source_loc,spdlog::level::level_enum,const FormatString &,std::string_view &,std::string_view &)' being compiled [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
          with
          [
              FormatString=spdlog::string_view_t
          ] (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\SKSE\IAT.cpp)
C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/spdlog.h(132): message : see reference to function template instantiation 'void spdlog::logger::log<std::string_view&,std::string_view&>(spdlog::source_loc,spdlog::level::level_enum,spdlog::string_view_t,std::string_view &,std::string_view &)' being compiled (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\SKSE\IAT.cpp) [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]

C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(340,18): error C2220: the following warning is treated as an error (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\RE\T\TESObjectREFR.cpp) [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(340,18): warning C4996: 'fmt::v8::format_to': was declared deprecated (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\RE\T\TESObjectREFR.cpp) [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\vcpkg_installed\x64-windows-static-md\include\spdlog/logger.h(86): message : see reference to function template instantiation 'void spdlog::logger::log_<spdlog::string_view_t,_Ty>(spdlog::source_loc,spdlog::level::level_enum,const FormatString &,_Ty &&)' being compiled [C:\dev\skse64\skse64_2_01_05\skse64\ExamplePlugin\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
          with
          [
              _Ty=const char *,
              FormatString=spdlog::string_view_t
          ] (compiling source file C:\dev\skse64\skse64_2_01_05\skse64\CommonLibSSE\src\RE\T\TESObjectREFR.cpp)

(These same errors appear for 15 / 20 more files...)

Compile Instructions

I was wondering if you could write compiling instructions for if your mods would be needed to be updated for a newer SKSE version in the future.
I was attempting earlier this week to compile your mods for SKSE64 1.5.97 but I didn't know where to get the offsets. So if you could write a documentation on how to build your plugins so the community may be able to upload a temporary fix until you release an official version whenever a new SKSE version comes out.
Thank you.

the library appears to require upstream code to use Platform v142

People have hit issues deploying my mod based on CLSSE because my DLL requires Visual C++ Runtime 2015-2019 (x64) to be present. One of my early downloaders does not have this VC++ runtime yet.

I confirmed locally that if I uninstall this, MO2 won't start SkyrimSE through SKSE. That's not a definitive repro, but supports the idea that this runtime is a hard requirement I am adding.

I am building with Platform Toolset v142 (2019). If I alter this to 2015 (v140) I get an error because in CLSSEs' PCH.H is not found.

If there's a work round where I can ship my plugin not requiring this newer Visual C++ runtime it would be preferable. I have added mod page instructions on how to install the runtime but that's a big tax on users. If this is the way it is, that's fine though. The price of progress!

Thanks for your thoughts.

write_call and write_branch jumps to the wrong address if called multiple times

The first time these functions are called, they work as expected, but calling them multiple times results in jumping to/calling the address specified in the first one.

Example:

SKSE::Trampoline& trampoline = SKSE::GetTrampoline();
trampoline.write_call<5>(someID.address(), Foo);
trampoline.write_call<5>(someID.address() + 0x5, Bar);

This should result in a call to Foo and an another one to Bar, but both calls Foo instead.

Question: how do I call PlaceAtMe?

I'm writing a native papyrus function (registering it with CommonLibSSE) and I'd like to call the PlaceAtMe papyrus function directly in the C++ function for performance, but I don't see "PlaceAtMe" mentioned anywhere in the codebase.

In skse64/GameReferences.cpp it is defined as:

RelocAddr<_PlaceAtMe_Native> PlaceAtMe_Native(0x009951F0);

It seems like REL::Relocation is similar to RelocAddr but that's as far as I got trying to figure it out.

I also found DropObjectFunctor which looks suspiciously like the PlaceAtMe signature. Is that it? If so, how do I call it, I don't see an example of constructing and calling these functors in the codebase.

I'm really new with C++, so if this is obvious sorry. Thanks for any help.

Edit: I did some more research into this today and I think I have a better idea of how to do this, I think it would be something like:

RE::TESObjectREFR* PlaceAtMe(RE::BSScript::IVirtualMachine* a_vm, int count, RE::TESObjectREFR* ref, RE::TESForm* form, int something, bool forcePersist, bool initiallyDisabled) {}

void MyPlaceAtMe(RE::StaticFunctionTag*, RE::TESObjectREFR* ref, RE::TESForm* form, int count)
{
    using func_t = decltype(&PlaceAtMe);
    REL::Relocation<func_t> func{ REL::ID(55672) };
    // still need to figure out how to pass a_vm in to this func
    func(count, ref, form, 0, false, false);
}

Can't test this out because REL::Relocation requires a newer version of the CommonLibSSE and I'm having trouble compiling the new version (I opened another issue about that).

q re Skyrim AE support

Hey, sorry for the ping - is master branch compatible with both AE and SE binaries now? I see some relevant updates, but don't want to move my mod to latest unless it's going to work on both.

Compile error

Is this correct?
bool TESObjectREFR::MoveToNode(TESObjectREFR* a_target, NiAVObject* a_node) { auto& position = a_node->world.translate; NiPoint3 rotation; a_node->world.rotate.ToEulerAnglesXYZ(rotation); auto handle = a_target->CreateRefHandle(); MoveTo_Impl(handle, a_target->GetParentCell(), GetWorldspace(), position, rotation); return true; }

vcpkg port

Hey! First, thanks for the project. We use ComonLibSSE as a submodule in SkyrimPlatform and it's obviously better than SKSE build we have. But since both projects use vcpkg with manifests, it would be reasonable to add CommonLibSSE to vcpkg as a port. I'll try it out. Creating this issue to discuss details, potential building issues, etc.

Linker error for RE::BaseExtraList::GetDisplayName()

I'm trying my hand at creating an SKSE plugin using CommonLibSSE. So far so good, but there appears to be some differences between the SKSE implementation for BaseExtraList and CommonLibSSE. In my case, GetDisplayName(TESForm* a_type) appears to be missing from BaseExtraList.cpp, which comes up with an linker error when compiling (prior to this, finding the definition brings up the SKSE implementation). What was the intent here (and any suggestions to resolve)?

UI state detection help

request for info, really. In building SmartHarvestSE I had to recreate these two checks from the old script:

Event OnCheckOKToScan(int nonce)
    ; no-op if empty list
    bool okToScan = true
    if (Utility.IsInMenuMode())
        ;DebugTrace("UI has menu open")
        okToScan = false
    elseif (!Game.IsActivateControlsEnabled())
        ;DebugTrace("UI has controls disabled")
        okToScan = false
    endIf

    ;DebugTrace("Report UI Good-to-go = " + okToScan + " for request " + nonce)
    ReportOKToScan(okToScan, nonce)
EndEvent

The logic in C++ that I came up with did not match for all users - see pluginUIBad and pluginControlsBad below. Is there an idiomatic CLSSE way of doing this? Right now I send a "tell me UI state" event to the VM and it tells me the result by a callback as above - not ideal.

bool UIState::OKForSearch()
{
	// By inspection, UI menu stack has steady state size of 1. Opening application and/or inventory adds 1 each,
	// opening console adds 2. So this appears to be a catch-all for those conditions.
	RE::UI* ui(RE::UI::GetSingleton());
	if (!ui)
	{
		REL_WARNING("UI inaccessible");
		return false;
	}
	size_t count(ui->menuStack.size());
	bool pluginUIBad(count > 1);
	bool pluginControlsBad(!RE::PlayerControls::GetSingleton() || !RE::PlayerControls::GetSingleton()->IsActivateControlsEnabled());
	bool effectiveGoodToGo(!pluginUIBad && !pluginControlsBad);
	bool vmGoodToGo(VMGoodToGo());
	if (vmGoodToGo != effectiveGoodToGo)
	{
		// prefer old-style UI check if they do not match
		REL_WARNING("plugin UI good-to-go %d (menu count %d, controls disabled %d) does not match VM UI good-to-go %d - trust VM",
			effectiveGoodToGo, count, pluginControlsBad, vmGoodToGo);
		effectiveGoodToGo = vmGoodToGo;
	}

	if (effectiveGoodToGo != m_effectiveGoodToGo)
	{
		// record state change
		m_effectiveGoodToGo = effectiveGoodToGo;
		if (!effectiveGoodToGo)
		{
			// State change from search OK -> do not search
			REL_MESSAGE("UI/controls no longer good-to-go");
		}
		else
		{
			// State change from do not search -> search OK
			SearchTask::OnGoodToGo();
		}
	}
	return m_effectiveGoodToGo;
}

"Activate" control checking

I'm using the higher level function 'AreControlsEnabled` but this looks like a bug in ControlMap:

	bool ControlMap::IsActivateControlsEnabled() const
	{
		return (enabledControls & UEFlag::kLooking) != UEFlag::kNone;
	}

kLooking -> kActivate?

issue involving steamless

I noticed an issue if I use the default settings of steamless.
EngineFixes.dll -- SKSE/Trampoline.h(187): Failed to handle allocation request
(the exect code location can be seen here https://github.com/Ryan-rsm-McKenzie/CommonLibSSE/blob/master/include/SKSE/Trampoline.h#L187)
This error comes from EngineFixes but it could probably come from other plugins as well but i havent tested that.
It comes from the fact that steamless in its default configuration "shrinks" the exe.
size comparison between original and modified exe
This missing size comes from the "bind" section of the exe which is removed by default (If i had to guess enginefixes uses this section in its calculations)
The fix is mainly to just enable the bind section as seen below.
enable bind section in settings

Missing information?

Hi, i was reading the wiki and at some point it says to add path to CommonLibSSE.sln and the sln for the example project, yet they don't come with the repo, maybe i am missing something, could i be informed about how to get these files or generate them? im thinking it has something to do with the cmake folder or the python file but i can't get those to do anything really usefull at the moment. i know this is not the right place to post this but it would be really helpfull for me and others that don't have extensive knowledge in c++ development. don't get me wrong i know how c++ works i just don't understand why those files are not there and if you need to generate them why it is not stated in the wiki or the readme how to do so?

CONT records in game data show blank FormEditorID

Maybe RE::TESObjectCONT needs an override for the virtual function GetFormEditorID()? Code that records the field value:

namespace FormUtils
{
	// this can be blank, e.g. "Elementary Destruction.esp" FormID 0x31617, Github issue #28
	inline std::string SafeGetFormEditorID(const RE::TESForm* form)
	{
		const char* edid(form->GetFormEditorID());
		if (edid)
			DBG_DMESSAGE("EditorID %s for form 0x%08x", edid, form->GetFormID());
		else
			DBG_DMESSAGE("EditorID null for form 0x%08x", form->GetFormID());
		return edid ? std::string(edid) : std::string();
	}
}

sample output, non-CONT records

J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {15344} (2020-06-16 09:02:45 AM) EditorID DLC2FreaSorrow for form 0x0403d2bb
J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {15344} (2020-06-16 09:02:45 AM) EditorID TC_ShoutAttack_Keyword for form 0x3e097ec4
J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {28476} (2020-06-16 09:20:40 AM) EditorID LocSetCave for form 0x000130ef

CONT records

J:\GitHub\SmartHarvestSE\dataCase.h(456): [VERBOSE] {28476} (2020-06-16 09:20:40 AM) Check Container 0x000fb9ca/Barrel/ for best match
J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {28476} (2020-06-16 09:20:40 AM) EditorID  for form 0x000fb9c9
J:\GitHub\SmartHarvestSE\dataCase.h(456): [VERBOSE] {28476} (2020-06-16 09:20:40 AM) Check Container 0x000fb9c9/Barrel/ for best match
J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {28476} (2020-06-16 09:20:40 AM) EditorID  for form 0x000f93dd
J:\GitHub\SmartHarvestSE\dataCase.h(456): [VERBOSE] {28476} (2020-06-16 09:20:40 AM) Check Container 0x000f93dd/Burial Urn/ for best match
J:\GitHub\SmartHarvestSE\utils.h(89): [DEBUG] {28476} (2020-06-16 09:20:40 AM) EditorID  for form 0x000f8478

Game Crash When Gain Animation Graph of Player Character‘s Actor Reference.

Meet a strange crash occured everytime once I try to gain the "BShkbAnimationGraph“ pointer data from player character's actor.

That error doesn't occur for NPCs actors but only in player character. And it only took place when using the new edition of Clib (edition with spdlog) as the dependency. when using with the old edition of your Lib( edition without spdlog), this issue will not occur.

Below is a simple VM function that allow you to reproduce this error in papryus scripts:

	bool TestGraphFunc(RE::StaticFunctionTag*, RE::Actor* thisactor)
	{
		if (!thisactor)
		{
			logger::debug("Not This Actor Found!");
			return false;
		}

		auto  middlehighprocess = thisactor->currentProcess->middleHigh;

		if (!middlehighprocess)
		{
			logger::error("middlehighprocess Not Found!");
			return false;

		}

		auto thisAGmanager = middlehighprocess->animationGraphManager.get();

		if (!thisAGmanager)
		{
			logger::error("thisAGmanager Not Found!");
			return false;

		}

		auto graphs = thisAGmanager->graphs;		

		auto thisgraph = graphs.begin()->get();

		logger::debug("Get Actor Animation Graph!");

		return true;
	}

Passing player character as the argument into this function will always cause a crash.

Lots of errors, please help.

I am using the latest visual studio. I tried to follow your tutorial, but I got a lot of errors. Like, a lot. Please take a look:
errors

It's like the whole skse code is broken for some reason. I made the skse a .lib, added to the linker, added the directory to the header files. So my plugin file doesn't accuse any error, it's the skse itself that has tons of errors. Maybe I missed something on the tutorial?

RE::TESObjectCELL::ForEachReferenceInRange

Hello,

I've been hammering away at an SKSE plugin for a couple of weeks using your excellent library and have managed to get most of what I need working but have struck a brick wall on one feature. Would you have any suggestions on how to use the method RE::TESObjectCELL::ForEachReferenceInRange.
I'm trying to get a list of RE::TESObjectREFR* that are within a certain radius of a target Actor.

TIA for any help you care to offer.

getPoison and setPoison

Hi, I want to make a new sse mod, and I decided to use this lib. Basically I want to be able to poison arrows instead of bows using this lib. Is there an easy way to use this lib to get a poison from the inventory, then apply it to any object, including arrows(equipped arrows specifically)? Or is it only possible to poison weapons and it wouldn't work on arrows? Thank you for your time!

Building error with Logger (or maybe fmt)

I followed getting start, and while compiling, it shows some error like the following

C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\include\SKSE/Logger.h(39,2): error C7595: 'fmt::v8::basic_format_string<char,const char *&>::basic_format_string': call to immediate f unction is not a constant expression (compiling source file C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\src\SKSE\Interfaces.cpp) [C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonL ibSSE\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\include\SKSE/Logger.h(39,2): message : failure was caused by a read of a variable outside its lifetime (compiling source file C:\Users \Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\src\SKSE\Interfaces.cpp) [C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\include\SKSE/Logger.h(39,2): message : see usage of 'a_fmt' (compiling source file C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibS SE\external\CommonLibSSE\src\SKSE\Interfaces.cpp) [C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\src\SKSE\Interfaces.cpp(70): message : see reference to function template instantiation 'SKSE::log::error<const char *&>::error<const
char(&)[55]>(T,const char *&,std::source_location)' being compiled [C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
with
[
T=const char (&)[55]
]
C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\external\CommonLibSSE\src\SKSE\Interfaces.cpp(70): message : see reference to function template instantiation 'SKSE::log::error<const char *&>::error<const
char(&)[55]>(T,const char *&,std::source_location)' being compiled [C:\Users\Maboroshi\source\repos\ExamplePlugin-CommonLibSSE\build\src\CommonLibSSE\CommonLibSSE.vcxproj]
with
[
T=const char (&)[55]
]

Using CommonLib with Example Plugin

I'm trying to use CommonLib with your ExamplePlugin-CommonLibSSE and followed Setting Up Your Environment in your tutorial, thank you for that btw.
I extracted CommonLib and the MyFirstPlugin to the src/skse64 folder and added them to VS.
Directory
I noticed some reference issues. I could resolve the CommonLibSSE in MyFirstPlugin issue by removing it and adding it back again. When I tried to do the same for the skse64 reference in CommonLibSSE it didn't resolve the error (The "Microsoft.VisualStudio.ProjectSystem.References.UnresolvedBuildDependencyProjectReference" reference could not be resolved.)
References
In the main.cpp of MyFirstPlugin were some errors as well.
main1
I resolved them like this by adding some recommended includes and changing FOLDERID_Documents to FOLDERTYPEID_Documents
main2
When I try to build MyFirstPlugin there are lots of errors
Errors
I'm thinking this is due to the skse64 reference in CommonLibSSE that is not working correctly?
What am I doing wrong?
I'd be grateful for any help 😃

incompatible with 1.6.640 ?

I have wrote a plugin based on CommonLibSSE, but SKSE64_loader promt a message about compatible about it when I start the game.

My game version is 1.6.640.
image

Same functions works at SKSE64 library but not works at CommonLibSSE.

I tried to create a DisableCrosshair function and register it as a papyrus function into the game.

I did in "SKSE64 Library" and everythings worked propertly, the codes are as below:

void DisableCrosshair(StaticFunctionTag* base)
{
	auto menu = MenuManager::GetSingleton()->GetMenu(&UIStringHolder::GetSingleton()->hudMenu);

	if (menu && menu->view)
	{
		GFxValue result;
		GFxValue args[2];

		args[0].SetString("SetCrosshairEnabled");
		args[1].SetBool(false);

		menu->view->Invoke("call", &result, static_cast<GFxValue*>(args), 2);
	}

}

Then I tried to reproduce the function in CommonLib, but it seems didn't work at all:

void DisableCrosshair(RE::StaticFunctionTag*)
{
	auto menu = RE::UI::GetSingleton()->GetMenu(RE::InterfaceStrings::GetSingleton()->hudMenu);

	if (menu && menu->uiMovie)
	{
	        RE::GFxValue result;
		RE::GFxValue args[2];

		args[0].SetString("SetCrosshairEnabled");
		args[1].SetBoolean(false);

		menu->uiMovie->Invoke("call", &result, static_cast<RE::GFxValue*>(args), 2);

		//logger::debug("Start Disable Crosshair!");
	}

		//logger::debug("Disable Crosshair!")
}

I consider the functions I called were same in both case, but the result is different.

Is there anything wrong at the codes I writted? Would you give me some suggestion on that? Thanks!

How to Install spdlog? Compile Error!

Hi, Ryan! Firstly, thanks for your awesome library!

I try to set up the library and compile the example plugin you provided in "Getting Start" Wiki tutorial.

I following every steps your tutorial told: Install Vcpkg, then install "Xbyak" and "span-lite" using vcpkg.

However, I found that I also need to install "spdlog" to build.

I try to enter command vcpkg install spdlog:x64-windows-custom, but it didn't work and said "Source directory D:\vcpkg-master\packages\fmt_x64-windows-static-md does not exist".

Could you please give me some advices on that? Thanks!

Access Violation in RegistrationSetBase dtor on game exit

Had to remove RAII usage of this class to avoid an AV when game is closing down. The VM seems non-viable for cleanup of this class. I have a work-round (don't use RAII, just let them leak on exit, who cares?) but for other use cases this might matter.

In general, there does not seem to be a good pattern for DLL resource cleanup - I also had to revert to using the VM to manage this part of my mod's lifecycle. I don't think this is fixable unless there is some event OnGameExit or similar, I just found it interesting.

Code comment on the fix I made is below:

/* do not clean this class up: SKSE::RegistrationSetBase::~Impl (?) faults per https://github.com/SteveTownsend/SmartHarvestSE/issues/200
* 
From Map file
	0001:0009a310       ??1RegistrationSetBase@Impl@SKSE@@QEAA@XZ 000000018009b310 f   CommonLibSSE:RegistrationSet.obj

WER output crash address:
	Sig[3].Value=SmartHarvestSE.dll
	Sig[6].Name=Exception Code
	Sig[6].Value=c0000005
	Sig[7].Name=Exception Offset
	Sig[7].Value=000000000009b343
*/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.