DisplayText Desync?

Time

New Member
Reaction score
0
JASS:
function DisplayTextToForce takes force toForce, string message returns nothing
    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, message)
    endif
endfunction


So I don't get what they mean by this "Use only local code (no net traffic) within this block to avoid desyncs." what local code...

I'm only using this and nothing else from above
JASS:
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "mesage..." )

Will it cause desyncs?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
No it will not cause a desync.

The danger only comes from the function, [ljass]GetLocalPlayer()[/ljass]. It is a neat yet desync-prone function that must be used wisely. For more information, you can check out my tutorial:
http://www.thehelper.net/forums/showthread.php/89207-JASS-GetLocalPlayer()

To be honest, my tutorial hasn't been updated in a while, so I don't remember if everything is 100% coherent or factual, but it should give you a good jist/understanding of what it does.

However, your code will not cause a desync because you use GetTriggerPlayer(). That has no risk of desyncing.
 
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