Jump to content

Global variables


bwins95

Recommended Posts

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 aaaaGlowingItemsMenutest

short Button

Begin OnEquip player
ShowMessage aaaaGlowingItemsContainersMenu
End

begin 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
endif
end

 

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...