- Joined
- Nov 1, 2006
- Messages
- 54
Hi, im trying to improve my host detection method right now, this is what ive got so far:
function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger(g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart()
call SyncStoredInteger(g, "Map", "Host" )
call TriggerSyncReady()
set udg_Host = Player( GetStoredInteger(g, "Map", "Host" )-1)
call FlushGameCache(g )
set g = null
endfunction
Its working fine right now yes, but sometimes, more than less, it messes up and chooses another player who is not really the host to choose the game modes, anyway to fix this/refine this host detection process? (I'll add that I run this right at map initilization) Thanks, also, im wondering if there is a way to prevent the game from choosing two hosts when the real "host" of the game is in an observer/referee spot and it chooses the "real" host of the game and another player actually playing as the host as well, then both players (the real host observing, and the player who is not the actual host) get to pick the game modes and it causes chaos. Is there a way to make it so the real "host" in the observer/referee spot would be the only one picking the modes? Thanks again.
function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger(g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart()
call SyncStoredInteger(g, "Map", "Host" )
call TriggerSyncReady()
set udg_Host = Player( GetStoredInteger(g, "Map", "Host" )-1)
call FlushGameCache(g )
set g = null
endfunction
Its working fine right now yes, but sometimes, more than less, it messes up and chooses another player who is not really the host to choose the game modes, anyway to fix this/refine this host detection process? (I'll add that I run this right at map initilization) Thanks, also, im wondering if there is a way to prevent the game from choosing two hosts when the real "host" of the game is in an observer/referee spot and it chooses the "real" host of the game and another player actually playing as the host as well, then both players (the real host observing, and the player who is not the actual host) get to pick the game modes and it causes chaos. Is there a way to make it so the real "host" in the observer/referee spot would be the only one picking the modes? Thanks again.