An if with local player will do the magic. But only put it around the displaying code of the floating text, not around the creation of it if you don't want desyncs.
AIAndyAn if with local player will do the magic. But only put it around the displaying code of the floating text, not around the creation of it if you don't want desyncs.
Could't you explain a little more about the construction of the trigger and what there could happen if you are getting desyncs.
misakiI think you can also do it with the GUI with `show text tag for force'? =P But localplayer is more aesthetic...
I've checked many times before writing this topic and I checked again when I saw what you had written, BUT there is no "show text tag for force/player etc." I'm using WE. Maybe there is such an action WEU, I don't know.
I think that desyncs happen, among others, if a variable is set to different values in different clients. Therefore you cannot initialize or set a variable in a local player loop.
You can use mainly "show text/graphics" and "play sound" actions in the local player block (anything that can be executed by the local client alone and which does not require network traffic to other clients).
When you play Warcraft in Multiplayer, the same game runs on multiple computers. To asure that those games actually do the same, Warcraft sends sync info between the computers. As an example: when a unit is created, that unit needs to be created at the exact same point on all computers so Warcraft sends that location over the net and if it happens to be wrong on one computer, that computer desyncs with the rest of the game and will be forced to leave. Usually desyncs are the result of bugs in the game or problems in the network. Now Warcraft has a special native that intentionally desyncs the game. That is GetLocalPlayer. After running local player p = GetLocalPlayer() p contains a different player on all computers (the player playing on that specific computer). Now you will wonder why does it not always cause a desync of the game? The reason is that Warcraft does not sync everything, some things are local and changing them on a specific computer does not desync the game. That are usually things related to input and output, but not related to the outcome of the current game. Some Examples: Models, Skins, Displaying Text, Sound, ...
So if you have code like if GetLocalPlayer() == Player(5) then //some code endif then it is important that you only put local stuff in there and not create a unit or similar.
in the map initialization and it does not seem to desync the game. Any idea why's that so?
Still, I've heard of some strange problems that some people have with the map, but I've not been able to replicate them, nor relate them to desync (since people don't get disconnected; just nothing happens for the other player). Would it be possible that the map would run differently on different clients (e.g. Mac/PC)? I.e. some people would experience a desync related problem and others not, playing the same map?
Usually I think it is better to avoid desyncing globals as you never know where you accidently use it causing desyncs. Some have claimed that globals are synced (so Warcraft would notice the desync at once). I have never tested it so I don't know for sure.