• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

global variables as custom gameplay constants

Status
Not open for further replies.
Level 4
Joined
Feb 22, 2012
Messages
74
I have a question about how efficient some of my ideas are in my map which uses many triggered spells. I have decided that, to make balancing easier, I would store many of the parametric data for abilities in global variables and reference those variables in the spell triggers. I guess this is sort of like using global variables as custom gameplay constants. An example would be, for a spell like this:

Heals 50 HP and splits 25 damage between enemies in a 200 radius, if cast on an ally. Deals 25 damage and splits 50 HP between allies in a 200 radius, if cast on an enemy.

Instead of putting the numbers in the trigger as real values, I use globals called

judgementHeal = 50.00
judgementDamage = 25.00
judgementRadius = 200.00


and reference them in the trigger. That way, future balancing is a matter of changing each variable 1 time instead of entering each trigger to change it multiple times.

Or would it be better to have a real number array, like this:

judgement[0] = 50.00
judgement[1] = 25.00
judgement[2] = 200.00

I am wondering if, because globals take up memory, it i more or less efficient performance-wise to do it the other way. I could see some spells having up to 6 real-number variables. My map should have a maximum of about 40 spells.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Maker is right. Unless you have so many variables of the same type that it takes up the entire variable editor, a few nonarray are fine.
 
Status
Not open for further replies.
Top