• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit enters region= spawn units in region help

Status
Not open for further replies.
Level 2
Joined
Aug 25, 2015
Messages
7
Howdy! I need some assistance with a trigger porfavor!

The trigger is meant to spawn units in the center of a region every 3 seconds of the game until a unit leaves the region, which then turns it off.
SO. This is what I have:

Trigger: wasps1
Events
Unit - A unit enters wasps <gen>

Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
(Owner of (Triggering unit)) Equal to Player 2 (Blue)

Actions
Trigger - Turn on wasps2 <gen>

Trigger: wasps2 (initially off)
Events
Time - Every 3.00 seconds of game time

Actions
Unit - Create 1 Wasp for Player 12 (Brown) at (Center of wasps <gen>) facing Default building facing degrees

Trigger: wasps3
Events
Unit - A unit leaves wasps <gen>

Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
(Owner of (Triggering unit)) Equal to Player 2 (Blue)

Actions
Trigger - Turn off wasps2 <gen>


Those are the triggers I'm using but no wasps are spawned! Any help would be very much appreciated, thanks! :ogre_haosis:
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Setup your conditions like this. With your setup, you need BOTH conditions to be true before the actions can be ran, which is obviously impossible because two players can't have ownership over one unit.

  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
However, if I may make a suggestion... you should just add players that can trigger this to a Player Group on map init and then just check if the triggering player is in said group :)
 
Level 2
Joined
Jan 2, 2013
Messages
24
Do you want wasps to be spawn as long as there is at least a unit inside the region?
Coz with this code, if a unit leaves the region, the spawing stops even if there are other units inside, and will resume only if a unit enters again.. Is it intentional?
 
Level 2
Joined
Aug 25, 2015
Messages
7
Thank you IcemanBo! I couldn't figure out how to do that and I didn't want to look it up because i needed this question posted ASAP!

And superkar, there are only 2 hero units on the map so a continuous spawn is just fine, thanks though!
 
Status
Not open for further replies.
Top