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

Editing unit's attack & moving sounds

Status
Not open for further replies.
Level 10
Joined
Oct 28, 2012
Messages
228
Hello,

In the classic settings the game plays:

  • Yes sound when you issue an order targeting a point - patrol, move or attack ground
  • YesAttack sound when you issue an order targeting enemy unit
I need to somehow edit this settings for I need unit to make yesattack sound when I issue the attack ground order (which is considered as an order targeting a point and thefore gives you the yes sound).

Any ideas fellas? :)
 
Level 10
Joined
Oct 28, 2012
Messages
228
Hey, thx for the input =) I know how to edit sounds, but I want to keep my regular YesSound for the situation when it is fitting. I just don't see why devs didnt considered attack ground command as an attack.. But whatever ^^

Can you make me some short preview in GUI how that could work? I mean how do I mute the classical response, and more importantly - how to force the game random attack sound instead of one repeatedly (there are 3-5 attack sounds and I want to use them all, not just one)
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
I mean how do I mute the classical response
You can't, you'd have to overwrite the default yes sounds with blank files so they wouldn't play. Then reimport all the yes and yesattacks you do want to use and set up a trigger that detects when units of the right type are ordered to do point/enemy target orders and then play them randomly.
  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Conditions
  • Actions
    • Set MAX_YES = 4 //or however many you want
    • Set YES_SOUND[1] = mortarteamyes1 <gen> //these are sound objects from reimporting
    • Set YES_SOUND[2] = mortarteamyes2 <gen>
    • -------- etc. for all MAX_YES possible sounds --------
    • Set MAX_YES_ATTACK = 3 //or however many you want
    • Set YES_ATTACK_SOUND[1] = mortarteamyesattack1 <gen>
    • Set YES_ATTACK_SOUND[2] = mortarteamyesattack2 <gen>
    • -------- etc. for all MAX_YES_ATTACK possible sounds --------
  • Events
    • Unit - A unit is issued an order targeting a point
  • Conditions
    • (Unit type of (Triggering Unit)) equal to YOUR_ATTACKER
  • Actions
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • Or - Any condition is true
          • (Issued Order) equal to Order(Move)
          • (Issued Order) equal to Order(Patrol)
          • (Issued Order) equal to Order(Smart)
        • (Random integer from 1 to 100) less than or equal to YES_CHANCE //so it doesn't play every time
      • Then - Actions
        • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
        • Sound - Play YES_SOUND[(Random integer from 1 to MAX_YES)] //it is my understanding that this will not desync the game
        • Custom script: endif
      • Else - Actions
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • Or - Any condition is true
          • (Issued Order) equal to Order(Attack Ground)
        • (Random integer from 1 to 100) less than or equal to YES_ATTACK_CHANCE //so it doesn't play every time
      • Then - Actions
        • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
        • Sound - Play YES_ATTACK_SOUND[(Random integer from 1 to MAX_YES_ATTACK)]
        • Custom script: endif
      • Else - Actions
 
Status
Not open for further replies.
Top