GUI issue

Status
Not open for further replies.
Level 9
Joined
Feb 20, 2014
Messages
409
Hi, in my Angel Arena map, you can select the option that gives all players a random hero.
(it runs this trigger)
It works fine but only with players, not for computers...
How to make it works for computers too?

  • Actions
    • Set Player_Temp_Integer = (Random integer number between 1 and Player_MaxHeroes)
    • Set Global_HasPlayerChosenHero[(Player number of Player_Chooser)] = True
    • Set Player_Temp_Position = (Random point in Hero Start Spawn <gen>)
    • Unit - Create 1 Tavern_Heroes[Player_Temp_Integer] for Player_Chooser at Player_Temp_Position facing Map_Center_StartPoint
    • Camera - Pan camera for Player_Chooser to Player_Temp_Position over 0.00 seconds
    • Custom script: call RemoveLocation(udg_Player_Temp_Position)
    • Game - Display to (All players) the text: (((Name of Player_Chooser) + has randomed ) + (Name of (Last created unit)))
    • Set PlayerHero[(Player number of Player_Chooser)] = (Last created unit)
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
    • Set Player_MaxHeroes = (Player_MaxHeroes - 1)
    • Selection - Clear selection for Player_Chooser
    • Selection - Add (Last created unit) to selection for Player_Chooser
    • Set Tavern_Heroes[Player_Temp_Integer] = Tavern_Heroes[Player_MaxHeroes]
    • Set Player_MaxHeroes = (Player_MaxHeroes - 1)
 
Level 15
Joined
Feb 7, 2020
Messages
398
edit: also, how/where is Player_Chooser being set?
  • Set Global_HasPlayerChosenHero[(Player number of Player_Chooser)] = True
Are you filling empty player slots with computers and/or are they set up in player settings to be computers?

You may have to do something like this:
  • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to Computer) or (((Matching player) controller) Equal to None)).) and do (Actions)
    • Loop - Actions
 
Level 9
Joined
Feb 20, 2014
Messages
409
edit: also, how/where is Player_Chooser being set?
  • Set Global_HasPlayerChosenHero[(Player number of Player_Chooser)] = True
Are you filling empty player slots with computers and/or are they set up in player settings to be computers?

You may have to do something like this:
  • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to Computer) or (((Matching player) controller) Equal to None)).) and do (Actions)
    • Loop - Actions

ALL slots are set to players (12)

And player chooser is set here :

  • Actions
    • Set GameModeSetup_IsChosen = True
    • Set GameMode = GameMode_AllRandom
    • Set GameModeSetup_PlayerGroup = (All players matching (((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)) and (Global_HasPlayerChosenHero[(Player number of (Matching player))] Equal to False)))
    • Player Group - Pick every player in GameModeSetup_PlayerGroup and do (Actions)
      • Loop - Actions
        • Set Player_Chooser = (Picked player)
        • Trigger - Run Random Hero <gen> (checking conditions)
    • Wait 0.10 seconds
    • Player Group - Pick every player in (All players) and do (Camera - Set (Picked player)'s camera Distance to target to 3000.00 over 1.00 seconds)
    • Custom script: call DestroyForce(udg_GameModeSetup_PlayerGroup)
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top