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

how to create a limit on units?

Status
Not open for further replies.
Level 2
Joined
Feb 27, 2014
Messages
18
So, i've made a hero enter a region and then there will be another hero spawning.
but i wont have it so there can be more spawning and the trigger cant stop either.
anyone knows a good way to deal with this?
 
Level 2
Joined
Feb 27, 2014
Messages
18
ehm no. sorry for not being clear. i have my main character (lets call him poul)
When poul enters a region his beautiful wife shows infront of him.
But WAIT! Poul enters the region AGAIN! Another wife appears!
Pouls first wife is angry at him, so is the second?

i hope my little story made it a little clearer :)
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
ehm no. sorry for not being clear. i have my main character (lets call him poul)
When poul enters a region his beautiful wife shows infront of him.
But WAIT! Poul enters the region AGAIN! Another wife appears!
Pouls first wife is angry at him, so is the second?

hehe..
If he shall have only one wife, how about you turn the trigger off when the first wife is spawned?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
other might want to have a wife too...

Oh, so theres more than one Paul..
You could create a UnitGroup which contains all Pauls and when one of them enters the area check if he is in the group, if yes spawn him a wife and then remove him from the Group.
If you dont know how to do this I can provide a testmap.
 
Level 29
Joined
Sep 26, 2009
Messages
2,600
I guess there's 1 poul per player? If so, you can use boolean variable.

Something like this:
  • Poul Meets Wife
    • Events
      • Unit - A unit enters Pouls wife spawn <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Poul
      • Poul_spawned_his_wife[(Player number of (Triggering player))] Equal to False
    • Actions
      • Unit - Create 1 Wife for Neutral Passive at (Center of Pouls wife spawn <gen>) facing Default building facing degrees
      • Set Poul_spawned_his_wife[(Player number of (Triggering player))] = True
Poul_spawned_his_wife is a boolean array with default value 'false'
 
Status
Not open for further replies.
Top