Snippet CameraPanEvent

Troll-Brain

You can change this now in User CP.
Reaction score
85
Let's understand it, you can synch local datas, but not as fast as you want.
It's more a neat toy than something really usable.
 

quraji

zap
Reaction score
144
Still no one has actually explained how to sync the data..(even if it is slow). I experimented and tried to get the gamecache syncing to work, to no avail. I'm sure it wouldn't be terribly slow..
 

Azlier

Old World Ghost
Reaction score
461
It would be terribly slow.

So, what does gamecache syncing to? Does it freeze the game until the data syncs? Does it halt trigger execution until the data syncs? Either one or the other, I guess.
 

Azlier

Old World Ghost
Reaction score
461
You can make a trigger fire, but that's about it. All you can do.
 
Reaction score
341
I think the code below will sync player 1's Camera X with everyone elses;

Meaning instead of X being 0 for everyone but red, it's the same for everyone.

JASS:
scope sync initializer onInit

    globals
        private gamecache G = InitGameCache("sync.w3v")
    endglobals
    
    private function onInit takes nothing returns nothing
        call FlushGameCache(InitGameCache("sync.w3v"))
        call StoreReal(G, "Player 1", "X", GetCameraTargetPositionX())
        call SyncStoredReal(G, "Player 1", "X")
    endfunction

endscope
 

Azlier

Old World Ghost
Reaction score
461
Well you need 12 dummies, a trigger that registers selection of units. You can select one of these dummies locally, essentially making a TriggerEvaluate that can be safely called locally. With some delay.

TriggerHappy, gamecache syncing is delayed. Does it freeze the game for the duration of the delay or merely halt trigger execution? I wonder which.
 

quraji

zap
Reaction score
144
I think the code below will sync player 1's Camera X with everyone elses;

Meaning instead of X being 0 for everyone but red, it's the same for everyone.

JASS:
scope sync initializer onInit

    globals
        private gamecache G = InitGameCache("sync.w3v")
    endglobals
    
    private function onInit takes nothing returns nothing
        call FlushGameCache(InitGameCache("sync.w3v"))
        call StoreReal(G, "Player 1", "X", GetCameraTargetPositionX())
        call SyncStoredReal(G, "Player 1", "X")
    endfunction

endscope

I tried writing and testing a code like this but it didn't seem to work. So I'd like some info. Does SyncStored* sync the data according to what Player 1 has?


>Well you need 12 dummies, a trigger that registers selection of units. You can select one of these dummies locally, essentially making a TriggerEvaluate that can be safely called locally. With some delay.

I think I understand what you're saying, but can you elaborate on the "making a TriggerEvaluate that can be safely called locally." part?

>TriggerHappy, gamecache syncing is delayed. Does it freeze the game for the duration of the delay or merely halt trigger execution? I wonder which.

Wouldn't it be nice if it halted just that thread?
 

Azlier

Old World Ghost
Reaction score
461
It syncs it to what the host has. I think.

I also think that game cache syncing requires the TriggerSync*** natives.
 

quraji

zap
Reaction score
144
It syncs it to what the host has. I think.

I also think that game cache syncing requires the TriggerSync*** natives.

Hm...how would I get any other player's data then?

(I'm pursuing this purely out of curiosity at this point, after seeing how much trouble this would be for a low period system)
 
Reaction score
341
I've tested camera coordinates online by syncing through game cache back when I was working on my spacebar script. Anyways, it was extremely slow (like 2 seconds) to get the correct data.

I made it show all the players coordinates too, so I doubt it has to do with the hosts data.
 

quraji

zap
Reaction score
144
>I made it show all the players coordinates too, so I doubt it has to do with the hosts data.

How? Can you post the script?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top