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

Need help with Summoned unit limit

Status
Not open for further replies.
Level 2
Joined
Dec 16, 2004
Messages
3
I'm creating a custom spell based on the standard spell black arrow. If the spell is successful, one summon spawns, and the spawn is permanent (untimed). I want to limit the number of spawns that can be in the game at any time to 4. I have not been able to find a way to trigger it properly to make it work. Can someone help me out? It should be simple but I can't seem to get it to work.
 
Level 2
Joined
Dec 16, 2004
Messages
3
it has to be based on black arrow.

The skill is a combination nuke/summoning spell, so it must both do damage and create units. That constraint effectively eliminates carrion beetles, water elemental, feral spirit, etc.

Surely theres a way to trigger this. I refuse to beleive its not possible. I just don't have the expertise to do it yet, which is why I need you guys to help me out.

I'm sure someone who is really good at this kinda thing could whip something out in 10 minutes or less. I've been working on it for days and haven't been able to get it to work.
 
Level 2
Joined
Dec 16, 2004
Messages
3
if you are talking about making the summons permanent, then yes, I have already done that.

The part I am struggling with is the summoned unit cap. I need something that accomplishes the following, but I can't seem to translate it into triggers and make it work.

Unit begins casting an Ability
Ability is equal to Name
If
units of unit-type equal to UnitName = 4 (value)
Then
remove last-created unit from the game
else
do nothing

Basically, what this is supposed to be doing is checking whether there are already four units of the summoned unit-type in the game, and if so, summoning a fifth and killing it, effectively capping the total summons at four until one dies.

Unfortunately, I haven't figured out how to translate that simple idea into a trigger that works.
 
Level 2
Joined
Aug 9, 2004
Messages
11
The way I'm thinking right now (unless it has to be multi instanceable) is have an integer to keep track of the units you kill with this nuke.

Wheenver you make a unit with this spell, add 1.
Whenever one of your summons dies, take away 1.

I'm just not sure if black arrow counts as you spawning a unit, if it does, easy.

A unit spawns a unit

Cond.

Summoning unit = Your hero
Summoned unit = skelly

actions

if/then/else multiple
if spawncount (integer) >= 4
then
remove summoned unit
else
set spawncount = spawncount + 1
Unit - replace summoned unit with MyNewCoolUnit


and

A unit dies

type of dying unit = MyNewCoolUnit

set spawncount = spawncount - 1
 
Level 4
Joined
Sep 21, 2004
Messages
110
Event:A Unit is Spawned
Conditions:Triggering unit=(Your Summon)
Actions:pick all units of type (Your Summons) and add them to Unit_Group(unit group var)
If Number of Units in Unit_Group is greater then 4, then remove random unit in Unit_Group matching
Matching Unit is not equal to Triggering Unit

Works like carrion beetles
 
Level 6
Joined
Mar 11, 2018
Messages
134
Err... how about something based off carrion beetles?
Dude I could bloody kiss you. You solved the main problem I have had. The ability to have at least 2 types of units I could summon and there is a max amount. This not only solves my hero summon problem but it simplifies my enemy respawn to. You literally fixed 5 of my problems reminding me of that spell.
 
Status
Not open for further replies.
Top