1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Spawning trigger assistance

Discussion in 'World Editor Help Zone' started by Marcell, Jan 29, 2018.

  1. millzy

    millzy

    Joined:
    Jul 9, 2008
    Messages:
    1,540
    Resources:
    6
    Maps:
    5
    Spells:
    1
    Resources:
    6
    Add a unit group Varable and check how manny units are in it before creating the units

    • Redeem trigger
      • Events
        • Time - Every 4.00 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in RedeemGroup and do (Actions)
          • Loop - Actions
            • Player Group - Pick every player in (All players) and do (Actions)
              • Loop - Actions
                • Set Count[(Player number of (Picked player))] = 0
            • Set Loc = (Position of (Picked unit))
            • Set Group = (Units within 300.00 of Loc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A ground unit) Equal to True)))
            • Custom script: call RemoveLocation(udg_Loc)
            • Unit Group - Remove (Picked unit) from Group
            • Custom script: set bj_wantDestroyGroup = true
            • Unit Group - Pick every unit in Group and do (Actions)
              • Loop - Actions
                • Set Index = (Player number of (Owner of (Picked unit)))
                • Set Count[Index] = Count[(Index + 1)]
            • Player Group - Pick every player in (All players) and do (Actions)
              • Loop - Actions
                • Set Index = (Player number of (Picked player))
                • Set CountGroup = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Picked player)) and ((Unit-type of (Matching unit)) Equal to Footman)))
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Count[Index] Greater than or equal to 2
                    • (Number of units in CountGroup) Greater than or equal to 20(How ever manny u want the limit)
                  • Then - Actions
                    • Set Loc = ((Picked player) start location)
                    • Unit - Create 1 Footman for (Picked player) at Loc facing Default building facing degrees
                    • Custom script: call RemoveLocation(udg_Loc)
                  • Else - Actions
                • Custom script: DestroyGroup(udg_CountGroup)
     
  2. Marcell

    Marcell

    Joined:
    Jan 17, 2018
    Messages:
    112
    Resources:
    0
    Resources:
    0
    Wow thanks, that was quick