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

Spell Help! (Hash me not, Hash me too! I dont know what to do!)

Status
Not open for further replies.
Well im basically doing a custom spell with triggers and based in the immolation ability, the event trigger when "immolation" and "unimmolation" orders are given. But when the hero mana reaches 0 the bonuses dont wear out, but the spell does. So i need to do a "mana especific unit event", for that i need a hashtable, how can i work with it???

PD: Basically i need someone to help me in the usage of the hashtable, or at least to enlightme in how can i make a variable that works properly for the spell.... or maybe both!!
 
You don't need hashtables for this, except if you use an index system.

Every 0.XX (between 0.5 and 0.1) seconds, you check if the mana of all the units which are using spell (with a pickeveryunit or index system if you use one.), if the mana = 0 (or less than a number like 5), you stop the spell.

But that wont cause a periodic lag or something like it???
 
You can also turn off the periodic timer.But except if you have about 50 periodic timer like this, it won't create visible lag.

Every thing you do create a lag, if you move an unit or create one or any other thing, but you can't see it with your eyes except if you have too much actions ^^ So, yes it will create a lag, but this won't affect the game.
 
You can also turn off the periodic timer.But except if you have about 50 periodic timer like this, it won't create visible lag.

Every thing you do create a lag, if you move an unit or create one or any other thing, but you can't see it with your eyes except if you have too much actions ^^ So, yes it will create a lag, but this won't affect the game.

But wouldnt it be much more effective with hashtables? so there will be just one action on the exact moment? do u know where i can get the hashtable tutorial???
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can also put aside the hashtable usage, and go for even more simpler method

Just add the immolation unit to a Unit Group variable, and periodically check their current Mana, if it's 0, remove them from unit group and order it to unimmolation (or to cancel the ability effect) immediately.
 
Status
Not open for further replies.
Top