Jump to content

Is it possible to access SKSE functions in the CreationKit?


Recommended Posts

SKSE does not provide any additions to the condition system.

Sometimes, you can use scripts that use SKSE to feed things into the condition system by setting a faction, or a quest/objectreference property, which then can be tested for.  Not for the faint of heart.

Link to comment
Share on other sites

Simply no, what @xkkmEl is referring too (maybe ¯\_(ツ)_/¯ not really sure)  is Quested and Scripted Virtual Machine Variables.. which uses papyrus, and since a part of SKSE is Papyrus, you can use them in those too along with Vanilla Papyrus OFC

But lets make complicated. It is Scripted Code and Creation kit working together to create new CK Conditions like you want, that do not exist.

So you can do this, but its not for faint hearted or beginning learn to code Modders.

https://ck.uesp.net/wiki/GetVMScriptVariable

https://ck.uesp.net/wiki/GetVMQuestVariable

Has you can see, there not a lot info on it..

I am not 100% sure what @xkkmEl is referring too. Cause I never use faction to do it, but there is many ways  to skin a cat, as they say

Link to comment
Share on other sites

What OP referred to is essentially ability to call an SKSE function directly in a dialogue condition.    

I.e. one can set a dialogue condition 'GetIsVoiceType' on the subject to make sure subject has a specific voice type, which is basically equivalent to "if  Subject.GetVoiceType() == SomeVoiceType".  Or GetItemCount condition is literally equivalent to GetItemCount function.   So OP wants to set a dialogue condition if "GetItemMaxCharge" for some target object(weapon), say, is equal to or greater than some number.

It would have been cool if conditional properties could be full properties.  (A good read on properties here), then you could set a GetVMQuestVariable dialogue condition on a conditional property, and in the Get method for said property, call GetItemMaxCharge - but unfortunately, conditional properties must be Auto. 

So you have to look for workarounds.   Say, if you anticipate that in a certain dialogue, you need to check max charge on a weapon, you could structure your dialogue accordingly.

I.e.: player:  can you do me a favour?
NPC response: what do you need?   - attached script fragment calls a function in quest that does 'GetMaxItemCharge' on player's current weapon and saves value in MaxCharge conditional property.
One of follow-up branches where player says 'I need my weapon recharged'  has 'GetVMQuestVariable' condition to check MaxCharge.

 

Link to comment
Share on other sites

Sorry I burst out laughing, cause I felt the same way..  and stop reading, while I rolled on the floor,  but they do not need a workaround for dialogue, it works fine.

Call a function with the SKSE code (in a quest script with the conditional property) from the begin frag, which then sets the conditional property, which then tells the dialogue option via creation conditions 

https://ck.uesp.net/wiki/GetVMQuestVariable

Whether to display or not. In the right frag box "end",  place the call to recharge the weapon. Things to note is: a Quest can only have one conditional script; but a quest can contain many quest scripts; the conditional script can contain many conditional properties. Or compiler errors will happen, even if the code syntax is 100% correct.

@Wolfstorm If you never coded before or are a beginner, maybe using Creation Kit Virtual Machine Conditions is not a good place to start, papyrus coding is a massive prerequisite.

EDIT: while all that is going on the game is Paused and in Menu Mode, to debug using notification or message boxes will not work, if the code not working, you need to use the papyrus log, custom trace or console.. which make it extra hard for beginners 😞

Link to comment
Share on other sites

  • Recently Browsing   0 members

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