Quick question on call GetHost()

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
Just a question on the
JASS:
call GetHost()

function. How do I only have it detect for slots 1 and 11?
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
There is no such thing as a GetHost() function unless someone has made it.
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
Oh, well its in my map and it "gets" the person who loads first. Well, I guess I'm a little confused now >.>

Where would I find this function?
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
Well, its in there but I can't find it. I know it works in game (just trust me on this) but sometimes it gets the wrong person. I want to narrow the slots down to the first slot on each team. I'll try to find it, but how would I limit the function to only specific slots?

EDIT: Found it -- looks like this
JASS:
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


I think I have to change the (getlocalplayer())+1) part but I just don't know what to change it to.

Just wondering... does anything ever take something or return something? All the functions I've seen take/return nothing.
 
Reaction score
333
Well, its in there but I can't find it. I know it works in game (just trust me on this) but sometimes it gets the wrong person. I want to narrow the slots down to the first slot on each team. I'll try to find it, but how would I limit the function to only specific slots?

EDIT: Found it -- looks like this
JASS:
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


I think I have to change the (getlocalplayer())+1) part but I just don't know what to change it to.

Just wondering... does anything ever take something or return something? All the functions I've seen take/return nothing.

I highly doubt there is a way. You could try only storing the value if the local player id is 1 or 6 or something, but I highly doubt that would improve the accuracy and it could cause desyncs as well.
 

Jazradel

Helping people do more by doing less.
Reaction score
102
A much better solution is too run it several times and get the mode player number.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top