FlashyJoer Posted October 25, 2017 Share Posted October 25, 2017 Hi all, Quick question - is there a hard limit to the amount of global variables one can declare and use in a single script? i've got a couple variables set up in my .esp that are not constant. They are declared in my script and their properties are set up correctly. So, refalias script - properties set. In the script itself the variables are declared as AUTO only, as all of my globals are. But when it comes time to update them, they simply will not update. Ie: In one instance, I have a clause within an event that contains three calculations and global variable updates. Two updates work completely. The third, well, the int variable I declared works, I can see it increase by 1 as it should (debug notif) but the global does not update with GlobalVar.setvalueint(abc), as the other two do. I currently have 18 global variables at play in my script. Is this beyond some limit I dont know about??? Im hoping not / thinking not, as Ive seen some scripts with just as many, if not more, but Im at a loss. Should not I performed a conflict analysis in FO4Edit and found none. I've erased the global in question, created a new one with new formID - it doesnt matter, the setvalueint on it just will not work. And I should not, it is indeed an int that it being added (1+1 etc). Also, no compile errors. Anyone with an idea, Id love to hear your knowledge / experience. Many thanks! Link to comment Share on other sites More sharing options...
SKKmods Posted October 25, 2017 Share Posted October 25, 2017 I remember having some problems with global ints, so always use the default float get/set and cast as Int for iValue = (GlobalVariable.GetValue() as Int) Link to comment Share on other sites More sharing options...
FlashyJoer Posted October 25, 2017 Author Share Posted October 25, 2017 Cool. Thanks for that! :) I will test it out and circle back... Link to comment Share on other sites More sharing options...
ThoraldGM Posted October 25, 2017 Share Posted October 25, 2017 My current WIP has almost 300 globals, but most are in formlists for loop checking. (See line 239: https://pastebin.com/mSH8pJ6L ) I also use SetValue and GetValue as Int. The formlists are nice, but not looking forward to making the MCM menu with 300 JSON entries. If you still have problems, showing code may help. Link to comment Share on other sites More sharing options...
FlashyJoer Posted October 27, 2017 Author Share Posted October 27, 2017 Ive resolved my issue with the original response :) Many thanks! Link to comment Share on other sites More sharing options...
Recommended Posts