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

How to view HP of destructible?

Status
Not open for further replies.
Level 4
Joined
Dec 10, 2015
Messages
85
The title says all.
There are some destructible/tree that are selectable and I need to make possible to view their HP in-game. How do I do that?
Thanks :)
 
Level 14
Joined
Nov 30, 2013
Messages
926
  • Actions
    • Game - Display to (All players) the text: (String((Current life of DestructExample)))
    • Floating Text - Create floating text that reads (String((Current life of DestructExample))) at (Position of DestructExample) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
You can convert the Real into a String so you can find the option about the destructibles.
 
Level 4
Joined
Dec 10, 2015
Messages
85
  • Actions
    • Game - Display to (All players) the text: (String((Current life of DestructExample)))
    • Floating Text - Create floating text that reads (String((Current life of DestructExample))) at (Position of DestructExample) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
You can convert the Real into a String so you can find the option about the destructibles.

I guess this made the HP of every single tree to show up above the tree itself, right?
If so, will it appear in the fog of war or it will have to be seen in order to see the text?
 
Level 14
Joined
Nov 30, 2013
Messages
926
I guess this made the HP of every single tree to show up above the tree itself, right?
If so, will it appear in the fog of war or it will have to be seen in order to see the text?

Yep, but not going to be updated when it get damaged unless you loop the trigger.
If I remember it correctly, the Floating Text can be still visible through Fog of War and even Black Mask.
 
Level 4
Joined
Dec 10, 2015
Messages
85
ok thanks.
BTW, how do you do this DestructExample?
I just tried with Last Created Unit, but it doesn't work.
Also, the way it works is, Workers build a building called Field Plantation.
After 30 seconds, the Field Plantation turns into a Field, a destructible tree-like object.

So even with this Last Created Unit, it wouldn't work because when another Field would be created, well, the one before the last one would show the last one HP, right?
 
Level 4
Joined
Dec 10, 2015
Messages
85
What Trigger? This one?
  • Field Plantation T1
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Field Plantation
      • ((Owner of Fertile Grounds (South West) 0018 <gen>) Equal to Player 4 (Purple)) or ((Owner of Fertile Grounds (South West) 0018 <gen>) Equal to Neutral Passive)
      • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) or (((Owner of (Triggering unit)) Equal to Player 2 (Blue)) or ((Owner of (Triggering unit)) Equal to Player 3 (Teal)))
    • Actions
      • Wait 30.00 game-time seconds
      • Unit - Remove (Triggering unit) from the game
      • Destructible - Create a Field at (Position of (Triggering unit)) facing 270.00 with scale 1.00 and variation 0
      • Floating Text - Create floating text that reads (String((Life of (Last created unit)))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
 
Level 14
Joined
Nov 30, 2013
Messages
926
Yes, that one.
A created destructible doesn't consider itself as "Last created Unit". It's suppose to be "Last created Destructible".

Try checking this action again
  • Floating Text - Create floating text that reads (String((Current life of (Last created destructible)))) at (Position of (Last created destructible)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Both Destructible and Units had a same option of "Position of (Wat)"
 
Level 4
Joined
Dec 10, 2015
Messages
85
Once again, I'm not sure it will work : Last created destructible.
First, I don't that option (Last created destructible) I only have Last created unit
Secondly, when another Field will be created, I guess it will be ITS HP that will be shown above ALL Field, right?
 
Level 14
Joined
Nov 30, 2013
Messages
926
  • It's not in "Unit - Property", it's in "Destructible - Life" which can be found above it and between Countdown Timer and Event Response.
  • It'll be its HP but the problem is it cannot be updated when it get damaged.
    If making a multiple destructible with this, make a destructible array variable like WereElf said before.
 
Status
Not open for further replies.
Top