• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Summoning unit for players in game

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
Hi,

I tried to do a trigger for summoning one unit if the player is in game 0.01 second after map initialisation and i failed ...again...and again...i guess it needs integer from 1 to 10 but how to do it properly...

here's my trigger :

  • Summoning builders
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Set PlayersAtStart = (All players controlled by a User)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Matching player) controller) Equal to User
            • Then - Actions
              • Unit - Create 1 Builder for (Player((Integer A))) at ((Matching player) start location) facing Orientation building with default degrees
            • Else - Actions
I converted all player to player index but somehow something is still wrong...
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
there is no Matching player. Replace Matching player with Player((Integer A)). Replace it in the condition and in the unit create action.
set bj_wantDestroyGroup = true only works for unit groups not for player groups.
Use
  • Custom script: call DestroyForce(udg_PLayersAtStart)
at the end of the loop.
 
Level 6
Joined
Sep 24, 2015
Messages
174
I found a solution myself before you post Jampion ! I'm proud ahha

Here's the solution (I hope it's working for other players):

  • Summoning builders
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Player group - Pick every player in (Player group((Player((Integer A))))) and do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Builder for (Player((Integer A))) at ((Matching player) start location) facing Orientation building with default degrees
            • Else - Actions
 
Level 6
Joined
Sep 24, 2015
Messages
174
oh thank you i removed that player groupe and changed matching to integer A :)

Edit: why is it creating one unit for all the players when i test the map?

i set forces like this :
force 1:
player1 to 10 = user

force 2:
player 11 and 12=user

edit: it's okay i found the problem had to change player controller to player statut = play
 
Last edited:
Status
Not open for further replies.
Top