• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Desync on DisplayTextToForce?

Status
Not open for further replies.
Level 1
Joined
Apr 27, 2013
Messages
2
Hi there,

I'm not really new to JASS but I've never given it any thought til now,
and now that I have I'm not quite sure whether I got it right, so I thought this would be a good place to ask:

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

Will
JASS:
call DisplayTextToForce( GetPlayersAllies(Player(0)), "something" )
actually (besides from leaking a force) potentially desync the string table between allies and enemies of player red on the first usage,
because it will write "something" only for his allies? :eekani:


~dizzied by his own thoughts,
SB
 
Fortunatly not ^^.
You pass "something" as the argument of a function, wether you are an ally of Player(0). The string is stored and appears in the executed code, even if it is not used for display.

In other words :
JASS:
function RegisterString takes string s returns nothing
endfunction

...
    // That line will register the string, even if it does nothing with it.
    call RegisterString("something")
...
 
Status
Not open for further replies.
Top