• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 23
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