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!
Just wan to ask one question : will sound cause desync to other people? Since sound is only affect only one computer and it doesn't related to other players's computer isn't it?
Custom script: if GetLocalPlayer() == udg_MusicPlayer then
Sound - Play <Music>
Custom script: endif
Music is fine to play asynchronously. Just make a player variable named "MusicPlayer" (if you use a different name, be sure to change "udg_MusicPlayer" appropriately in the custom script).
You can do that for the different players as needed.
Quick explanation: GetLocalPlayer() returns the player who is currently running the script. As such, the result will vary between each player. For player 1 (red), GetLocalPlayer() will return player 1 (red), player 2 (blue) will return player 2 (blue) etc. However, since these return different players for different users, it means that some users will execute the actions within the if-statement while others won't. Because of this, you can use GetLocalPlayer() to run actions for particular players.
The only drawback is that the code must be safe for local execution (local code). Certain things, such as creating or destroying objects, can cause Wc3 to fall out of sync (it'll be asking: why the hell does this exist for this player but not for this player?). Once wc3 detects that, it'll disconnect the players. However, playing music is fine (and so are most of the "visual" things). Wc3 tends to desync when the local code alters gameplay, but there are many different cases. If you need more info, feel free to read the tutorial linked in my signature as "GetLocalPlayer".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.