DisplayText Desync?

Discussion in 'JASS Zone' started by Time, Mar 13, 2012.

  1. Time New Member

    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?
  2. PurgeandFire zxcvmkgdfg

    No it will not cause a desync.

    The danger only comes from the function, GetLocalPlayer(). 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.
  3. Time New Member

    Thanks again your always giving the answer I'm looking for.

Share This Page