variables

hio77

New Member
Reaction score
1
is there a way to set a variable at the start of the game that has all the in game non computer players
i need it for a trigger
example
Code:
spawn Copy 12
    Events
        Unit - A unit enters healer <gen>
    Conditions
        (((Triggering unit) is selected by variable)) Equal to True) and (((Triggering unit) is A ground unit) Equal to True)
    Actions
        Unit - Create 1 Mountain King for ([B]a gess[/B] (player triggering) at (Center of Heros enter here <gen>) facing Default building facing degrees
        Unit - Kill (Triggering unit)

thanks all
 

NullCurrent

( ゚ε ゚)
Reaction score
110
That should do it. (test it though, i didnt have time, or any idea how to =P )

EDIT: I forgot, make the "CompPlayers" a player group variable.

Code:
Player Variable
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Set CompPlayers = (All players matching ((((Picked player) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)))
 

hio77

New Member
Reaction score
1
EDIT: added varables image

my trigger cant see the varible

trigger
Code:
spawn Copy 12
    Events
        Unit - A unit enters healer <gen>
    Conditions
        (((Triggering unit) is selected by Player 1 (Red)) Equal to True) and (((Triggering unit) is A ground unit) Equal to True)
    Actions
        Unit - Create 1 healer for Player 1 (Red) at (Center of Heros enter here <gen>) facing Default building facing degrees
        Unit - Kill (Triggering unit)


and the variable setting
Code:
Events
    Map initialization
Conditions

Actions
  [B][U]Triggers removed but arnt part of the setting[/U][/B]
    Player Group - Pick every player in (All players) and do (Actions)
        Loop - Actions
            Set CompPlayers = (All players matching ((((Picked player) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)))

and the variable i made
compplayer.jpg
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Event:
- Map init
Conditions:
Actions:
- Set CompPlayers = (All players matching ((((Matching player) controller) Equal to Computer) and (((Matching player) slot status) Equal to Is playing)))
 

Romek

Super Moderator
Reaction score
964
Code:
spawn Copy 12
    Events
        Unit - A unit enters healer <gen>
    Conditions
        (((Triggering unit) is selected by Player 1 (Red)) Equal to True) and (((Triggering unit) is A ground unit) Equal to True)
    Actions
        Unit - Create 1 healer for Player 1 (Red) at (Center of Heros enter here <gen>) facing Default building facing degrees
        Unit - Kill (Triggering unit)
That uses a "player" variable not a playergroup.

Code:
spawn Copy 12
    Events
        Unit - A unit enters healer <gen>
    Conditions
        (((Triggering unit) is selected by Player 1 (Red)) Equal to True) and (((Triggering unit) is A ground unit) Equal to True)
    Actions
         PlayerGroup - Pick every player in CompPlayers and do actions:
               Loop Actions:
               Unit - Create 1 healer for (Picked Player) at (Center of Heros enter here <gen>) facing Default building facing degrees
         Unit - Kill (Triggering unit)

Use that instead, I edited it without WE, but it should be right anyway.
 
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