AddForm Fixed?

Post » Sun Nov 18, 2012 4:30 pm

So on a lark today I decided to revisit an old issue that frustrated me to no end a while ago in hopes that the recent patches addressed it. Namely, the inability to easily add an item to a leveled list via a script without jumping through insane hoops.

Prior to my current attempt the script would add the item, but then I would be unable to save the game (CTD), or upon loading the game, the added item disappeared from the leveled list. In English: I add a book to a leveled list that is sold by a merchant, the script runs, book is there. I save, reload, book is not there.

However today, I created 2 test spell tomes, and wrote this:

Scriptname zzAddToFormTestQuestScript extends Quest  LeveledItem Property LItemSpellTomes25AllAlteration  Auto  LeveledItem Property LItemSpellTomes00AllSpells  Auto  Book Property zzTestSpellTome1  Auto  Book Property zzTestSpellTome2  Auto  Quest Property zzAddToFormTestQuest AutoEvent onInit()	RegisterForSingleUpdate(60)endEventEvent onUpdate()	LItemSpellTomes00AllSpells.AddForm (zzTestSpellTome1, 1, 1)	LItemSpellTomes25AllAlteration.AddForm (zzTestSpellTome2, 1, 1)	debug.MessageBox ("Tomes added, go check.")zzAddToFormTestQuest.Stop()endEvent

When I loaded the game, the script ran. I CoC'd to Dragonsreach and checked Farengar's inventory, and found the books in it. I then saved, quit the game, reloaded, and checked the inventory again - the books were still there. I bought them, saved, waited for 48 hours, and the books respawned!

I also checked that the quest was not running after it finished the first time (getquestrunning zzAddToFormTestQuestScript returned 0).

So it seems that AddForm is persistent now? This should be a pretty big deal for those adding new items via mods, to enable conflict-free integration. Can someone confirm? Preferably someone who is better at Papyrus than me?
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Return to V - Skyrim