Jump to content
Sign in to follow this  
marthgun

Script Help; Base Object [Form] Scripting on Current Games

Recommended Posts

So I'm back, after SKSE was released for SSE.  Here's the original thread (if you care enough to see what i'm doing) 

 

a Quick Rundown, Vanilla Trap Activator has a Vanilla script, i edited that Vanilla script on its base object (form) so it would cascade down to the hundred+ Object References in the game.  Unfortunately, since Properties bake into saves, messing with Properties (adding, subtracting) will cause total chaos on Current saves.  A New Game is fine, even saving once is not fine, as i found enormous save bloating occurring.  I could add the script to each instance (reference) in the game, but that would be absurd and not even worth it for many reasons.

An idea floated to me by Ishara, was to attach my script to a quest, then call that quest from the Vanilla Activator Script attached to the Base Object.  

I have yet to find a way how to do this without adding my Quest as a property to the Vanilla Activator Script.  I've thought about a global script, I've also thought about polling the activators through a constant perk or quest since there is a condition to test whether an object is an activator.  but i do not like the idea of polling in general, and would like to avoid that at all possible.  I'm not good at problem solving in general, and I would like some ideas or help or even some discouraging words of abuse.  :whip:

 

Share this post


Link to post
Share on other sites

If you add or remove properties from the script on the base object, the references using that script will NOT UPDATE AUTOMATICALLY. You must update them manually for each affected reference, by navigating to that reference in the CK, select the script, then click on 'properties' - and only then, a message will pop up notifying you that the script properties have been updated. Once this is done, you're fine.

Modifications that are restricted to the code however do not require this procedure, as the scripts on the references will update to the new code automatically (well, unless they were loaded when the last save was made before you did upgrade; in that case, they may need to reload until the changes take effect).

This is particulalry annoying, of course, if you modify both the code and the script properties. In that case, if you have not manually updated all affected references, they will run the new code but will continue to use the properties they got from the old script - which will most likely result in the scripts running on them to stop working.

Share this post


Link to post
Share on other sites
2 hours ago, Sclerocephalus said:

If you add or remove properties from the script on the base object, the references using that script will NOT UPDATE AUTOMATICALLY. You must update them manually for each affected reference, by navigating to that reference in the CK, select the script, then click on 'properties' - and only then, a message will pop up notifying you that the script properties have been updated. Once this is done, you're fine.

Modifications that are restricted to the code however do not require this procedure, as the scripts on the references will update to the new code automatically (well, unless they were loaded when the last save was made before you did upgrade; in that case, they may need to reload until the changes take effect).

This is particulalry annoying, of course, if you modify both the code and the script properties. In that case, if you have not manually updated all affected references, they will run the new code but will continue to use the properties they got from the old script - which will most likely result in the scripts running on them to stop working.

 

The problem is i can't expect the end-user to update each reference via CK.  Unless you're saying that I, the mod author, could update all changes, but I'm pretty sure in the former thread i linked just about everyone said that properties are baked into saves.  If there was a way to iterate through each object reference via a single SGE quest script, i wouldn't be opposed to that.

I would be very interested if what you're saying is true, i need some corroboration first, there are over 500+ references iirc. (there's probably alot more tbh, it's every trap in the game and DLC)

Share this post


Link to post
Share on other sites

(1) Updating the refs to have the proper property values set is your responsibility as the mod's author.

(2) A running script will not accept any new values set in the properties window. E.g. if you have script that permanently runs on a start game enabled quest, the only chance to make it to accept new property values is to write another script that overwrites the values at run time. Not so if the script is not permanently running though. Trap scripts will not run if the trap is not in the loaded area.

Share this post


Link to post
Share on other sites
24 minutes ago, Sclerocephalus said:

(1) Updating the refs to have the proper property values set is your responsibility as the mod's author.

(2) A running script will not accept any new values set in the properties window. E.g. if you have script that permanently runs on a start game enabled quest, the only chance to make it to accept new property values is to write another script that overwrites the values at run time. Not so if the script is not permanently running though. Trap scripts will not run if the trap is not in the loaded area.

 

Let me back up, i was confused by what you were saying initially.

 

I have edited a vanilla script on a trap Activator, on a new game this is fine.  but say, someone uses this mod and is halfway through the game with half of the trap activators already been loaded.

Are you saying that by me going through each Object Reference in the CK and filling those new Properties, there will be no negative consequences for loading up these activators on a half way through save?

 

If that's all it takes, i have no problem with doing that.  I guess i need to do some testing on it first to make sure.  It would explain why the only traps that worked were the ones my mod added, whereas trap activators that I had never loaded in my game were borking out and causing log spam and save bloat.  I was just under the impression that there was more to it.

------

as for (2), i meant programatically update the Properties, which i doubt is possible.

 

I'm going to be very, very grateful if this solves the issues.  

Share this post


Link to post
Share on other sites

No problem in modifying existing properties (edit: see below), or adding new ones.

But if the wish is to remove properties (not recommended), then applying 0 to the record value is possible instead, but it can bloat the save and possibly interfere with other mods further up the load order.

Polling activators isn't a bad idea, (can you limit the timeslice?) especially in interiors where not much is expected to be going on process-wise.

Share this post


Link to post
Share on other sites

well that is good news for me, i guess it all makes sense; i wasn't removing any properties on these scripts, i just added half a dozen large Property arrays.  going through all of these references is going to suck, but at least i can finish it. :D  let me know if there's something else i'm missing, thanks for the help

Share this post


Link to post
Share on other sites

Actually, it's possible to safely remove properties, and add new properties. No special consideration needs to be taken. Just add them in the CK and you're done.

Changing a property to a new value is where things get sticky. With Skyrim this will require you to use a second script to update the value in the first one. All script values are baked into the save from the moment the game starts, so if you need to change a value you have to force the game to do so with another script. That's the basis on which our entire retro script system works for the unofficial patch, for example.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

Support us on Patreon!

×