//TESH.scrollpos=-1
//TESH.alwaysfold=0
function GameCache takes nothing returns gamecache
if udg_cache == null then
set udg_cache = InitGameCache("gethost")
endif
return udg_cache
endfunction
function GetHostId takes nothing returns integer
//This stores the Id + 1 for each player.
call StoreInteger(GameCache(), "missionKey", "key", GetPlayerId(GetLocalPlayer()) + 1)
//Setup the TriggerSyncReady call.
call TriggerSyncStart()
//Sync the value of the entry for each player.
//Each value will sync to the value of the host.
call SyncStoredInteger(GameCache(), "missionKey", "key")
//Wait until the Game Cache syncs the key for everyone.
call TriggerSyncReady()
//Return the synced value as a id.
return GetStoredInteger(GameCache(), "missionKey", "key") - 1
endfunction
function GetHostAverage takes nothing returns nothing
local integer array id
local integer max = 0
local integer t = 0
local integer i = 0
set udg_Host = null
loop
exitwhen i > 11
set id[i] = 0
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
set t = GetHostId()
set id[t] = id[t] + 1
if id[t] > id[max] then
set max = t
endif
set i = i + 1
call TriggerSleepAction(1)
endloop
set udg_Host = Player(max)
endfunction
Name | Type | is_array | initial_value |
amountbuttonplanet | button | Yes | |
amountbuttonstar | button | Yes | |
antienter | dialog | No | |
antienterbutton | button | No | |
boardminutes | integer | No | |
boardseconds | integer | No | |
booleanleadershow | boolean | No | true |
buttonplanetamountholder | dialog | No | |
buttonstaramountholder | dialog | No | |
cache | gamecache | No | |
chuck | player | No | |
cmb | multiboard | No | |
farvalue | real | Yes | |
FleetCommand | unit | Yes | UnitNull |
GCDECODE | integer | No | |
GCDECODE_MAX | integer | No | |
Host | player | No | PlayerNP |
HostIs | quest | No | |
leaderboard | leaderboard | Yes | |
Planet | unit | Yes | |
planetsamount | integer | No | |
playercolor | string | Yes | |
playeridentification | string | Yes | ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp |
playertip | boolean | Yes | true |
playerunitcolor | dialog | No | |
playerunitcolorbutton | button | Yes | |
PlayFieldSize | dialog | No | |
PlayFieldSizeAmount | button | Yes | |
randomintergetcouple | integer | No | |
RandomNumber12 | integer | No | 0 |
RandomStartLocation | rect | Yes | |
RandomStartLocationSetup | integer | No | |
seconds30 | integer | No | 30 |
starsamount | integer | No | |
startpoint | rect | No | RectNull |
startpointhold | location | No | |
stringcmb | string | Yes | |
stringcmbp | string | Yes | |
stringcmbpt | string | Yes | ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp |
Sun | unit | Yes | |
Tip | string | Yes | |
tipsswitch | boolean | Yes | true |
TipTag | string | Yes |