• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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