• 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.

created unit suicide on enemy

Level 4
Joined
Feb 28, 2025
Messages
27
Hello always me x)
How can I make that waves of created reinforcement allys unit immediately commit suicide on attacking enemy units?
Thank you very much
 
Level 4
Joined
Feb 28, 2025
Messages
27
they immediatly goes to attack the ennemie and they died into the battle ^^
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
In other words, you just want to Order a unit to attack somewhere.
  • Unit - Create 1 Footman...
  • Unit - Order (Last created unit) to Attack-Move To (Center of SomeRegion)
Orders are how you tell units to do things. You can Order them to do anything -> Cast a spell, pick-up an item, attack a unit, patrol to a point, etc.
Attack-Move in this case is the same as when you press A and click somewhere on the map/ground. Move to that Point and Attack anything on the way.

If you want to create multiple units at once then you can use a For Each Loop like this:
  • For each integer (X) from 1 to 20
    • Loop - Actions
      • Unit - Create 1 Footman...
      • Unit - Order (Last created unit) to Attack-Move To (Center of SomeRegion)
^ That will create 20 Footman and Order each one to attack towards the center of a Region.

Or take advantage of the Unit Group variable which lets you track multiple units at once and interact with all of them as though they were one unit:
  • Unit Group - Pick every unit in ReinforcementGroup and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Attack-Move To (Center of SomeRegion)
 
Last edited:
Level 4
Joined
Feb 28, 2025
Messages
27
Thank youuuuuuu and how did we add the created unit to a unit group? ^^"
And how can i do for they automaticaly use spells into the battle?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Thank youuuuuuu and how did we add the created unit to a unit group? ^^"
There's two ways.

#1) You can create a brand new Unit Group by setting the variable yourself:
  • Set Variable ReinforcementGroup = (Units in playable map area)
You can change (Units in playable map area) to one of many functions that help you find the units you want. Note that this won't remember any old units that you may have added to ReinforecmentGroup beforehand. This acts like a brand new group.

#2) You can manually Add units to the Unit Group allowing you to maintain it yourself throughout the game:
  • Unit - Create 1 Footman...
  • Unit Group - Add (Last created unit) to ReinforcementGroup
Dead units will remain in the Unit Group so you probably want to remove them:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Footman
  • Actions
    • Unit Group - Remove (Triggering unit) from ReinforcementGroup
 
Level 4
Joined
Feb 28, 2025
Messages
27
There's two ways.

#1) You can create a brand new Unit Group by setting the variable yourself:
  • Set Variable ReinforcementGroup = (Units in playable map area)
You can change (Units in playable map area) to one of many functions that help you find the units you want. Note that this won't remember any old units that you may have added to ReinforecmentGroup beforehand. This acts like a brand new group.

#2) You can manually Add units to the Unit Group allowing you to maintain it yourself throughout the game:
  • Unit - Create 1 Footman...
  • Unit Group - Add (Last created unit) to ReinforcementGroup
Dead units will remain in the Unit Group so you probably want to remove them:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Footman
  • Actions
    • Unit Group - Remove (Triggering unit) from ReinforcementGroup
Ok thanks :) . Another question how can i do for the unit don't use only the automatic's abilities?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
how can i do for the unit don't use only the automatic's abilities?
I'm not sure what you're asking to be honest.

If you're talking about unit's AI, abilities are hardcoded to have certain behavior.
 
Level 4
Joined
Feb 28, 2025
Messages
27
Pour être honnête, je ne suis pas sûr de ce que vous demandez.

Si vous parlez de l'IA de l'unité, les capacités sont codées en dur pour avoir un certain comportement.
Oh, sorry... Let me explain everything. I've created periodic waves of units on my map that fight other waves... But these units only use automatic spells and not all their abilities. How can I make them use their other abilities? Does i have to do a IA ? I yes what does it loke like?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
What is "suicide"? :goblin_boom:
This is from StarCraft II. The unit relentlessly seeks out hostile units to either kill or be killed. The strategic AI will make no attempt to save or recycle the units. Mostly used for periodic attack waves where the AI will be instructed to build or be spawned some number of units, and then be ordered to "suicide" them.

The term is likely derived from the behaviour that no attempt will be made to save the unit's life and that the AI will actively seek out foes for the unit until the unit is dead.

I wonder if Warcraft III AI had this behaviour for use in the campaign.
 
 
Top