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

[Solved] Mark Above Target for one Player

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2017
Messages
83
So i have an ability that deal damage based on target missing health, if target is low health it always Crit. Is it possible to show a mark or any other thing on target or units around the hero with 30% health or less?
Or if it is possible to show Health Percentage above target even if all time.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,024
Yep. What you do is create the effect with a different model path for different players. In order to be sure the string table doesn't desync you need to assign both these strings to a variable (or used once in a trigger action) on map init. They don't have to be saved in an array, just assigned/used once, but I like the array way.
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set CritModel[0] = ""
    • Set CritModel[1] = "Your\Crit\Model\Path.mdl"
  • Set PlayerVar = Owner of (Critting Unit) //or however you get the player
  • Set ModelPath = CritModel[0]
  • Custom script: if GetLocalPlayer() == udg_PlayerVar then
  • Set ModelPath = CritModel[1]
  • Custom script: endif
  • Unit Group - Pick every unit in GroupThatShouldHaveThisApplied and do Actions
    • Loop - Actions
      • Special Effect - Create an effect attached to the Overhead of (Picked Unit) using ModelPath
      • -------- You will have to store this effect in some way so it can be removed when appropriate --------
      • -------- I leave that up to you --------
If you want to handle the effect removal the simplest way: give the model a death animation that lasts as long as the duration between updates of this visual effect. Then, you can immediately destroy the effect after creating it and it will linger until the next check for units in range with low HP.
 
Status
Not open for further replies.
Top