Quest 'Stages' vs Script 'States', do either help with 'scri

Post » Sun Nov 18, 2012 8:47 am

Hey Guys,

I will ask my question first and then expand.

Is it possible to control scripts via quest stages? For example completely kill a script (including from the save game) when the final quest stage has been reached?

For example, setstage MintyQuest 100

Could this console command be used to un-install all scripts and leave no persistence in the save game?

Would this quest finished event also kill previously saved scripts in the save game that were originally spawned from previous versions of the MintyQuest?


Now to expand. I have been trying to research a fix for a user of my mod who is seeing errors reported in the old Papyrus.log following an upgrade.

I know about most of the issues with scripts persisting over save games and even after the mods have been completely removed, and this is kinda what I am seeing from the users feedback.
For example the mod is working perfectly fine with all the latest changes visible to the user - but they also have errors being reported in the papyrus.log against those same lines in my scripts!?
(Like there is a ghost script running!)

So I think I understand the problem but I don't have a solution that 'fits my mod model' without asking and playing.

Spent a bit of time tonight and found some really cool posts:-
http://www.gamesas.com/topic/1345542-getting-a-script-to-run-when-the-game-loads/
http://www.gamesas.com/topic/1349590-init-at-game-load-and-init-at-game-restart/
http://www.gamesas.com/topic/1386485-uninstalling-scripts-vs-leaving-them-in-but-replacing-with-blanks/

I need to go back and re-read all of those but any advice is appreciated or any more links.

Thanks
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Sun Nov 18, 2012 4:56 am

If you removed properties and added new ones to your script, the removed properties will generate an error on startup.
But if your script doesn;t use those properties, you shouldn't see recurring errors.

Setting a stage to end the quest sould work if it is either a "complete quest" or your script has an IF statement checking the stage and then calling Stop().
User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Sun Nov 18, 2012 6:42 am

can you post the log here?
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Sun Nov 18, 2012 12:41 am

Thanks for the help both.

I don't have the actual log file yet as this is a user reported case but the section they posted over on my page was as follows:-

Spoiler

[08/11/2012 - 01:54:29AM] Error: Cannot call GetValue() on a None object, aborting function call
stack:
[None].MintyQuestForkScript.getUpdateFrequencyFork() - "MintyConfigScript.psc" Line 185
[None].MintyQuestForkScript.getUpdateFrequency() - "MintyQuestForkScript.psc" Line 100
[None].MintyQuestForkScript.OnUpdate() - "MintyQuestForkScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call GetValue() on a None object, aborting function call
stack:
[None].MintyQuestSheetScript.getUpdateFrequencySheet() - "MintyConfigScript.psc" Line 190
[None].MintyQuestSheetScript.getUpdateFrequency() - "MintyQuestSheetScript.psc" Line 47
[None].MintyQuestSheetScript.OnUpdate() - "MintyQuestSheetScript.psc" Line ?
[08/11/2012 - 01:54:29AM] warning: Assigning None to a non-object variable named "::temp21"
stack:
[None].MintyQuestForkScript.getUpdateFrequencyFork() - "MintyConfigScript.psc" Line 185
[None].MintyQuestForkScript.getUpdateFrequency() - "MintyQuestForkScript.psc" Line 100
[None].MintyQuestForkScript.OnUpdate() - "MintyQuestForkScript.psc" Line ?
[08/11/2012 - 01:54:29AM] warning: Assigning None to a non-object variable named "::temp22"
stack:
[None].MintyQuestSheetScript.getUpdateFrequencySheet() - "MintyConfigScript.psc" Line 190
[None].MintyQuestSheetScript.getUpdateFrequency() - "MintyQuestSheetScript.psc" Line 47
[None].MintyQuestSheetScript.OnUpdate() - "MintyQuestSheetScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call GetValue() on a None object, aborting function call
stack:
[None].MintyQuestForkScript.getUpdateFrequencyFork() - "MintyConfigScript.psc" Line 185
[None].MintyQuestForkScript.getUpdateFrequency() - "MintyQuestForkScript.psc" Line 100
[None].MintyQuestForkScript.OnUpdate() - "MintyQuestForkScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call GetValue() on a None object, aborting function call
stack:


some of this

[None].MintyQuestScript.isLoggingEnabled() - "MintyLogging.psc" Line 70
[None].MintyQuestScript.Debug() - "MintyLogging.psc" Line 28
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] warning: Assigning None to a non-object variable named "::temp14"
stack:
[None].MintyQuestScript.isLoggingEnabled() - "MintyLogging.psc" Line 70
[None].MintyQuestScript.Debug() - "MintyLogging.psc" Line 28
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call Stop() on a None object, aborting function call
stack:
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call Stop() on a None object, aborting function call
stack:
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call GetValue() on a None object, aborting function call
stack:
[None].MintyQuestScript.getUpdateFrequencyWeatherCheck() - "MintyConfigScript.psc" Line 195
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] warning: Assigning None to a non-object variable named "::temp23"
stack:
[None].MintyQuestScript.getUpdateFrequencyWeatherCheck() - "MintyConfigScript.psc" Line 195
[None].MintyQuestScript.OnUpdate() - "MintyQuestScript.psc" Line ?
[08/11/2012 - 01:54:29AM] Error: Cannot call GetValueInt() on a None object, aborting function call
stack:
lots of
[08/11/2012 - 01:54:59AM] [None].MintyQuestSheetScript.OnUpdate() - (requested call)
[08/11/2012 - 01:54:59AM] Dumping stack 44427229:
[08/11/2012 - 01:54:59AM] Frame count: 0 (Page count: 0)
[08/11/2012 - 01:54:59AM] State: Waiting on other stack for call (Freeze state: Freezing)
[08/11/2012 - 01:54:59AM] Type: Normal
[08/11/2012 - 01:54:59AM] Return register: None
[08/11/2012 - 01:54:59AM] Has stack callback: No
[08/11/2012 - 01:54:59AM] Stack trace:
[08/11/2012 - 01:54:59AM] [None].MintyQuestForkScript.OnUpdate() - (requested call)
[08/11/2012 - 01:54:59AM] Dumping stack 44427230:
[08/11/2012 - 01:54:59AM] Frame count: 0 (Page count: 0)
[08/11/2012 - 01:54:59AM] State: Waiting on other stack for call (Freeze state: Freezing)
[08/11/2012 - 01:54:59AM] Type: Normal
[08/11/2012 - 01:54:59AM] Return register: None
[08/11/2012 - 01:54:59AM] Has stack callback: No
[08/11/2012 - 01:54:59AM] Stack trace:
[08/11/2012 - 01:54:59AM] [None].MintyQuestScript.OnUpdate() - (requested call)
[08/11/2012 - 01:54:59AM] Dumping stack 44427231:
[08/11/2012 - 01:54:59AM] Frame count: 0 (Page count: 0)
[08/11/2012 - 01:54:59AM] State: Waiting on other stack for call (Freeze state: Freezing)
[08/11/2012 - 01:54:59AM] Type: Normal
[08/11/2012 - 01:54:59AM] Return register: None
[08/11/2012 - 01:54:59AM] Has stack callback: No
[08/11/2012 - 01:54:59AM] Stack trace:



and ends up like this

[08/11/2012 - 01:56:48AM] [None].URWLQuestScript.OnUpdate() - "URWLQuestScript.psc" Line 41
[08/11/2012 - 01:56:48AM] IP: 286 Instruction: 8 Line: 41
[08/11/2012 - 01:56:48AM] [::temp7]: 0.000000
[08/11/2012 - 01:56:48AM] [::temp8]: 12.752930
[08/11/2012 - 01:56:48AM] [::temp9]: True
[08/11/2012 - 01:56:48AM] [::temp10]: False
[08/11/2012 - 01:56:48AM] [::temp11]: False
[08/11/2012 - 01:56:48AM] [::temp12]: False
[08/11/2012 - 01:56:48AM] [::nonevar]: None
[08/11/2012 - 01:56:48AM] Dumping stack 44462205:
[08/11/2012 - 01:56:48AM] Frame count: 3 (Page count: 2)
[08/11/2012 - 01:56:48AM] State: Waiting on other stack for return (Freeze state: Freezing)
[08/11/2012 - 01:56:48AM] Type: Normal
[08/11/2012 - 01:56:48AM] Return register: 265.530914
[08/11/2012 - 01:56:48AM] Has stack callback: No
[08/11/2012 - 01:56:48AM] Stack trace:
[08/11/2012 - 01:56:48AM] .utility.GetCurrentGameTime() - "" Line ?
[08/11/2012 - 01:56:48AM] IP: 0
[08/11/2012 - 01:56:48AM] [None].URWLQuestScript.GetCurrentHourOfDay() - "URWLQuestScript.psc" Line 26
[08/11/2012 - 01:56:48AM] IP: 0 Instruction: 0 Line: 26
[08/11/2012 - 01:56:48AM] [::temp0]: 0.000000
[08/11/2012 - 01:56:48AM] [::temp1]: 0
[08/11/2012 - 01:56:48AM] [time]: 0.000000
[08/11/2012 - 01:56:48AM] [None].URWLQuestScript.OnUpdate() - "URWLQuestScript.psc" Line 41
[08/11/2012 - 01:56:48AM] IP: 130 Instruction: 4 Line: 41
[08/11/2012 - 01:56:48AM] [::temp7]: 0.000000
[08/11/2012 - 01:56:48AM] [::temp8]: 0.000000
[08/11/2012 - 01:56:48AM] [::temp9]: True
[08/11/2012 - 01:56:48AM] [::temp10]: False
[08/11/2012 - 01:56:48AM] [::temp11]: False
[08/11/2012 - 01:56:48AM] [::temp12]: False
[08/11/2012 - 01:56:48AM] [::nonevar]: None
[08/11/2012 - 01:56:48AM] Dumping stack 44434490:
[08/11/2012 - 01:56:48AM] Frame count: 3 (Page count: 2)
[08/11/2012 - 01:56:48AM] State: Waiting on other stack for return (Freeze state: Freezing)
[08/11/2012 - 01:56:48AM] Type: Normal
[08/11/2012 - 01:56:48AM] Return register: 265.524170
[08/11/2012 - 01:56:48AM] Has stack callback: No
User avatar
AnDres MeZa
 
Posts: 3349
Joined: Thu Aug 16, 2007 1:39 pm

Post » Sun Nov 18, 2012 8:14 am

Cannot call GetValue() on a None object
Assigning None to a non-object variable
Cannot call Stop() on a None object

[08/11/2012 - 01:54:59AM] [None].MintyQuestForkScript.OnUpdate() - (requested call)
[08/11/2012 - 01:54:59AM] [None].MintyQuestScript.OnUpdate() - (requested call)
[08/11/2012 - 01:56:48AM] [None].URWLQuestScript.OnUpdate() - "URWLQuestScript.psc" Line 41
[08/11/2012 - 01:56:48AM] [None].URWLQuestScript.GetCurrentHourOfDay() - "URWLQuestScript.psc" Line 26

You've got properties unfilled.
User avatar
IM NOT EASY
 
Posts: 3419
Joined: Mon Aug 13, 2007 10:48 pm

Post » Sun Nov 18, 2012 1:24 am

Thanks Aellis,

The URWLQuestScript ones is nothing to do my my mod but as for the others that is the strange thing because all properties are filled and the mod is working correctly it just happens to be outputting those errors to the logs. I suspect this is a previous version of the mod that is somehow still executing. Hence the question regarding using a quest to stage to finish the mod and thus end the script execution.

This kind of leads to my next question of how do you single a stage as a quest end stage?

Thanks again for the help
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Sun Nov 18, 2012 2:11 pm

ive seen this glitch pop up a few times and i dont know what causes it. you will not be able to call stages on it to end it, because the stages wont exist (the script is running off a phantom "None" quest object, there are no stages to set). you can't even run console commands on it since there is no formID

of all the times i have seen this glitch happen, the consensus seems to be that the error is not fixable outside of starting a new game. if it runs fine for the time being, i wouldnt worry about it. if it bloats your game or lags your other scripts, it may become a problem.
User avatar
Svenja Hedrich
 
Posts: 3496
Joined: Mon Apr 23, 2007 3:18 pm

Post » Sun Nov 18, 2012 7:38 am

Many thanks http://www.gamesas.com/user/766649-amethyst-deceiver/.
So on the assumption I can not kill the phantom quest is there a way to mark a quest stage as over so before upgrading I can finish and detach all the old scripts before loading in the replacements? kind of like an un-install option users can select before upgrading that will ensure all previous scripts are purged from the save game before the old mod is removed?

I have seen a few posts regarding managing upgrades etc and how to remove properties from scripts and such, but a simple stop mod in my case would be very helpful as my quest is only to trigger a script which watches the weather and during certain weathers plays out lightning strikes.

There is no real quest state as such.

Thanks again guys, really appreciate the advice.
User avatar
Natasha Callaghan
 
Posts: 3523
Joined: Sat Dec 09, 2006 7:44 pm

Post » Sun Nov 18, 2012 12:11 am

if your new content is a new quest, and you just want to terminate the old running stuff, you can call Stop() on all the quests you want to kill. when a quest is stopped, all aliases are purged and all associated scripts terminated with all registers unregistered (although the persistence for forced reference aliases will remain persistent).

if all you are looking to do is update a script on an existing quest, you probably dont need to end it unless the script is something heavy and is running continuously in a loop. updating scripts can become tricky once you start dealing with threaded and saved script code still being called from an old save game. this is why i always suggest using update events for looping functions rather than defining a full loop in a single function (i.e. long drawn out code or lengthy while loops etc). with a registered update, you can "butt in" with an updated code and have a better chance of getting the new code to spool in real time rather than sitting out the entire length of the threaded saved code.

also one more thing, i have found it is generally a bad idea to recycle existing scripts to doing some kind of drastically different action as the original script that was initialized by the save game. if you have to deprecate a script, just kill its parent object (if a magic effect, it will end by itself when the effect ends, if a quest call Stop() on it, etc), unregister all its events if necessary, and blank out all of the active code, and leave the script in the script folder (dont delete it even if it is no longer actively used). unfortunately, this creates garbage in your loose files, but thats just the way papyrus works (it wont clean up after itself).
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Sun Nov 18, 2012 4:43 am

Thank you again Amethyst Deceiver

I am not recycling scripts, it is more like re-factoring them to clean the code up and make it more maintainable. The mod started as a simple fix for a friend who asked "wouldn't it be cool if there was actual lightning strikes" and I agreed and stupidly said "I could make that happen" ;o)

I didn't really understand the whole CK and Papyrus at the time and I still do not but I knew javascript and Papyrus looked similar ;o) After all the mod was just for my mate...

So I ended up with a 100% scripted solution with a quest holder to start of the script.

My basic model is a Quest (player start) with a script attached which registers for single update... loop started and I assume save game effected!

This main quest just checks if the current weather is 'Bad enough for lightning' and if so starts a couple of sub quests to control the sheet and fork lightning (scripted again - so just simple quests with a script attached).

I did completely rewrite the mod as originally it was all in the one script attached to the single quest but I didn't like it and I think this re-factoring has introduced the error for this user.

I am not too worried about the Papyrus errors if they are only a one-off, but I am worried about the old save game bloat!

I have had my own save game bloat on my original play thru (not my fault BTW, I had not even heard of modding at that stage, in fact the only reason I got into modding was because my original save game died, otherwise I would seriously still be playing SkyRim! ;0)

So my concern now is will my re-factoring potentially cause long term save game bloat?

Thanks Guys
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm


Return to V - Skyrim