Trigger for spawning

Drazalon

New Member
Reaction score
3
Ok i have a trigger that will spawn the certain unit, certain amount at a certain region. In this case red's spawn region... Heres the trigger

Code:
If ((Player 1 (Red) slot status) Equal to Is playing) then do (Unit - Create 1 EnemyType[Pointer] for Player 12 (Brown) at (Center of Monster Spawn Top Left2 <gen>) facing (Position of (Triggering unit))) else do (Do nothing)

it worked without the condition but that will make it spawn at all areas eve if the player isnt even playing! I want to make it so that the unit will spawn ONLY when the player slot is in playing. But when i use this with the If/Then/Else it dosnt work. Can someone recode my trigger so that it spawn only when the player slot is playing?

+REP (for helping w/ trigger and if it works)
 
Reaction score
65
You could change: (Player 1 (Red) slot status) Not Equal to Has Left The Game). Not sure if that would help tought. Oh, and to the end part, there is no "triggering unit".
 

Drazalon

New Member
Reaction score
3
hmmm ok lemme go check... hmmm i dont think its working. It dosnt respawn
i just spawns the first level and never spawns again
 
P

phatal

Guest
Maybe you could have 1 trigger that checks to see when a player leaves. When that player leaves have him removed from All Players. Then in your spawning trigger use a Player Group and instead of using ((Player 1 (Red) slot status) Equal to Is playing) use the player group and Picked Player. Something like this below.

Trigger 1:
Code:
CheckSlots
    Events
        Player - Player 1 (Red) leaves the game
        Player - Player 2 (Blue) leaves the game
        Player - Player 3 (Teal) leaves the game
        Player - Player 4 (Purple) leaves the game
        Player - Player 5 (Yellow) leaves the game
        Player - Player 6 (Orange) leaves the game
        Player - Player 7 (Green) leaves the game
        Player - Player 8 (Pink) leaves the game
    Conditions
    Actions
        Leaderboard - Change the label for (Triggering player) in (Last created leaderboard) to <Left Game>
        Player Group - Remove (Triggering player) from (All players)
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Kill (Picked unit))

This is my spawn trigger, but yours doesnt have to be as elaborate.
Code:
spawna
    Events
        Time - Every 2.50 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set unitcount[(Player number of (Picked player))] = 0
                Custom script:   set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                    Loop - Actions
                        If ((((Picked unit) is A structure) Equal to False) and (((Picked unit) is A Hero) Equal to False)) then do (Set unitcount[(Player number of (Picked player))] = (unitcount[(Player number of (Picked player))] + 1)) else do (Do nothing)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        unitcount[(Player number of (Picked player))] Less than population[(Player number of (Picked player))]
                    Then - Actions
                        Set L = (Center of spawn1[(Player number of (Picked player))])
                        Unit - Create 1 Units[(Player number of (Picked player))] for (Picked player) at L facing 270.00 degrees
                        Custom script:   call RemoveLocation(udg_L)
                        Set L = (Center of spawn3[(Player number of (Picked player))])
                        Unit - Order (Last created unit) to Move To L
                        Custom script:   call RemoveLocation(udg_L)
                    Else - Actions
        Trigger - Turn on spawnb <gen>
        Trigger - Turn off (This trigger)
 
G

Goauld

Guest
Those custom scripts are just for patching up memory leaks. I don't think they are required in a RoC map. :rolleyes:
 

Drazalon

New Member
Reaction score
3
can u convert that to JASS plz? for RoC there is no Event when a player leaves the game.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top