Scripts failing when players upgrade mod... something I'm do

Post » Thu Jun 21, 2012 6:28 pm

I'm getting some strange reports from people as they upgrade to my latest version of ScenicCarriages and the one common thread seems to be scripts not working.

I know that the game cannot upgrade scripts if they are currently running, so I put code in to check if a carriage is loaded (using the Is3DLoaded function) and that seems to work great - it will warn the user if they load in front of the carriages. What I don't know how to do is check if the actual scripts are running, is that possible?

Is there anything special I'm supposed to be doing (or not doing) to upgrade? Some people have problems with the main script, which had a lot of changes, including adding and removing properties. Other scripts that are failing had little to no changes.

From what I am reading on the forums, it does seem there are a lot of issues with the save files... is it really this bad or something I am causing? If you need more info, let me know as I'd really like to find some kind of solution, if possible. I know it’s not the scripts themselves as I am very thorough at testing so I know everything works fine in ”my environment’. (Famous developer comment, I know…) And I always test on a clean Skyrim install and clean save file. I also tested upgrading a save game through the two previous releases. So I know in an "ideal" environment, it works.

Thanks!

PS - when I say "not running", I mean literally as the first code to run should move the driver to the carriage and seat him, and even that fails to happen.
User avatar
Jonny
 
Posts: 3508
Joined: Wed Jul 18, 2007 9:04 am

Post » Thu Jun 21, 2012 9:57 pm

Maybe you have included changes in the oninit event or on other not running again of one of the upgrading scripts. If so, those changes won't be applied until a new game is started. That way, you would be using the old variable and properties with the new script version. Other than that, new version should override the old one, once the running functions and events are finished (this could be a problem if you have non ending functions).
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Thu Jun 21, 2012 10:31 am

Maybe you have included changes in the oninit event or on other not running again of one of the upgrading scripts. If so, those changes won't be applied until a new game is started. That way, you would be using the old variable and properties with the new script version. Other than that, new version should override the old one, once the running functions and events are finished (this could be a problem if you have non ending functions).

Thank you amgepo! I'm glad I'm not totally screwing something up!

It's not OnInit() code, it's just regular scripts attached to the dialog and objects. I do have two that I keep running with OnSingleUpdate but they do end when the player reaches the destination. If I was doing something that kept the from ending, shouldn't they *always* be running so they wouldn't upgrade for anyone? The scripts seem to be upgrading fine for most people. I have been telling people to wait 60 seconds before saving, so that the one script could finish (it should only run for a few seconds after they finished their ride, but i was being cautious), the other ends when the ride is done.

So, it seems back to the question: Any way to determine if a script is running (from script)?
User avatar
Sophie Payne
 
Posts: 3377
Joined: Thu Dec 07, 2006 6:49 am

Post » Thu Jun 21, 2012 7:06 pm

So, it seems back to the question: Any way to determine if a script is running (from script)?
Debug.Notification("This script is running from: " + Game.GetFormID())
User avatar
TASTY TRACY
 
Posts: 3282
Joined: Thu Jun 22, 2006 7:11 pm

Post » Thu Jun 21, 2012 10:44 am

Debug.Notification("This script is running from: " + Game.GetFormID())

Sorry, I wasn't clear. What I mean is, is there a way for one script to determine if another script is running?

So I have my quest script that starts when they upgrade. That code checks to make sure they don't have any carriages loaded. (This works great.) I'd also like that script to check if the main quest script is running, or one of the driver scripts, or a horse script or a carriage script is running.
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Thu Jun 21, 2012 5:22 pm

Adding notifications to the scripts is the only way I can think of, or http://www.creationkit.com/Trace_-_Debug.
User avatar
Manuela Ribeiro Pereira
 
Posts: 3423
Joined: Fri Nov 17, 2006 10:24 pm

Post » Thu Jun 21, 2012 7:36 pm

Adding notifications to the scripts is the only way I can think of, or http://www.creationkit.com/Trace_-_Debug.

Okay, that's what i thought too. I'm not sure how I would notity it, since I would be needing this on the script from the previous code base. It's the new version that needs to see if anything is still running, so the old code would not know of the new quest, without it becoming crazy. And worse, trying to do this through OnUpdates would probably cause the very problem I'm trying to avoid - it would keep the script running.

What I need is a way to ask Skyrim (or the Papyrus manager) for a list of script objects currently running. Then enumerate that list for any of my scripts. So simple in concept, but I dont' see way to get to that information.
User avatar
Danielle Brown
 
Posts: 3380
Joined: Wed Sep 27, 2006 6:03 am


Return to V - Skyrim