Jump to content

AddForm Script Not Firing


Recommended Posts

As a way of improving the overall functionality and compatibility of my Immersive Conjuration mod, I began searching for a way to script the addition of my spell tomes to the leveled lists. Having found such a script (and having no prior experience using Papyrus), I added a quest and wrote the script. After experiencing Murphy's Law, I finally got the script to compile.

 

Unfortunately, when I launched the game, I never saw the debug.notification informing me that the script had run, nor did I see any evidence within the leveled lists.

 

If you could provide any insight as to why, and what I can do to fix it, I would be quite grateful.

 

The quest has the checkboxes "Start Game Enabled" and "Run Once" selected.

 

The script is as follows:

Scriptname ICPopulateListsScript extends Quest
{LeveledItem Property LItemSpellTomes25AllConjuration Auto
LeveledItem Property LItemSpellTomes00AllConjuration Auto
LeveledItem Property LItemSpellTomes50AllConjuration Auto
LeveledItem Property LItemSpellTomes75AllConjuration Auto
LeveledItem Property LItemSpellTomes100Conjuration Auto
Book Property ICSpellTomeConjureScamp Auto ; Apprentice
Book Property ICSpellTomeConjureDaedroth Auto ; Apprentice
Book Property ICSpelLTomeConjureStuntedScamp Auto ; Novice
Book Property ICSpellTomeConjureHuntingTroll Auto ; Apprentice
Book Property ICSpelLTomeConjureFleshAtronach ; Adept
Book Property ICSpellTomeConjureDremoraCaitiff ; Apprentice
Book Property ICSpellTomeConjureDremoraKynmarcher ; Adept
Book Property ICSpellTomeConjureSoulFamiliar ; Novice
Book Property ICSpellTomeConjureDarkSeducer Auto ; Expert
Book Property ICSpelLTomeConjureAuroran Auto ; Master
Event OnBeginState()
LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureStuntedScamp,1,1)
LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureSoulFamiliar,1,1)
LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureScamp,1,1)
LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDremoraCaitiff,1,1)
LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDaedroth,1,1)
LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureHuntingTroll,1,1)
LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureFleshAtronach,1,1)
LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureDremoraKynmarcher,1,1)
LItemSpellTomes75AllConjuration.AddForm(ICSpellTomeConjureDarkSeducer,1,1)
LItemSpellTomes100Conjuration.AddForm(ICSpellTomeConjureAuroran,1,1)
Debug.notification("Immersive Conjuration has successfully added spells to leveled lists")
EndEvent}
Link to comment
Share on other sites

The first and most basic; Did you remember to build a new SEQ file?

 

also the line:

 


{LeveledItem Property LItemSpellTomes25AllConjuration Auto

 

shouldn't need that string bracket { on it

 

I'm also a little concerned that the OnBeginState() may be problematic and might fire over and over again, Maybe include a GoToState("MyEndState") and make an empty MyEndState that does nothing, that way after the forms fill you effectively end the state, and you can also add code to manually end the quest so it no longer processes the code (use STOP() in the quest stage code to actually close the quest and the script

Link to comment
Share on other sites

{LeveledItem Property LItemSpellTomes25AllConjuration Auto

LeveledItem Property LItemSpellTomes00AllConjuration Auto

LeveledItem Property LItemSpellTomes50AllConjuration Auto

LeveledItem Property LItemSpellTomes75AllConjuration Auto

LeveledItem Property LItemSpellTomes100Conjuration Auto


Book Property ICSpellTomeConjureScamp Auto ; Apprentice

Book Property ICSpellTomeConjureDaedroth Auto ; Apprentice

Book Property ICSpelLTomeConjureStuntedScamp Auto ; Novice

Book Property ICSpellTomeConjureHuntingTroll Auto ; Apprentice

Book Property ICSpelLTomeConjureFleshAtronach ; Adept

Book Property ICSpellTomeConjureDremoraCaitiff ; Apprentice

Book Property ICSpellTomeConjureDremoraKynmarcher ; Adept

Book Property ICSpellTomeConjureSoulFamiliar ; Novice

Book Property ICSpellTomeConjureDarkSeducer Auto ; Expert

Book Property ICSpelLTomeConjureAuroran Auto ; Master


Event OnBeginState()

LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureStuntedScamp,1,1)

LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureSoulFamiliar,1,1)

LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureScamp,1,1)

LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDremoraCaitiff,1,1)

LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDaedroth,1,1)

LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureHuntingTroll,1,1)

LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureFleshAtronach,1,1)

LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureDremoraKynmarcher,1,1)

LItemSpellTomes75AllConjuration.AddForm(ICSpellTomeConjureDarkSeducer,1,1)

LItemSpellTomes100Conjuration.AddForm(ICSpellTomeConjureAuroran,1,1)

Debug.notification("Immersive Conjuration has successfully added spells to leveled lists")

EndEvent}


Based on those brackets, you technically just commented out your entire script.

Link to comment
Share on other sites

 

Based on those brackets, you technically just commented out your entire script.

 

Well, that would explain it. Fortunately, I didn't actually add those brackets, the Creation Kit did.

 

The first and most basic; Did you remember to build a new SEQ file?

 

also the line:

 

{LeveledItem Property LItemSpellTomes25AllConjuration Auto

 

shouldn't need that string bracket { on it

 

I'm also a little concerned that the OnBeginState() may be problematic and might fire over and over again, Maybe include a GoToState("MyEndState") and make an empty MyEndState that does nothing, that way after the forms fill you effectively end the state, and you can also add code to manually end the quest so it no longer processes the code (use STOP() in the quest stage code to actually close the quest and the script

 

No idea what most of that means, but the OnBeginState wasn't originally in the code. I originally used OnInit, but changed it to OnBeginState to see if that would help.

 

I'm going to try removing the brackets to see if that fixes anything. If not, then I'll look into the rest of what you said. I'll post my result here.

 

Thanks for the help.

Link to comment
Share on other sites

Removed the brackets and recompiled. The resultant effect was me slamming my face into my keyboard.

 

 

I'm not exactly a stranger to less-than helpful compiling errors, but the Creation Kit rather excels at generating them:

 

Starting 1 compile threads for 1 files...
Compiling "ICPopulateListsScript"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ICPopulateListsScript.psc(13,5): mismatched input 'Property' expecting FUNCTION
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ICPopulateListsScript.psc(0,0): error while attempting to read script ICPopulateListsScript: Object reference not set to an instance of an object.
No output generated for ICPopulateListsScript, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on ICPopulateListsScript
Link to comment
Share on other sites

Pure guess and assumption on my part.
But OnBeginState() belongs in a State

Scriptname ICPopulateListsScript extends Quest

LeveledItem Property LItemSpellTomes25AllConjuration Auto
LeveledItem Property LItemSpellTomes00AllConjuration Auto
LeveledItem Property LItemSpellTomes50AllConjuration Auto
LeveledItem Property LItemSpellTomes75AllConjuration Auto
LeveledItem Property LItemSpellTomes100Conjuration Auto

Book Property ICSpellTomeConjureScamp Auto ; Apprentice
Book Property ICSpellTomeConjureDaedroth Auto ; Apprentice
Book Property ICSpelLTomeConjureStuntedScamp Auto ; Novice
Book Property ICSpellTomeConjureHuntingTroll Auto ; Apprentice
Book Property ICSpelLTomeConjureFleshAtronach ; Adept
Book Property ICSpellTomeConjureDremoraCaitiff ; Apprentice
Book Property ICSpellTomeConjureDremoraKynmarcher ; Adept
Book Property ICSpellTomeConjureSoulFamiliar ; Novice
Book Property ICSpellTomeConjureDarkSeducer Auto ; Expert
Book Property ICSpelLTomeConjureAuroran Auto ; Master

Auto State UpdateLI
    
    Event OnBeginState()
        LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureStuntedScamp,1,1)
        LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureSoulFamiliar,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureScamp,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDremoraCaitiff,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDaedroth,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureHuntingTroll,1,1)
        LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureFleshAtronach,1,1)
        LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureDremoraKynmarcher,1,1)
        LItemSpellTomes75AllConjuration.AddForm(ICSpellTomeConjureDarkSeducer,1,1)
        LItemSpellTomes100Conjuration.AddForm(ICSpellTomeConjureAuroran,1,1)
        Debug.notification("Immersive Conjuration has successfully added spells to leveled lists")
    EndEvent
    
EndState
Edit: the above won't fire the OnBeginState() because of being set as Auto state.
So I gather you could do it from OnInit() or what ever function that you want to call the update, just set the state.
For example:
Scriptname ICPopulateListsScript extends Quest

LeveledItem Property LItemSpellTomes25AllConjuration Auto
LeveledItem Property LItemSpellTomes00AllConjuration Auto
LeveledItem Property LItemSpellTomes50AllConjuration Auto
LeveledItem Property LItemSpellTomes75AllConjuration Auto
LeveledItem Property LItemSpellTomes100Conjuration Auto

Book Property ICSpellTomeConjureScamp Auto ; Apprentice
Book Property ICSpellTomeConjureDaedroth Auto ; Apprentice
Book Property ICSpelLTomeConjureStuntedScamp Auto ; Novice
Book Property ICSpellTomeConjureHuntingTroll Auto ; Apprentice
Book Property ICSpelLTomeConjureFleshAtronach ; Adept
Book Property ICSpellTomeConjureDremoraCaitiff ; Apprentice
Book Property ICSpellTomeConjureDremoraKynmarcher ; Adept
Book Property ICSpellTomeConjureSoulFamiliar ; Novice
Book Property ICSpellTomeConjureDarkSeducer Auto ; Expert
Book Property ICSpelLTomeConjureAuroran Auto ; Master

Event OnInt()
    GoToState("UpdateLI")
EndEvent

State UpdateLI
    
    Event OnBeginState()
        LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureStuntedScamp,1,1)
        LItemSpellTomes00AllConjuration.AddForm(ICSpellTomeConjureSoulFamiliar,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureScamp,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDremoraCaitiff,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureDaedroth,1,1)
        LItemSpellTomes25AllConjuration.AddForm(ICSpellTomeConjureHuntingTroll,1,1)
        LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureFleshAtronach,1,1)
        LItemSpellTomes50AllConjuration.AddForm(ICSpellTomeConjureDremoraKynmarcher,1,1)
        LItemSpellTomes75AllConjuration.AddForm(ICSpellTomeConjureDarkSeducer,1,1)
        LItemSpellTomes100Conjuration.AddForm(ICSpellTomeConjureAuroran,1,1)
        Debug.notification("Immersive Conjuration has successfully added spells to leveled lists")
        GoToState("")
    EndEvent

EndState
Link to comment
Share on other sites

That script popped the same compiling error as the original, unfortunately. And I'm still not sure what it means.

 

 

 

Starting 1 compile threads for 1 files...
Compiling "ICPopulateListsScript"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ICPopulateListsScript.psc(13,5): mismatched input 'Property' expecting FUNCTION
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ICPopulateListsScript.psc(0,0): error while attempting to read script ICPopulateListsScript: Object reference not set to an instance of an object.
No output generated for ICPopulateListsScript, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on ICPopulateListsScript

 

Link to comment
Share on other sites

Teach me to copy and paste your original without actually reading your Properties or errors.

The error tells you the line the error lies and what it expects.

Line 13 the Property has a problem, if it's expecting FUNCTION, then it means the Property is expecting a Full property.

 

A Full property ends in EndProperty and has get/set function/s in between.

Just in case your not familiar with a full property: http://www.creationkit.com/Variables_and_Properties_%28Papyrus%29

 

Simple explanation is; Your missing Auto on the end of some of your properties :smile:

Book Property ICSpelLTomeConjureFleshAtronach ; Adept <--Missing Auto
Book Property ICSpellTomeConjureDremoraCaitiff ; Apprentice<--Missing Auto
Book Property ICSpellTomeConjureDremoraKynmarcher ; Adept<--Missing Auto
Book Property ICSpellTomeConjureSoulFamiliar ; Novice<--Missing Auto
Link to comment
Share on other sites

I... Feel quite stupid, now. Again.

 

Well, the script finally compiled. The books didn't appear int he merchants' inventories, from what I saw, but I'll wait a little while before I confirm that it hasn't worked.

 

Thank you for your help thus far. If it turns out to not be working, I'll post again. For now, though, your help has proven invaluable.

Link to comment
Share on other sites

Leveled lists are randomized to some degree and you will need to wait for everything to refresh (I believe its every 2 days?)

Also, to help with your debugging:

The debugger gives an exact line where problems are coming from:

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ICPopulateListsScript.psc(13,5)

 

It is saying the problem is coming from13th line. Hence the 13 inside of (13,5)

Which in this case is:

 

Book Property ICSpelLTomeConjureFleshAtronach ; Adept , the first Property which did not have the Auto attached to it

Link to comment
Share on other sites

  • Recently Browsing   0 members

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