• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Playing a sound for only a specific player color

Status
Not open for further replies.
Level 3
Joined
Aug 8, 2012
Messages
42
Hello


I am wondering if it is possible to play a sound for only a specific player color.


The map i am editing has 9 different countries of Europe, but everyone plays as the race of Human. I am looking to import the national anthem of each country into my game and have it play only for them. (They all have the same music set so i cannot change, for example, "Human 1" to one of the national anthems)

The way i am trying to do this is to have the national anthem play for the player color, then once it is over, it will set the regular human music volume to 100% (since i will use the national anthems as sounds rather than music).

I am having a lot of difficulty finding a way on how to do this currently and i have been trying to figure it out for a few weeks.


(I am going to play the sound by using the trigger editor and the sound editor of course)


If further explanation is required, please ask me and i will do my best to give more information on my problem.


Thank You for reading!
 
Level 3
Joined
Aug 8, 2012
Messages
42
Thank you all for your replies.

Is there anyone that can provide perhaps a basic instruction guide on how to preform one of these methods?...


Apologies for my confusion, for i have never used JASS in Warcraft 3 Editing (I have been editing for about 8 years now).
 
Level 3
Joined
Aug 8, 2012
Messages
42
Sorry to bump this but i am still confused on how to go by inputting it through the use of jazz..


Again, i have never used Jazz and i have no idea what i am doing at all when it comes to this..
 
Level 5
Joined
Feb 22, 2013
Messages
161
If you have never used jass, it's best if you search around the site for tutorials on basic jass knowledge. Otherwise, to answer your question, you need to specify: when do want to have the anthems played? What happens for them to start playing? etc.
 
Level 3
Joined
Aug 8, 2012
Messages
42
If you have never used jass, it's best if you search around the site for tutorials on basic jass knowledge. Otherwise, to answer your question, you need to specify: when do want to have the anthems played? What happens for them to start playing? etc.


Thanks for the reply,

I do not have much time right now, but i will be able to have some time to spare in the future to read the JASS tutorials.


If someone could perhaps teach me more about the use of transmissions then i could possibly play an anthem for a specific color.

Someone tried to explain earlier but i still did not understand fully...
 
Level 5
Joined
Feb 22, 2013
Messages
161
  • Anthem per Player
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player(0) then
      • -------- The above condition has to be a custom script because there is no option for GetLocalPlayer in the regular GUI --------
      • Sound - Play (Player Red's anthem)
      • Custom script: endif
      • -------- the 'endif' has to be a custom script as well because you started the condition with a custom script --------
      • -------- Then repeat this process until Player(0) says Player(11) --------
This trigger will play Red's anthem as it is. To play all players' anthems you must repeat the process changing Red's to Blue's anthem then Blue's anthem to Teal's and so on... Also when you're done with the trigger, post it so I can review it for you.
 
Level 3
Joined
Aug 8, 2012
Messages
42
  • Anthem per Player
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == Player(0) then
      • -------- The above condition has to be a custom script because there is no option for GetLocalPlayer in the regular GUI --------
      • Sound - Play (Player Red's anthem)
      • Custom script: endif
      • -------- the 'endif' has to be a custom script as well because you started the condition with a custom script --------
      • -------- Then repeat this process until Player(0) says Player(11) --------
This trigger will play Red's anthem as it is. To play all players' anthems you must repeat the process changing Red's to Blue's anthem then Blue's anthem to Teal's and so on... Also when you're done with the trigger, post it so I can review it for you.


How do you use the "custom trigger" button.. i see no such thing in the normal editior..
 
Level 5
Joined
Feb 22, 2013
Messages
161
Click on New Action and then when you have the scroll down menu that specifies the type of action such as sound, unit, player, etc., there should be one that says -General at the top of the list, then in the second scroll down menu there is one that says Custom Script right below Comment.
 
Level 3
Joined
Aug 8, 2012
Messages
42
Click on New Action and then when you have the scroll down menu that specifies the type of action such as sound, unit, player, etc., there should be one that says -General at the top of the list, then in the second scroll down menu there is one that says Custom Script right below Comment.

Sorry if i sound stupid...


Do i just copy and paste "GetLocalPlayer() == Player(0)" and paste it into the variable section..?
 
Level 5
Joined
Feb 22, 2013
Messages
161
cBMs9Jj.jpg
 
Level 5
Joined
Feb 22, 2013
Messages
161
Yes, you can do it like that, but you'll have to change the Player(0) to Player(1) for Blue's anthem and Player(2) for Teal's anthem and so on for each one.
 
Level 3
Joined
Aug 8, 2012
Messages
42
Yes, you can do it like that, but you'll have to change the Player(0) to Player(1) for Blue's anthem and Player(2) for Teal's anthem and so on for each one.


No good

I tested it and nothing happened.


The format of my sound file is .wav do i need to convert it to .mp3 or place it as a 3D sound in order for this to work?


Here is how i have it setup:

gZ8HejY.png
 
Level 6
Joined
May 20, 2014
Messages
228
Map initialization only works during the loading screen, and seems like it wouldn't work that way with GetLocalPlayer().

Put some kind of periodic timer like 5 seconds have elapsed and then it will fire.
 
Level 6
Joined
May 20, 2014
Messages
228
> Just tried, It works with Map Init.

Ah, I think I remember now, I read that sounds were played whenever a player finishes loading during map init, so if there's other players in the lobby and you finish loading, the sounds will play for you too, but not in the game.

Then, I have no knowledge using sounds in the game, so there you go. But trying to play it in map init seems weird, so just put it on some kind of timer whenever everyone finishes loading and it will play normally.
 
Level 5
Joined
Feb 22, 2013
Messages
161
So turns out, it needed to be an .mp3 format. I figured that was the problem, but didn't make sense at first... But anyways, took the liberty of converting it for you :)
 

Attachments

  • Russian Anthem.mp3
    3.1 MB · Views: 48
Level 3
Joined
Aug 8, 2012
Messages
42
So turns out, it needed to be an .mp3 format. I figured that was the problem, but didn't make sense at first... But anyways, took the liberty of converting it for you :)

Could you perhaps upload the map you got it to work in...?

I just tried it with the MP3 using the scripts etc...

Still no sound..

I honestly do not know what the hell i am doing wrong...



Also.. thanks for helping me with this. I really appreciate it.
 
Level 5
Joined
Feb 22, 2013
Messages
161
Not a bump or anything, can't send attachments through PMs, or at least I don't know how.
 

Attachments

  • Anthem of Russia WIP.w3m
    7.8 MB · Views: 51
Status
Not open for further replies.
Top