• 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.

[JASS] TriggerSyncStart Failing?

Status
Not open for further replies.
Level 5
Joined
Sep 8, 2004
Messages
98
I've been working a ton on my map, basically making the entire map's code up to a 'standard' (half the stuff in it doesn't work, basically).

Today, I decided I'd test the map, just to see how much worked (and see if any bugs occured), but for some reason, the GetHost function is not working, at all:

JASS:
library GetHost

globals
    player host
endglobals

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 host = Player( GetStoredInteger(g, "Map", "Host" )-1)
    call FlushGameCache(g )
    set g = null
endfunction

endlibrary

I have tried running it at Map Initialization, and at 0.1 seconds afterward (using a timer), and both times it stops at TriggerSyncStart. I don't even know what this function does! :confused:

Also, is there an op limit for the map initialization? I've got so much variables and initialization stuff that has to be done, that I'm afraid I'm going to hit the OP limit (if it exists).
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Yes, and it applies to any thread of Jass.

TriggerSyncStart - I don't think anybody knows what it does.

TriggerSyncReady - It pauses the game until the host responds.

SyncStoredInteger projects a value to the host and all players adopt the fastest projected value (theoretically that of the host, but not necessarily).

You may be interested in this (though as far as I've heard the function doesn't actually perform flawlessly, I'm more referencing it for the networking stuff).
 
Status
Not open for further replies.
Top