bwins95 Posted January 7, 2014 Share Posted January 7, 2014 Are their any kind of alternatives to global variables? in my mod I need to set a group of global variables and it will eventually end up being hundreds of global variables in the script. it could even hit the character limit. This is an example of a menu I'm toying with as a proof of concept. scn aaaaGlowingItemsMenutestshort ButtonBegin OnEquip player ShowMessage aaaaGlowingItemsContainersMenuEndbegin gamemode Set Button to GetButtonPressed if button == 0 set aaaaGlowingItemsContainersRed to 1 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersPink to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 1 set aaaaGlowingItemsContainersWhite to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersPink to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 2 set aaaaGlowingItemsContainersBlue to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersPink to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 3 set aaaaGlowingItemsContainersGreen to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersPink to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 4 set aaaaGlowingItemsContainersPurple to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPink to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 5 set aaaaGlowingItemsContainersPink to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersYellow to 0 elseif button == 6 set aaaaGlowingItemsContainersYellow to 1 set aaaaGlowingItemsContainersRed to 0 set aaaaGlowingItemsContainersWhite to 0 set aaaaGlowingItemsContainersBlue to 0 set aaaaGlowingItemsContainersGreen to 0 set aaaaGlowingItemsContainersPurple to 0 set aaaaGlowingItemsContainersPink to 0 endifend These global variables are all short. is their a better way of turning on one global and shutting off another group of global variables without having hundreds of global variables in a script? Link to comment Share on other sites More sharing options...
blove Posted January 7, 2014 Share Posted January 7, 2014 Turn them all off at the beginning of the script and then turn on only the one selected. Link to comment Share on other sites More sharing options...
rickerhk Posted January 9, 2014 Share Posted January 9, 2014 Another way is to use quest variables in a dummy quest script, instead of globals. A resetQuest function will clear all the vaiables. Then set the one you want. http://geck.bethsoft.com/index.php?title=ResetQuest Link to comment Share on other sites More sharing options...
Recommended Posts