DisplayText Desync?

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

  1. Time

    Time New Member

    +0 / 0 / -0
    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)

    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
    call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "mesage..." )

    Will it cause desyncs?
  2. PurgeandFire

    PurgeandFire zxcvmkgdfg

    +513 / 0 / -0
    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:

    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

    Time New Member

    +0 / 0 / -0
    Thanks again your always giving the answer I'm looking for.

Share This Page