• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Allowing Players to Choose Music

Status
Not open for further replies.
Level 1
Joined
Jun 10, 2008
Messages
4
Hello everyone, I'm trying to create a trigger that will allow each player to switch from the default music to a different song and vice versa by typing a -command. However, I haven't been able to make that works only for an individual player. Instead whenever a player types the -command it affects all players.

Any ideas on how to make 1 that will only affect the player that types the -command?
 
I dont beleive one player can have different music.

Warcraft runs as a 3D game, and it has background music. There are two ways you can put in music or sound. Put it in a spot on the map or run it as background music. All players have the same background music. You can change the music, but not for each player. If your players have bases that they do not go out of the whole game, say like multisquare defence you could put a 3d sound in the middle of thier base and then anyone who's screen is over that area will hear the music. However if you move away or closer the volume and 3d positioning will be effected, and if you move your screen to someone else's base you would hear thier music.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Declare a player variable in the variable editor.
In this example the variable name is LocalPlayer

  • initiallisation
    • Evenements
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_LocalPlayer= GetLocalPlayer()
And then use the variable like that :

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • LocalPlayer Equal To Joueur 1 (Rouge)
      • Then - Actions
        • -------- these actions will be do only for the red player so care about desynch --------
        • -------- play your music --------
      • Else - Actions
 
Level 1
Joined
Jun 10, 2008
Messages
4
Declare a player variable in the variable editor.
In this example the variable name is LocalPlayer

  • initiallisation
    • Evenements
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_LocalPlayer= GetLocalPlayer()
And then use the variable like that :

  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • LocalPlayer Equal To Joueur 1 (Rouge)
      • Then - Actions
        • -------- these actions will be do only for the red player so care about desynch --------
        • -------- play your music --------
      • Else - Actions

Didnt work :(. One player using the -command still affects all other players as well as the player using the command. I know there is a way to make this work; it's been done in other maps.

Anyone else have an idea?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Troll-Brain has the right idea.
Little bit further:
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • LocalPlayer Equal To Triggering player
  • Then - Actions
  • -------- stop music --------
  • -------- DO NOT CREATE A SOUND HERE --------
  • -------- play your music --------
  • Else - Actions
There is a bit more to be said about sounds.
Sounds should be created in you initialization trigger.
 
Level 1
Joined
Jun 10, 2008
Messages
4
Troll-Brain has the right idea.
Little bit further:
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • LocalPlayer Equal To Triggering player
  • Then - Actions
  • -------- stop music --------
  • -------- DO NOT CREATE A SOUND HERE --------
  • -------- play your music --------
  • Else - Actions
There is a bit more to be said about sounds.
Sounds should be created in you initialization trigger.

Thanks this solved the problem :D.
 
Status
Not open for further replies.
Top