SKSE fuctions always return default values

Post » Mon Feb 16, 2015 1:01 pm

Hello,

I've been trying to use some of the SKSE functions in my scripts but none of them seem to do anything. Everything compiles and launches ok. However when I log any SKSE function result it comes up empty (default values, empty string for strings, 0 for ints etc.)

I've tried GetName() and GetNumHeadParts() on actor bases (from actor properties set via creation kit), GetID(), GetPriority() on quests and some more. The only thing that gives me some result is SKSE.GetVersion() which returns 1.

I can't find any information regarding the issue apart from topic on nexusmods with id 735953 (can't post links) which encounters the issue doesn't provide or suggest any solution.

If you have any idea what can be the cause of this behaviour or what I might be doing wrong please let me know.

Script sample attached to custom quest (OnUpdate called every few seconds) - Everything logs 0 or empty string except SKSE version

Scriptname CB0UpdateQuestScript extends QuestKeyword Property myEffect AutoSpell Property mySpell AutoActor Property someActor AutoEvent OnUpdate()	Actor player = Game.GetPlayer()	ObjectReference playerRef = (player As ObjectReference)	Debug.Notification("Actor head parts: " + someActor.GetActorBase().GetNumHeadParts()+ "!")	Debug.Notification("Actor name: " + someActor.GetActorBase().GetName()+ "!")	Debug.Notification("Effect name: " + myEffect.GetName() + "!")	Debug.Notification("_questId: " + GetID() + "!")	Debug.Notification("_questPrio: " + GetPriority() + "!")	Debug.Notification("_SKSEVersion: " + SKSE.GetVersion() + "!")	Debug.Notification("playerName: " + playerRef.GetBaseObject().GetName() + "!")EndEvent
User avatar
djimi
 
Posts: 3519
Joined: Mon Oct 23, 2006 6:44 am

Post » Mon Feb 16, 2015 7:33 am

There's two probable causes:

  1. You don't actually have SKSE installed on the Skyrim installation you're testing this on.
  2. (More likely) You didn't fill your properties in that script correctly. In other words, "someActor," "myEffect," etc. all equal NONE, which means whenever you call a function on them it will return 0 or null strings like you are describing.
User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am


Return to V - Skyrim