Problems with a very simple trigger

I

Initeor

Guest
Hi guys!

I've been trying to figure this out, but I'm really stuck.

Basically I want 1 unit of the costum unit-type "Redead" to appear in the "Graveyard" region every 15 seconds (with a special effect when it spawns, but that's unrelevant).

The problem is; I want the unit to spawn ONLY when there is less than 3 units of the same unit-type ("Redead") in the region ("Graveyard").

I thought you guys maybe could help me out a bit. :)

Code:
EVENT
Every 15.00 seconds of game time

CONDITIONS

ACTIONS
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
 - If - Conditions
      - (Numbers of units in (Units in Graveyard <gen>)) Greater than 3
 - Then - Actions
        - Do nothing
 - Else - Actions
        - Unit - Create 1 redead for Neutral Hostile at (Random point in Graveyard <gen>) facing Deafult building degrees

Would appriciate some help, thank you! :)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Event:
- Time - Every 15 seconds
Conditions:
- (Number of units in (myUnitGroupVariable)) less than 3
Actions:
- Set Point = Random point in <region>
- Unit - Create 1 <...> for <someone> at Point facing Default
- Unit group - Add (Last created unit) to myUnitGroupVariable
- Custom script: call RemoveLocation( udg_Point )
- Special effect - Create a special effect at the "origin" of (Last created unit) using <some model>
- Special effect - Destroy (Last created special effect)

Event:
- A unit dies
Conditions:
- ((Triggering unit) is in myUnitGroupVariable) equal to true
Actions:
- Unit group - Remove (Triggering unit) from myUnitGroupVariable
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top