• 🏆 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!

Which Variables should be Array ?

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
I'm about to do my second MUI trigger in the whole life. But I would like to remember the variables that should use Array. Like Triggering player, triggering unit, point, Integer, real, timer, dummies etc.
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
The first step is to think about what the spell should do and how. Try to think about what information do you need at which point of the spell.

For example:
1. Right after casting deal some instant damage to all units in a line from the caster to the target and create an effect on the targets head.
2. Every two seconds deal some damage to the target
3. In the end remove the effect on the targets head.

The things that happen instantly after casting arent interesting, as MUI is only complicated with things that happen after some time.
So 1. isnt important
For 2. you need to know who the target is, and who the caster is (so he can get credit for the damage), and maybe how much damage you want to deal (if this isnt always the same).
For 3. you need to destroy the effect, so you need to know which effect you want destroyed.

-> You need to store "target", "caster", "damage", "effect". All those values are different for every instance of the spell, as every instance has its own target, its own caster, its own effect etc.
All those values which are different for every instance need to be saved in an array.
In contrary, the unitgroup you use to deal line damage does not have to be stored in an array. The linedamage is done instantly, which means that different instances of the spell that are casted after each other dont influence each other.

-> When casting the spell, get a new Index for the array (i guess you know how that works?), save those values in the arrays using that index.
Etc.
 
  • Like
Reactions: hdm
Status
Not open for further replies.
Top