So I am using this system (https://wc3modding.info/4661/custom-race-system/
) to make some custom races. My question is this. Is there a way to change the music playlist ONLY for a player that selected one of the custom races? Maybe like… for triggering player only?
I think you probably can.
There is a special game variable that you can access with the function GetLocalPlayer()
. If you use it incorrectly, you will desync everybody from multiplayer games. So, once you use this variable, you need to do multiplayer testng.
The local player – if you and I are in a 1v1 match – will return YOU on YOUR COMPUTER and will return ME on MY COMPUTER. This is really special. It lets you use functions that are not per-player in a way that is per-computer.
For example, maybe you want to play a cool song for Player 1 (Red) but you do not want to play the song for Player 2 (Blue). You can accomplish this with something like:
if (GetLocalPlayer() == Player(0)) then
call PlayMusic("Sound\\Music\\mp3Music\\Undead2.mp3")
endif
But this might cause a desync if the synchronization checker ever looks at which song is being played. I’m forgetting off of the top of my head whether the synchronization checker cares about that. So, you will have to experiment.