Scripting issue, possible bug, requesting help

Post » Wed Jun 20, 2012 7:40 pm

Hi all, I've been working a re-balance mod for vampirism in Skyrim, and I'm running into some issues with a modification that overwrites the default vampire quest script. I started a similar topic http://www.gamesas.com/topic/1351366-scripting-help-playeraddspell-fails/page__fromsearch__1 a while back, which didn't come to any resolution on what the root problem is. I'm starting a new topic since further research has yielded more information on what the problem isn't

Essentially, I have a function which based on how long the player has been a vampire, adds certain spells to them. When the function player.addspell(spellname) is called, it fails due to a null reference. The output from the debug log is:

[03/26/2012 - 04:27:17PM] error: Cannot add a None spell to the actorstack:[ (00000014)].Actor.AddSpell() - "" Line ?[PlayerVampireQuest (000EAFD5)].playervampirequestscript.VampireFeed() - "PlayerVampireQuestScript.psc" Line 247[ (000CF02C)].PRKF_VampireFeedBeds_000CF02C.Fragment_0() - "PRKF_VampireFeedBeds_000CF02C.psc" Line 9

Now, this would seem to imply that I hadn't properly linked my spell reference in the Creation Kit. However, I've triple-checked, the references are all properly filled-in, and they are getting re-set to none at some unknown point between Skyrim's startup and my test cell loading.

My theories so far are that an ESM file from one of the patches is overriding my changes, or that something I don't understand is interfering. I've checked that the code for adding spells itself works with a test snipped attached to a button, so I know the failure is specifically in the spell reference, but I can't tell what to poke now to figure out what causes this.

Anyone know of anything similar, or additional steps I can take to debug this?
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Wed Jun 20, 2012 9:33 am

You're positive you set the property for the spell in the quest stages? The "none" thing looks just like what happened to me the other day with something I swore I had set, only to find the property was pointing to nothing.
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Wed Jun 20, 2012 3:04 pm

Redwood Elf posted a http://www.gamesas.com/topic/1362677-why-isnt-my-script-seeing-this-global-variable/. It turned out that the property was somehow getting set to None even though he set it properly in the CK. I think he fixed it by changing the name of the property and recompiling the script, but you should read the thread to make sure.
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Wed Jun 20, 2012 9:18 pm

Properties set by the plugin are not guaranteed to be what you expect if you changed them after you saved your game. Changing the name of the property, recompiling the script and updating the properties in the plugin will tell the game to throw out the old variable and load the new one, thus now you know that the game will take the value from the plugin rather than the savegame when it loads.
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am


Return to V - Skyrim