Hero Selection Trigger Problem

BobDolee

New Member
Reaction score
0
Ok so I have a trigger that creates a hero selector(wisp) when you type -new. However, I dont know how to make it so once you get your hero you can not spawn another hero selector.

Heres the trigger I have so far:
Trigger:
  • Summon Hero Selector
    • Events
      • Player - Player 1 (Red) types a chat message containing -new as An exact match
      • Player - Player 2 (Blue) types a chat message containing -new as An exact match
      • Player - Player 3 (Teal) types a chat message containing -new as An exact match
      • Player - Player 4 (Purple) types a chat message containing -new as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -new as An exact match
      • Player - Player 6 (Orange) types a chat message containing -new as An exact match
      • Player - Player 7 (Green) types a chat message containing -new as An exact match
      • Player - Player 8 (Pink) types a chat message containing -new as An exact match
      • Player - Player 9 (Gray) types a chat message containing -new as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 Hero Selector for Player 1 (Red) at (Center of Start <gen>) facing Default building facing degrees




I really wish I could make a trigger that would detect if a player joined the game and then spawn a hero selector for them if they joined. But I dont know how to do that.

Thanks.
 

elmstfreddie

The Finglonger
Reaction score
203
Map init

for every integer a from 1-12 do actions
if player[integer a] is controlled by a human/user (whatever that condition is haha, controlller comparison)
then create 1 wisp for player[integer a]
else do nadda.

Player[integer a] is this function that's called convert player index to player, basically it says "gimme a number I give you a playaaa"
 

BobDolee

New Member
Reaction score
0
Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Use melee time of day (for all players)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If ((Player 1 (Red) controller) Equal to User) then do (Unit - Create 1 Hero Selector for Player[1] at (Center of Start <gen>) facing Default building facing degrees) else do (Do nothing)



I dont understand the whole interger A thing.
 

BobDolee

New Member
Reaction score
0
I changed it to this but now I get a fatal error while loading

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
      • ((Player((Integer A))) controller) Equal to User
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (((Player((Integer A))) controller) Equal to User) then do (Unit - Create 1 Hero Selector for (Player((Integer A))) at (Center of Start <gen>) facing Default building facing degrees) else do (Do nothing)
 

BobDolee

New Member
Reaction score
0
I changed it to this but now I get a fatal error while loading

Trigger:
  • Initialization
    • Events
      • Map initialization
    • Conditions
      • ((Player((Integer A))) controller) Equal to User
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (((Player((Integer A))) controller) Equal to User) then do (Unit - Create 1 Hero Selector for (Player((Integer A))) at (Center of Start <gen>) facing Default building facing degrees) else do (Do nothing)

I believe the error is in the Condition since I can take that out and get the game to load, but it doesnt work right.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
There is no Player (Integer A)

You need to remove that condition and then, inside the loop, create an "If" with the same condition in there, then the Integer A will work ;)

EDIT: Oh, sorry ... didn't see you had dona that XD
then just remove the condition, since you are already using that same condition in the "If"

EDIT2: And, dont triple post for gods sake !!!!!
 
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