• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

leak question

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,377
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!
 
  • 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.
 
  • 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.
Back
Top