• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

when i spawn more units, only the latest unit will have the trigger effect, why?

Level 2
Joined
Feb 28, 2026
Messages
5
1772315917076.png
1772315931960.png
1772315953302.png


I played around with hashtables and variables and both did not work, every new wizard i spawn regardless of variable or hashtable handle the attack trigger will only work for the latest spawned wizard.
The goal is for every wizard on the map to have this attack replacement.
I know it is a lot but if anyone knows how to make this workable please help!
 
Can you make a description of this special attack? Might be over complicating if not described
Every time a wizard attacks, it will instead of a directional attack towards a unit, fire a lightning orb that moves in a straight line from the wizard in the direction of enemy castly, and damages the first unit its hitting.

The trigger works perfect when there is just 1 wizard, however, when i spawn more wizards, only the last spawned wizard will have the trigger attack and i dontk know why...
 
In "line shot loop" you are not looping through all the indexed wizards, i.e. "for each loop [int] from 1 to wizard [int] dex".
So you have no pointers to earlier references of the index, only the latest .

(also you are not de-indexing at the end, which might not be a problem in your map, but is generally safer and cleaner to do. Better to do it properly now - you'll thank yourself later)

Also point leaks will build up rapidly here -> https://www.hiveworkshop.com/threads/things-that-leak.35124/
 
Last edited:
In "line shot loop" you are not looping through all the indexed wizards, i.e. "for each loop [int] from 1 to wizard [int] dex".
So you have no pointers to earlier references of the index, only the latest .

(also you are not de-indexing at the end, which might not be a problem in your map, but is generally safer and cleaner to do. Better to do it properly now - you'll thank yourself later)

Also point leaks will build up rapidly here -> https://www.hiveworkshop.com/threads/things-that-leak.35124/
Alright, that might do something,
I am not advanced enough to de-index at the end.
I suppose you mean that when a wizard dies that index dissapears?

Update: when i add for each int from 1 to wiz[index] to the trigger the map crashes, so this is not the play i suppose?
 
Last edited:
Wizard Indexing is creating a new hash table each time a unit is created. This is almost certainly a mistake since there is a maximum of 255 hashtables per match and you lose reference to the last hash table each time. You probably want to create the hash table at map initialisation and reuse it every time a unit is created by assigning it to a global variable and referencing that global variable.
 
1772399643615.png
1772399627431.png


An update: its working, now all wizards will fire theyre missile.

That is, if the targetted unit dies while another wizard missle is mid air, the missle will bug and stay still, therefor also adding a permanent +1 to wizardindex so the wizardindex can never reach 0
OR
if multiple wizards hit at the same time, it looks like theyre charging times cant count down at the same time? because they stack up and then fire 1 by one...

Now the goal is for the missle to still fire even if the original target has died while the missle was being charged/fired...
A hard trigger, and i am gratefull for everyone helping me
 
Last edited:
I would import a Missile system and save yourself a massive headache whenever you want to make a spell like this.

Dummy units as Missiles are basically obsolete now.
 
I would import a Missile system and save yourself a massive headache whenever you want to make a spell like this.

Dummy units as Missiles are basically obsolete now.
Thank you!
But in the meantime i managed to make my trigger work perfectly fine without buggs!
 
Back
Top