• 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] Computer Setup

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

Why doesn't player controller check work? How is it misbehaving?
 
Well it works, but it also works for the rest of the players that are not in the game. (The slots are unused)
I also tryed: if player slot status not equal to is unused, and it adds the used computer slot to Leaderboard, but the rest of the trigger doesnt work, I think its because it ignores Player start location of the computer.

  • PlayersInit
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Not equal to Is unused
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Player((Integer A))) controller) Equal to Computer
                  • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Set NumberOfPlayers = (NumberOfPlayers + 1)
              • Set Point = ((Player((Integer A))) start location)
              • Unit - Create 1 Altar 2 for (Player((Integer A))) at Point facing Default building facing degrees
              • Set Altar2[(Integer A)] = (Last created unit)
              • Unit - Create 1 Altar for (Player((Integer A))) at Point facing Default building facing degrees
              • Set Altar[(Integer A)] = (Last created unit)
              • Camera - Apply Game Camera <gen> for (Player((Integer A))) over 0.00 seconds
              • Camera - Pan camera for (Player((Integer A))) to Point over 0.00 seconds
              • Custom script: call RemoveLocation(udg_Point)
              • Player - Turn Gives bounty On for (Player((Integer A)))
              • Player - Add StartingGold to (Player((Integer A))) Current gold
              • Player - Add 1 to (Player((Integer A))) Current lumber
              • Leaderboard - Add (Player((Integer A))) to GameLeaderboard with label (Name of (Player((Integer A)))) and value 0
              • Leaderboard - Change the display style for (Player((Integer A))) in GameLeaderboard to Show the label, Hide the value, and Hide the icon
              • Leaderboard - Change the display style for (Player((Integer A))) in GameLeaderboard to Show the label, Hide the value, and Hide the icon
              • Camera - Set the camera bounds for (Player((Integer A))) to Camera Bounds <gen>
              • Unit - Hide Altar2[(Integer A)]
              • Hero - Make (Player((Integer A))) Heroes gain 150.00% experience from future kills
            • Else - Actions
      • Set BuyTimeSeconds = BuyTimeStartSeconds
      • Trigger - Run Buy time Start <gen> (checking conditions)
      • Set BuyTimeSeconds = BuyTimeRepeatSeconds
      • Set DamageToTentReducer = (Real((12 / NumberOfPlayers)))
 

Deleted member 219079

D

Deleted member 219079

Looks good, have you created leaderboard before that trigger? Do you display it afterwards? It's not really clear how that doesn't work.

There's also:
  • (myPlayer slot status) Equal to Is playing
 

Deleted member 219079

D

Deleted member 219079

Then GUI is broken. My JASS script here works fine:
JASS:
function InitTrig_myTrigger takes nothing returns nothing
    local integer i = 0
    local player p
    local mapcontrol controller
    loop
        set p = Player(i)
        set controller = GetPlayerController(p)
        if (controller == MAP_CONTROL_USER or  controller == MAP_CONTROL_COMPUTER) and GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
            call BJDebugMsg(GetPlayerName(p)+" is playing")
        endif
        exitwhen(i==11)
        set i=i+1
    endloop
    set controller = null
    set p = null
endfunction
Even if you don't understand JASS, the logic part, if (controller == MAP_CONTROL_USER or controller == MAP_CONTROL_COMPUTER) and GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then, shows you that GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING works fine.
 
Status
Not open for further replies.
Top