[Trigger] spawn limitation

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2007
Messages
154
im using that kind of spawning system:
  • Events
    • Time - Every 60.00 seconds of game time
  • Actions
    • Unit - Create 6 Kid of Corn for Neutral - enemy at (Random point in Corn 3 <gen>) facing default building orientation degrees
Can i limit spawning by stoping trigger if there is more than 20 Kids of corn in region corn 3 ?
 
Last edited:
Level 19
Joined
Aug 24, 2007
Messages
2,888
in conditions
integer compression
if Number of units in region type of child is lesser than 20
 
  • Events
    • Time - Every 60.00 seconds of game time
  • Actions
    • Unit - Create 6 Kid of Corn for Neutral - enemy at (Random point in Corn 3 <gen>) facing default building orientation degrees
  • Max units
    • Events
    • Conditions
      • (Number of units in (Units of type Your unit)) Greater than or equal to 20
    • Actions
      • Trigger - Turn off (your spawning trigger)
  • Max units start
    • Events
    • Conditions
      • (Number of units in (Units of type Your unit)) less than 20
    • Actions
      • Trigger - Turn on (your spawning trigger)
you make 3 triggers:
-your spawning
-turn off
-turn on

Condition is Integer comparison.
And i make you Greater than or equal because i see that you make 6 units, so if those units stay alive for 4 min there would be 24 units and trigger would get turned off.(get it?)( so i think :p)

HF -BR-

EDITED
 
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
There is a better way then making two triggers for it. Just use the if then else function to make an efficient limit.
  • Events
  • Time - Every 60.00 seconds of game time
  • Actions
//Put the if then else function here!
//IF!!
  • (Number of units in (Units of type Your unit)) Greater than or equal to 20
//Then!!
  • Trigger - Turn off (your spawning trigger)
//Else!!
  • Unit - Create 6 Kid of Corn for Neutral - enemy at (Random point in Corn 3 <gen>) facing default building orientation degrees
 
Level 4
Joined
Sep 9, 2004
Messages
112
There is a better way then making two triggers for it. Just use the if then else function to make an efficient limit.
  • Events
  • Time - Every 60.00 seconds of game time
  • Actions
//Put the if then else function here!
//IF!!
  • (Number of units in (Units of type Your unit)) Greater than or equal to 20
//Then!!
  • Trigger - Turn off (your spawning trigger)
//Else!!
  • Unit - Create 6 Kid of Corn for Neutral - enemy at (Random point in Corn 3 <gen>) facing default building orientation degrees

Actually, you wouldn't want to Turn Off the trigger, because that would stop spawning all together. I'm pretty shure he doesn't want to stop it all together.. just limit the max amount of units. So the action "Do Nothing" would be far more effective.
 
Status
Not open for further replies.
Top