• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Play sound and display animation to one player?

Status
Not open for further replies.
Level 3
Joined
Jan 24, 2015
Messages
26
One thing that's always bugged me about WC3 DOTA and a bunch of its kin that I remember is that last hitting doesn't have the punch that most modern AoS have. The gold bounty animation shows whenever a unit kills another that has a bounty - even if it's just a creep killing another creep.

I've heard that there's a way to make triggers occur only locally to a single player, but I've never seen it in practice. I've also figured out how to disable the standard gold bounty animation. So, would anyone mind helping me figure out how to to display that animation and play a sound when a player scores a last hit, but only to that player? I really think that'll help add the punch that's missing when just working with the default WC3 stuff.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If I misunderstood you, just skip to the second part.

Well, it seems to me you are just asking this.Lets say sentinel units in dota is controlled by player 1.

  • Player - Turn Gives bounty On for Player 1 (Red)
When you do this all killed creeps give bounty to their killer, even if it's just a creep killing another creep.

---------------------------------------------------------
You do it locally like this

  • Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit type of (dying unit)) equal to Creep or whatever
    • Actions
      • Set BountyPlayer = (Owner of (Killing unit))
      • Player - add X gold to BountyPlayer
      • Custom script: if GetLocalPlayer() == udg_BountyPlayer
      • Floating Text - Create floating text that reads 100 above (Dying unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 32.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
      • Sound - Play ReceiveGold <gen>
      • Custom script: endif
 
Level 6
Joined
Aug 14, 2016
Messages
174
Dosen't works all actions:
I was make a buying sound effect but error:
Set BountyPlayer = (Owner of ((Buying unit))
if GetLocalPlayer() == udg_BountyPlayer
Sound-Play ThanksYou<gen>
endif

Error:
Expected'then'
Expected'endif'
 
Status
Not open for further replies.
Top