• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Should i worry about variable count?

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hello! I will create a custom map with custom heroes AND custom spells. Each hero will have four (4) triggered MUI spells. I will make around 30-35 heroes, which means 30 x 4 = 120 spells.

Now i will explain why i worry :
I make spells MUI trough the Dynamic Indexing System by Hanky and i have calculated that each spell uses about 15 variables. This means 120 x 15 = 1800 variables. Should this be a problem in my map? I mean, are there going to be any crashes in the map or something like this? Or the only problem is that i will have to scroll trough 1800 variables in order to find the variable that i need? By the way - can i somehow group some variables in a folder or something? So that scrolling will not be needed? It will be really hard to find my variable in between 1799 other variables...

Help is appreciated with a +rep.
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
You do realize you can use same variable multiple times?
Also, you can always use the local ones to avoid creating so many of them.

About grouping.. you can put a prefix to each in order to associate them to a different spell. (Ex: Frost Shot -> FS_Damage, where FS is the prefix).
You mean that i need only one ID, ID2, ID Max, Array and Loop variables?! And i also forgot to ask - how much is the maximum amount of variables a map can use?

About the prefixes, i put them. But i ask if there is a way to put the variables in a folder or something (just like we can put triggers in a folder).
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
You can use 1 variable in 100 spells without a problem, as long as it is being used temporary, in which there will be no problem.

As for MUI spells which would require a loop and a periodic trigger where the data is being called multiple times, you'd need to use more than one variable.

And no, you can't put them in folders or something, just prefixes.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
can i somehow group some variables in a folder or something? So that scrolling will not be needed? It will be really hard to find my variable in between 1799 other variables...

Yeah, learn vJass. GUI already allows only very short identifiers, which is why prefixing is crappy too. Two or four letters do not clarify anything as you approach a greater scale of content or take a break.

The maximum amount of global variables is a bit less than 25k, at least the compiler prints an error then. I believe my personal max was 8k til now. You can still put data in hashtables or gamecache.
 
Status
Not open for further replies.
Top