• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

possible to make Buildings on fire lose HP?

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2010
Messages
203
Hi I am wondering if it is possible to make buildings take damage when on fire?

Something like this would be nice, if possible:

If building HP is lower than 30% than building loses 10hp every 3 seconds
If building HP is lower than 60% than building loses 15hp every 2 seconds
If building HP is lower than 85% than building loses 20hp every 1 second

Workers should still be able to repair buildings normally

Also maybe...
If building is on fire/damaged (If building HP is lower than ~30%) than building causes damage to other nearby buildings (but not units)

Thanks :)
 
Last edited:

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
I was literally just looking into an element of this today (after only recently & almost arbitrarily deciding to include it at all)... Cool to see this topic.

I will try to post more details later, but bottom line: shouldn't be hard at all. A periodic timer, checking all of your special building on the map for any that have HP <= X chosen value (e.g. 66%). Those that do, the trigger adds (or removes if not) a hidden passive ability that grants negative HP Regen.

At least, that's how I'll be making it. Again, more detail later. Good luck!
 
Last edited:
What you could do is make a passive ability (that has its show icon disabled) as an aura, as Kyrbi0 suggested.
Give it 3-4 (lvl 1 no burn) levels, and adjust the stats (affect structures, range, hp regen etc.). You have to turn on negative values in World Editor first though.

Add a trigger that adds this passive to all newly created structures, or assign it within object editor.

Add a trigger that fires once a structure takes damage, set level of its passive according to its hp range (0-33%-66%-100%)

Now, what you could do is make a purchasable item (bucket of water) which lowers level of burn and supresses burn level progression for some time.

To do this, make an item ability, make it target structures and add a custom buff (eg. Doused).
Assign this ability to your bucket of water, and add a trigger:
Fires when ability is used, lowers level of burn by 1, unless lvl is already 1.

Add an IF to your "once a structure takes damage" trigger that says "if the structure has buff called "Doused", do nothing, else, change its passive level.

It's all from my head, so forgive me all ambiguities.
 
Level 30
Joined
Mar 14, 2014
Messages
1,215
I think such a trigger already exists.

Building Fire System 0.6 (GUI) - The Building that is on fire will get slowly damaged and also damages nearby buildings too.

I don't know if this is useful to you @severed , but i just wanted to mention that.

If we know when the building is on fire then that might be possible.

A Building will get on fire, if it reaches 75% of it's max health.

For Example:
10000Hp = 100% (no fire) | 7500 = 75% (First fire phase) | 5000 = 50% (Second fire phase) | 2500 = 25% (Last fire phase)

The Limit is hardcoded and cannot be changed.
 
Level 7
Joined
Jun 27, 2014
Messages
227
All I know is, you can do that with triggering and an unholy aura with a negative regen value, so for example...
Event - Every 0.10 Sec in game time
Conditions - ///
Actions - If (All Conditions are true) then do (Then Actions) else do (Else Actions)

If Conditions - Life of Building Equal or less than (value)
Then - Actions- Unit Add Ability Unholy Aura (Modified)
Else - Actions If (conditions are true) then do (Then Actions) else do (Else Actions)
If Conditions - Life of Building Equal or greater than (value)
Then - Actions - Unit Remove Ability Unholy Aura (Modified)
Else - Actions - Do nothing


That's about the simplest way to go a it from my side, though it works in percentages. You can actually expand the trigger and make it leveled, so the lower the HP the stronger the fire.

Also, I'm a newbie at GUI so don't judge me for this :D
 
Level 6
Joined
Oct 25, 2010
Messages
203
Thanks! I knew this had to exist already but I never made a map or anything before, so keeping everything as simple as possible is always helpful :)
 
Level 6
Joined
Oct 25, 2010
Messages
203
Setting up the Fire System (0.6) was really easy! I even added an icon to show up to let players know :) thanks!!

I have another idea/request if anybody is interested lol :)

Wouldnt it be cool to replace a building when it is destroyed, like when it reaches 0 HP replace it with a "dummy" or "Destroyed" building of some type. The new Dummy/Destroyed building could have its own HP value but not very high (maybe 100hp) this way we could disable buildings (like production buildings) from training new units or attacking (such as towers) after they are destroyed, but they will still remain a little while longer. I'm thinking the destroyed building should not burn though, maybe.

That first part is probably easy, but this next part would probably take a lot of triggers, but... Then we could add a new icon/button to the Destroyed building type to replace the destroyed building with its original building for a price (like 100g/50w) and maybe it would come back at like 75% hp

Does that make sense?
 
Last edited:

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,502
I have another idea/request if anybody is interested lol :)

Wouldnt it be cool to replace a building when it is destroyed, like when it reaches 0 HP replace it with a "dummy" or "Destroyed" building of some type. The new Dummy/Destroyed building could have its own HP value but not very high (maybe 100hp) this way we could disable buildings (like production buildings) from training new units or attacking (such as towers) after they are destroyed, but they will still remain a little while longer. I'm thinking the destroyed building should not burn though, maybe.

That first part is probably easy, but this next part would probably take a lot of triggers, but... Then we could add a new icon/button to the Destroyed building type to replace the destroyed building with its original building for a price (like 100g/50w) and maybe it would come back at like 75% hp

Does that make sense?
Sure. I made something similar to this for my entry in the Wc3C 1st Race-Building Contest. They were Mech-obsessed Goblins that could destroy & rebuild their buildings.

Depending on what exactly you wish to do, it can be more or less easy to accomplish. Basically I made a 'dummy' building called a "Foundation", and then a custom "Spawn X on Death" (Hydra, Skeleton; there are several) ability that created the "Foundation". Each building had that custom ability, so when it was destroyed, it spawned the "Foundation"; thus instantly 'replacing' it. The Foundation was a building that could Upgrade (like a Town Hall) into any of the other buildings.

~

For yours, you might want to make a "neutered" version of each building you have, and a custom "spawn X on death" ability for each one. That way when your Barracks or Altar or Town Hall get destroyed, what's left would be an identical (or however you want it to look) replacement (but one that can't train units/upgrades/attack/whatever; you can set all that easily in the Object Editor).
 
Level 6
Joined
Oct 25, 2010
Messages
203
Does negative regeneration really steal kills?
Just guessing here, but I would assume it may not "count" the kill at all, or possibly even count it as a self destruct?

Depends on how you set it up, is it a passive ability/buff applied to the self?
 
Level 11
Joined
Jun 2, 2004
Messages
849
The unit will die and trigger "unit dies" triggers, but won't have a "killing unit" (though the killing unit might be itself; I've never tested). Won't give bounty to anyone of course, either.


EDIT: After some tests, it appears that the "killing unit" variable always returns a "null unit" when a unit dies to negative regeneration.
 
Last edited:
You could keep track of whoever hit that building last, so they get the kill credit. Doable with a dynamic array..

Or you could apply damage yourself via dummies and Unit Damage Target instead of negative regeneration/aura, but that requires a bit more work.. timer and a group, and saving data (damage applied, last hitting player etc)

>>OR instead of adding the regen aura directly to the structure, give it to a spawned DUMMY unit of that player and place it NEXT to the structure. And just change owner on attack<<
 
Status
Not open for further replies.
Top