Jump to content

[LE] Can a script check if an SKSE plugin is installed?


Recommended Posts

I need it for mod functionality. The mod will behave differently if DAR is intalled (namely it will use animations that are then expected to be overriden by its DAR package), and if it is not (in which case it will resort to a vanilla animation).

 

So this info needs to be decided at runtime on the user's end. I need to be able to put it into a condition if the user has DAR or not, essentially.

Link to comment
Share on other sites

Not automatically that I know of. You could, however, have an MCM menu and let the end user toggle an option that indicates whether they have DAR or not. But keep in mind that DAR by itself does not have any animations. The user has to get these animations that you want to play from somewhere. If you're providing the animations, include a version of the script that will play the DAR animations. Have everything else including a version that plays stock animations as the main file and the DAR stuff as an optional file.

Link to comment
Share on other sites

MiscUtil from PapyrusUtil has the function FileExists:

; Check if a given file exists relative to root Skyrim directory. Example: FileExists("data/meshes/example.nif")
bool function FileExists(string fileName) global native

I don't think there's a way to check with vanilla papyrus or just basic skse.

Link to comment
Share on other sites

Thank you both very much :smile:

 

@IsharaMeradin:

That's exactly what the mod already does, I need the automation to determine the best default value for the vanilla / DAR animation setting.

You see, both SkyUI and DAR are just optional requirements, the mod should function without both, but I'd like to set the DAR animation as default so that players don't have to muck with MCM settings to just make the mod look better.

 

But for setups that don't have SkyUI, and also don't have DAR, obviously the vanilla animation would have to be the default.

 

Also, the vanilla animation is a paired one, and the DAR one is not, so the DAR script has use 2 different animations (that is expected by it to be replaced with DAR). So if someone has the DAR animation selected in the MCM but doesn't in fact have DAR, completely wrong animations will be played.

 

@dylbill

Thanks, that looks superuseful even outside this context, good to know that this exists :smile:

However.... I'm not sure if I'll end up using it. The root of the problem already comes from SkyUI and DAR being only optional requirements, and thus trying to guess-setup the default value for users who have neither.

I don't think that someone who doesn't have these would have PapyrusUtil, so adding another requirement to determine whether someone has a requirement... no.

 

I'll probably either have to draw the line and say that at least SkyUI is a hard requirement from now on, or accept that any user who wants the mod to look better will have to change at least 1 MCM setting.

I have not yet decided which way to choose, but this is going off-topic I guess.

 

Thanks again for the help :smile:

Edited by WhiteWolf424242
Link to comment
Share on other sites

You can set up a global variable whose value will determine which animation set is played. The user can then open the console and manually set this global variable to their desired setting. This bypasses requiring SkyUI for the MCM menu, which you can still have available.

Link to comment
Share on other sites

True enough, it actually uses a Conditional Property, which can also be manipulated from the console with setpqv.

This however still goes against the principle that the mod has to function in its fresh downloaded state. The user being required to enter console commands to make a downloaded mod function is far from ideal to me, .... and also I already see how I would have to explain this over and over again in every third comment, and also help debug all the issues that come from bad setups.

 

I've decided to make an "installer" for non-SkyUI users. Now that is something I can finally check for, because SKSE itself is a hard requirement, I can check whether the SkyUI plugin is there or not when the script initializes, and if not found, then I can show a Message explaining that the user must now choose an animation, and only choose the second if they have DAR installed.

 

It's effectively the same thing you suggested, just wrapped into a nicer interface of a messagebox instead of crude console commands and stuff that may lead to user error issues anyway (excuse my pessimism, talking from experience though).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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