• 🏆 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!

[General] Sound System

Status
Not open for further replies.
Level 11
Joined
Sep 11, 2013
Messages
327
Hi guys!

I want to make an efficient sound system with audio quotes in my map and i want to know..

Is it possible to make it more efficient than i already did?

upload_2020-2-20_7-7-22.png


I need to put in this map like 50 audio quotes and this is just one trigger for 1 quote..

p.s. I don't want to change the editor. 1.21b (6052)

The help will be appreciated :)

Any ideas?
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
Use If Then Else to check if the entered chat string matches with the sound that you want to play.
  • Sound System
    • Events
      • Player - Player 1 (Red) types a chat message containing <empty string> as A Substring
      • Player - Player 2 (Blue) types a chat message containing <empty string> as A Substring
      • Player - Player 3 (Teal) types a chat message containing <empty string> as A Substring
      • Player - Player 4 (Purple) types a chat message containing <empty string> as A Substring
      • Player - Player 5 (Yellow) types a chat message containing <empty string> as A Substring
      • Player - Player 6 (Orange) types a chat message containing <empty string> as A Substring
      • Player - Player 7 (Green) types a chat message containing <empty string> as A Substring
      • Player - Player 8 (Pink) types a chat message containing <empty string> as A Substring
      • Player - Player 9 (Gray) types a chat message containing <empty string> as A Substring
      • Player - Player 10 (Light Blue) types a chat message containing <empty string> as A Substring
      • Player - Player 11 (Dark Green) types a chat message containing <empty string> as A Substring
      • Player - Player 12 (Brown) types a chat message containing <empty string> as A Substring
    • Conditions
    • Actions
      • -------- Sad --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to sad
        • Then - Actions
          • Sound - Play Sound
          • Game - Display to (All players) the text: Sad :(
        • Else - Actions
      • -------- Happy --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to happy
        • Then - Actions
          • Sound - Play Sound
          • Game - Display to (All players) the text: Happy :)
        • Else - Actions
      • -------- Angry --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to angry
        • Then - Actions
          • Sound - Play Sound
          • Game - Display to (All players) the text: Angry !
        • Else - Actions
      • -------- etc --------
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
You can use wait game time for more accurate long waits... prevents counting a time when the game is paused (encountered this before). However, it is said that the function leaks. You may find some workarounds for that.

You can also index the players used on event and use a loop for adding them on trigger event including the chat strings (can be stored on string array too). This can save you a lot of time in making those specified chat string events for that amount of triggers you desired to make.

I do think efficiency is already shown in method above but based on your trigger... You can opt for my option if that doesn't complicate you much (as it seems like you wanted to prevent such audio to be played again (or abusively) by the player by using waits and disabling the specific trigger right)
 
Status
Not open for further replies.
Top