• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

hero picking system problem

Status
Not open for further replies.
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)
 
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)
 
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:
 
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
 
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
 
Status
Not open for further replies.
Back
Top