Xaranth Posted March 1, 2013 Posted March 1, 2013 Can't you have the item script do the heavy lifting?
rickerhk Posted March 2, 2013 Posted March 2, 2013 I assume these are quest scripts. FYI there is only one script thread and there's no way for you to control the order that your three scripts run. It's not safe to assume the the 1.1 delay script is running first and so on.Usually, crashes with NVSE can be caused by calling a function on a null reference.Though from what you described so far, having an object script on the item like Xaranth said, whould be the way to go, and just consolidate your quest scripts into one that has a delay of 1 second, that checks a quest variable that would be set by the object script. And any NVSE function that you call on a reference variable, check to make sure it is non zero before proceeding: if (MyObjectREF) MyObjectREF.NVSEFunctionCall endif Also, removing items from a container (or player) in the same frame it was added is another recipe for instability.
nyteschayde Posted March 3, 2013 Author Posted March 3, 2013 On 3/2/2013 at 2:54 AM, rickerhk said: I assume these are quest scripts. FYI there is only one script thread and there's no way for you to control the order that your three scripts run. It's not safe to assume the the 1.1 delay script is running first and so on. Usually, crashes with NVSE can be caused by calling a function on a null reference. Though from what you described so far, having an object script on the item like Xaranth said, whould be the way to go, and just consolidate your quest scripts into one that has a delay of 1 second, that checks a quest variable that would be set by the object script. And any NVSE function that you call on a reference variable, check to make sure it is non zero before proceeding: if (MyObjectREF) MyObjectREF.NVSEFunctionCall endif Also, removing items from a container (or player) in the same frame it was added is another recipe for instability. So my mod introduces more needs in hardcore mode. It is called FurtherNeeds. You can learn more about it at padreams.posterous.com. I had to overcome quite a few issues just to get it to the playable state that it's in. The three quest scripts I have do different things. They don't rely on each other to run in order (i.e. the 1.1, 1.2 and 1.3 time interval values) its just that for some reason my mod fails if they all run at a 1 second interval. One of the scripts is a monitor that updates the UI (custom HUD elements I've introduced). This is the most sensitive one given the new crash happy state it was in. This one runs every second, roughly, and checks to see if there are any changes to the new attributes I've introduce to the game as well as to update the UI to notify the user of these changes. I also have the main mod quest which serves as a global scope for the mod. All variables and effects that modify the new attributes reference this script. This script does some background tasks as well. I do you equipment items for menu tokens and and am mostly complete, but I am just testing to make sure that I have successfully fixed the crashing issue.
Recommended Posts