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

Hero ability problems

Status
Not open for further replies.
Level 10
Joined
May 28, 2011
Messages
455
Can anyone help me?
I am making an arena map. Each hero has 5 abilities. Im GUI user.
The problem is i should declare variables for a particular ability or declare variables for all ability?
For example, for war stomp, instead of declare WS_Caster, WS_CasterPoint (WS indicates warstomp) can i just declare Spell_Caster, Spell_CasterPoint?
So that the variable can be use for another abilities? is this possible?
i had tried with spell_varName[spell_index[player_number]]
spell_index is integer array variable for mui purpose.
player_number to differ index among players.
i thought if i declare variables for a particular ability, the variable will be too many.
Therefore, what is the suitable algorithm to make hero ability trigger?
Sorry for bad english. hehe :p
 
If the variables are not meant to be used after a wait or some periodic loop, there is no collision with other spells. So, if two triggers use the "Set Spell_Caster = (Triggering unit)", there is no problem with it, as long as the requirements above are met.

As for array'd variables, you can use systems designed for the purposes of MUI (MPI is even easier to recreate): http://www.hiveworkshop.com/forums/spells-569/gui-unit-indexer-1-2-0-2-a-197329/
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
Use locals to cut down on the quantity of globals needed. You could also create systems which many abilities use to avoid extra indexing variables.

Example being 2 damage over time spells. If you record the damage along with the instances you could have both abilities run off the same system (just different casting logic).
 
Level 10
Joined
May 28, 2011
Messages
455
Exactly, i need to assign caster for other abilities too. And there is timer. For example, knockback with damage ability, trigger need to recognize the caster to damage the target in unit - damage target, and at the same time, another knockback ability with different effects that require the caster unit.
The GUI unit indexer system look very useful.
Im new mapper, still learn basic stuffs. so, i cant develop system yet.
Do you have indexing spell system? or anyone?
 
Status
Not open for further replies.
Top