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!
This system can use as make dialog to the "Host" .I cant find out any uses of this system already.
Here is the trigger.
[trigger=Detect Host System]Events
Player - Player 1 (Red) types a chat message containing -Host as An exact match
Player - Player 2 (Blue) types a chat message containing -Host as An exact match
Player - Player 3 (Teal) types a chat message containing -Host as An exact match
Player - Player 4 (Purple) types a chat message containing -Host as An exact match
Player - Player 5 (Yellow) types a chat message containing -Host as An exact match
Player - Player 6 (Orange) types a chat message containing -Host as An exact match
Player - Player 7 (Green) types a chat message containing -Host as An exact match
Player - Player 8 (Pink) types a chat message containing -Host as An exact match
Player - Player 9 (Gray) types a chat message containing -Host as An exact match
Player - Player 10 (Light Blue) types a chat message containing -Host as An exact match
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 1 (Red) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 3 (Teal) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 4 (Purple) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 5 (Yellow) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 6 (Orange) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 7 (Green) slot status) Not equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 8 (Pink) slot status) Not equal to Is playing
Then - Actions
Set Host = Player 9 (Gray)
Else - Actions
Set Host = Player 8 (Pink)
Else - Actions
Set Host = Player 7 (Green)
Else - Actions
Set Host = Player 6 (Orange)
Else - Actions
Set Host = Player 5 (Yellow)
Else - Actions
Set Host = Player 4 (Purple)
Else - Actions
Set Host = Player 3 (Teal)
Else - Actions
Set Host = Player 2 (Blue)
Else - Actions
Set Host = Player 1 (Red)
Game - Display to (All players) the text: Detecting.
Wait 0.50 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: Detecting..
Wait 0.50 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: Detecting...
Wait 0.50 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: Detecting.
Wait 0.50 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: Detecting..
Wait 0.50 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: Detecting...
Wait 1.00 seconds
Cinematic - Clear the screen of text messages for (All players)
Game - Display to (All players) the text: (Host Detected : + (Name of Host))
[/trigger]
[jass=Jass]function Trig_Detect_Host_Func001Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(7)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(6)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(5)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(4)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(3)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(2)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(1)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) != PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Detect_Host_Actions takes nothing returns nothing
if ( Trig_Detect_Host_Func001C() ) then
if ( Trig_Detect_Host_Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001Func001Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001Func001Func001Func001Func001C() ) then
if ( Trig_Detect_Host_Func001Func001Func001Func001Func001Func001Func001Func001C() ) then
set udg_Host = Player(8)
else
set udg_Host = Player(7)
endif
else
set udg_Host = Player(6)
endif
else
set udg_Host = Player(5)
endif
else
set udg_Host = Player(4)
endif
else
set udg_Host = Player(3)
endif
else
set udg_Host = Player(2)
endif
else
set udg_Host = Player(1)
endif
else
set udg_Host = Player(0)
endif
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_003" )
call TriggerSleepAction( 0.50 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_004" )
call TriggerSleepAction( 0.50 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_005" )
call TriggerSleepAction( 0.50 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_007" )
call TriggerSleepAction( 0.50 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_008" )
call TriggerSleepAction( 0.50 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_009" )
call TriggerSleepAction( 1.00 )
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), ( "Host Detected : " + GetPlayerName(udg_Host) ) )
endfunction
No, you don't get it. Suppose that a player named "jean" hosts a game with a bot named "anybot", the player joins the game, some other players join too, and he starts the game. Obviously the bot isn't a player, just a means to host a game, so when you use this method to detect the host ANY player ("jean" or any other players) will be host (the player who is more synchronized).
My point still stands though. Bots still have one player that they consider the owner. Yes, using a bot means that detecting host should be done in some other way, but there are ways that bots can transfer information to the game.
You only check player slot status in a linear way. How can you define the host this way?
All these waits, clear screens, printing "detecting" are not needed at all.
Just converting a GUI trigger into custom text is also not needed and useless.
Edit: And you don't check for all players.^^
I don't understand how this is doing anything useful, rather I don't even know how it's supposed to even begin to achieve the advertised task as the others above have already said, also yeah GUI to JASS conversion, just not worth it, makes no difference.
Btw, a Player Group loop can eliminate the need for any If statement.
Why do you need the "Detecting" cinematic? It just wastes time.
-----
Here's how to improve it (something like this).
AddEvents
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Trigger - Add to DetectHost <gen> the event (Player - (Picked player) types a chat message containing -host as An exact match)
DetectHost
Events
Conditions
Actions
Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
Loop - Actions
Game - Display to (All players) the text: (Host detected: + (Name of (Picked player)))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.