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

Stack Index

Status
Not open for further replies.
Level 17
Joined
Jun 17, 2010
Messages
2,275
I thought about this over and over again and i cant figure it out without a glitch forming, I need a trigger to count charges for separate heroes. I.E. 20 heroes who charge on attack with a separate charge. I used a dummy unit, but i cant refer back to the dummy unit because the index i used increases by 1 if a unit with the spell attacks and has 0 charges.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Creates hashtable:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
  • Hashtable - Save Handle Of(Last created unit) as (Key dummy) of (Key (Triggering unit)) in Hash
When you click the "as value", select Hashtable - Get String ID and then type some string there. Triggering unit is the unit you want to link the dummy with. The last created unit is the dummy. Instead of last created unit, you can use any event response that matches your dummy, or use a variable.

  • Set u1 = (Load (Key dummy) of (Key (Picked unit)) in Hash)
This loads the dummy. Picke unit is the unit whose dummy you want to load. You may need to use something else than picked unit.

Maybe you can skip using the dummy and store an integer instead?

If you want to stick with indexing, please post the code. Currently I'm not 100% sure what you're trying to do.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
I need the dummy because i need to have a buff on the hero being charged representing the number of charges by levels. But yeah i am using an integer for the actual spell just i need to increase the level of the individual dummy units ability to show how many times hes charged.

Edit: My main situation is having multiple heroes with different integers set up for themselves, like 1 hero has 5 charges, but another hero has 2 charges, etc, i could skip all this and have a condition that checks the level of the dummy units ability but that goes back around to needing the dummy unit to be isolated for each hero.
 
Status
Not open for further replies.
Top