hero picking system problem

Level 5
Joined
Sep 27, 2011
Messages
141
i have a problem with my hero picking systemthe problem being that either the hero pick controller (Hero Pick) is not created for any player except player 1 or that it is just not added to their selection can anyone see the problem in my coding?

  • Actions
    • Set Human_Players = (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)))
    • Player Group - Pick every player in Human_Players and do (Actions)
      • Loop - Actions
        • Set Player_Number = (Player number of (Picked player))
        • Set Hero_Pick_Number[Player_Number] = 1
        • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across hero pick region <gen>
        • Set Hero_Picking_Locs = (Random point in hero pick controllers <gen>)
        • Unit - Create 1 Hero pick for (Picked player) at Hero_Picking_Locs facing Default building facing degrees
        • Unit - Pause (Last created unit)
        • Set Hero_Pick_Controller[Player_Number] = (Last created unit)
        • Unit - Add a 45.00 second Generic expiration timer to (Last created unit)
        • Selection - Add Hero_Pick_Controller[Player_Number] to selection for (Picked player)
        • Player Group - Add (Picked player) to Picking_Players
        • Custom script: call RemoveLocation(udg_Hero_Picking_Locs)
        • Custom script: call CameraSetupApplyForPlayer( true, udg_Camera[udg_Hero_Pick_Number[udg_Player_Number]], GetEnumPlayer(), 0 )
    • Custom script: call DestroyForce(udg_Human_Players)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Try to use General Temporal Variables for instant triggers like this one. Also, reduce the amount of parentheses as much as you can using variables.

It's also a bit hard to help because I can't really know what you want. I can't guess the logic of your system. Whats the event?, What are the conditions? What are these variables used for? Why "Set Hero_Pick_Number[TempInteger] = 1" and not another number? etc.

  • Actions
    • Set TempForce = (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)))
    • Player Group - Pick every player in TempForce and do (Actions)
      • Loop - Actions
        • Set TempPlayer = (Picked Player)
        • Set TempInteger = (Player number of p)
        • Set Hero_Pick_Number[TempInteger] = 1
        • Visibility - Create an initially Enabled visibility modifier for TempPlayer emitting Visibility across hero pick region <gen>
        • Set TempPoint = (Random point in hero pick controllers <gen>)
        • Unit - Create 1 Hero Pick for TempPlayer at TempPoint facing Default building facing degrees
        • Set Hero_Pick_Controller[TempInteger] = (Last created unit)
        • Unit - Pause Hero_Pick_Controller[TempInteger]
        • Unit - Add a 45.00 second Generic expiration timer to Hero_Pick_Controller[TempInteger]
        • Selection - Add Hero_Pick_Controller[TempInteger] to selection for TempPlayer
        • Player Group - Add TempPlayer to Picking_Players
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call CameraSetupApplyForPlayer( true, udg_Camera[udg_Hero_Pick_Number[udg_TempInteger]], udg_TempPlayer, 0 )
    • Custom script: call DestroyForce(udg_TempForce)
 
Level 5
Joined
Sep 27, 2011
Messages
141
sorry about that event is elapsed game time is 0.1 seconds there are no conditions as it is a setup iind of trigger Set Hero_Pick_Number[TempInteger] = 1 this does not particurarly matter for the question as this is only for the hero picking camera i just wanted to know why the Hero_Pick_Contoller is only created or slected for player 1 don't know which or how to fix it and that is why i asked. thanks:xxd:
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's probably because the other players don't match the trigger conditions(Arent Playing, or aren't users) I can't see any other reason
 
Level 3
Joined
May 12, 2012
Messages
59
i dont know if it will help but have you tried adjusting the variable from = 1 to the value plus one? thats the only thing i can see as to why only player one would be allowed to pick a hero because every player is equal to one no matter what
 
Top