Jump to content

Question on scripts attached to SGE quests


Pevey

Recommended Posts

If I have two scripts attached to a start-game-enabled quest (one on the Player alias and one on the quest itself), and then I update these scripts in a subsequent release, how can I ensure that the scripts are actually updated for an existing character instead of Skyrim loading the old scripts?

 

I know a "clean" (aka dirty) save would accomplish this, but that would cause a lot of data to be lost that I want to keep.

 

If the quest is stopped, and then started again, is this sufficient to ensure that the new quests are picked up? Or what if I added a "completes quest" stage and then had a method to "complete" the quest and then restart it (probably through MCM)?

 

Would greatly appreciate insights from a modder who has found a good solution to this issue.

 

Thanks,

LP

Link to comment
Share on other sites

When updating scripts....

 

To prevent issues:

1. you must keep the same properties in place even if you no longer use them.

2. you must keep the same functions and events in place even if you no longer use them.

 

Papyrus will complain that the script no longer contains those things and will force the game to use what is stored in the save rather than the new version. If you keep all the old stuff, then it won't complain and the new will be used.

 

When I say keep the same function, you may be able to get by with simply having the definition but no guts. Example, say you had this custom function

 

 

Function abimTransferING(Ingredient ItemToTransfer, ObjectReference ContainerToTransferTo, Actor ContainerToTransferFrom, Quest RunningQuest, Int StartStage, Int EndStage)
	int count = ContainerToTransferFrom.GetItemCount(ItemToTransfer)
	If (count >= 1) && !((RunningQuest.GetStage() > StartStage) && (RunningQuest.GetStage() < EndStage))
		ContainerToTransferFrom.RemoveItem(ItemToTransfer, count, True, ContainerToTransferTo)
		transfered = true
	EndIf
EndFunction

 

 

but you decided you no longer needed it. In theory you could cut it down to

 

 

Function abimTransferING(Ingredient ItemToTransfer, ObjectReference ContainerToTransferTo, Actor ContainerToTransferFrom, Quest RunningQuest, Int StartStage, Int EndStage)
EndFunction

 

 

and Papyrus wouldn't complain about it.

 

If you need to remove properties then you first need to go to each form that uses the script and remove the value of that property, then and only then can you safely remove a property from a script. If you don't do that there will be errors but the game should still use the new script. Its the functions & events that are critical.

 

Hope that was helpful.

Link to comment
Share on other sites

These are good points for scripts in general, especially those attached to objects, but not really the specific issue of scripts attached to SGE quests. IME, it seems that quest scripts don't update while the quest is running. If that is true, then it particularly would be an issue for SGE quests that are designed to run in the background.

 

Are you certain that those scripts DO update as described above?

Link to comment
Share on other sites

I've done a few player alias scripts and I've always treated them the same as any other script. Putting a script on the player alias is just like putting a script on any object. The difference being that the player alias gets wiped on mod removal and thus has no worry about any left over script cruft. Granted I've not done outlandish scripts that do wild and crazy things.

 

What I would suggest is keeping a backup of your scripts as they are now and give the update a try. See how it behaves in game and in the Papyrus log and see if there are any issues to deal with. If there are no issues, then it should be fine. If there were issues and they were related specifically to updating the script, feel free to document and share any solutions you do come up with.

 

I will admit that when I have done player alias scripts, I've always done my testing on new games and always recommend uninstalling the old, making a save without, and installing the new.

Link to comment
Share on other sites

I did some testing by enabling the new version on several characters that already had the SGE quest from the old version enabled. It seems that the game WILL, indeed, pick up new versions of scripts even for quests that are already running.

However, things were a little buggy due to the extensive changes. What I ended up doing was changing the form number of the quest using TES5Edit. That way, when the new version is loaded, the game sees it as a brand new SGE quest and forces the new scripts to run.

Either way, there is tons of papyrus log spam about the missing properties, so it is not ideal.

Also, I found that in my tests, this doesn't actually work:

IsharaMeradin, on 13 Mar 2013 - 16:19, said:
When updating scripts....

If you need to remove properties then you first need to go to each form that uses the script and remove the value of that property, then and only then can you safely remove a property from a script. If you don't do that there will be errors but the game should still use the new script. Its the functions & events that are critical.


As far as I can tell, if you remove the properties from a quest script, no matter how you go about doing it, Papyrus will complain in the log.

Again, thanks for your help, especially the info about keeping the events and functions.

Link to comment
Share on other sites

You changed the form number of the quest? No wonder. In essence what you did was re-add your quest on top of your existing quest. The mid-game log is most likely complaining about the old quest which is still stored and using the script you updated because you did not fully uninstall.

 

You need to try updating the script without changing the form id number. Then and only then if you edit properties as I outlined they will no longer give a report about not being able to be initialized.

 

If this weren't the case then several of the USKP script corrections are for naught and yet they indeed do work.

 

 

[03/12/2013 - 10:16:17AM] warning: Property DLC1VampireChangeEffect on script dlc1playervampirechangescript attached to DLC1PlayerVampireQuest (020071D0) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property HackAndSlash90 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property MagicResistance30 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property Bladesman60 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property WindWalker on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property SavageStrike on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property HackAndSlash60 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property MageArmor50 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property MageArmor30 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property AugmentedFrost on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property MagicResistance50 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property Necromancy on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property DarkSouls on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property
[03/12/2013 - 10:16:17AM] warning: Property Bladesman90 on script DLC1SeranaLevelingScript attached to  (02003BA8) cannot be initialized because the script no longer contains that property

 

 

The above are corrected in the USKP by adding the property to the script, compiling, going to the form, clearing the property value, and restoring the original script. I've done it several times with my own scripts without issue.

Link to comment
Share on other sites

No, I think I was unclear.

 

I tried without changing the form number at first. Changing the form num was a hack to ensure that the new script would be picked up. The level of complaining in the papyrus log was about te same either way, and changing the form num at least ensures that the quest worked correctly. It is really no different from doing a "clean" save.

 

But, I ended up finding a better way. I made a "clean-up" version of the previous release. This version clears all the properties on all the scripts and stops all the quests. The user will unistall the old mod, install the clean-up mod, open game, save, close, install new version, now good to go!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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