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

leak question

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,380
Howdy,

Does the following trigger leak? I can't remember where I got it from, was a long time I implemented it;

  • Support Bot ready
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Support Bot
    • Actions
      • Set TEMP_PointSoundSupportBotR = No sound
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Set TEMP_PointSoundSupportBotR = PWiRdy00 <gen>
      • Custom script: endif
      • Sound - Play TEMP_PointSoundSupportBotR
Thanks!
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
  • Support Bot ready
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Support Bot
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Sound - Play PWiRdy00 <gen>
      • Custom script: endif
I'm not sure but if you want to play a sound for only one player, just do the trigger above. No variables needed.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
  • Support Bot ready
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Support Bot
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
      • Sound - Play PWiRdy00 <gen>
      • Custom script: endif
I'm not sure but if you want to play a sound for only one player, just do the trigger above. No variables needed.

This seems about right, however this:
GetOwningPlayer(GetTriggerUnit()) --> GetTriggerPlayer() Also instead of using trained unit, use TriggeringUnit.

Destroy the sound after its played (GetLastPlayedSound)
 
Status
Not open for further replies.
Top