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

Building Fire System 0.6 (GUI)

During the early stages of Warcraft 3 development, buildings were supposed to take damage and spread damage if they were caught on fire. This was scrapped due to it being too complicated for base management in favor of simplistic design we have today. This system brings that feature back.

Burning buildings will receive damage until repaired, the damage building receives will increase continually as the fire spreads.

There are many options for configuration such as Unit-Type exceptions, damage limit, radius limit, damage spread and many more.

This system uses Unit Indexer by Bribe, more information regarding Unit Indexer can be found here.


  • Building Fire Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setup --------
      • Set BuildingFire_InitialDamage = 0.00
      • Set BuildingFire_IncrementalDamage = 0.10
      • Set BuildingFire_DamageLimit = 12.00
      • Set BuildingFire_InitialRadius = 128.00
      • Set BuildingFire_IncrementalRadius = 1.00
      • Set BuildingFire_RadiusLimit = 256.00
      • Set BuildingFire_DamageSpread = True
      • Set BuildingFire_AttackType = Normal
      • Set BuildingFire_DamageType = Fire
      • Set BuildingFire_Rect = (Playable map area)
      • Set BuildingFire_SystemRate = 1.00
      • Set BuildingFire_ExceptionsNoFire = True
      • -------- --------- --------
      • Trigger - Add to Building Fire Main <gen> the event (Time - Every BuildingFire_SystemRate seconds of game time)
      • Trigger - Run Building Fire Exceptions <gen> (ignoring conditions)
  • Building Fire Exceptions
    • Events
    • Conditions
    • Actions
      • -------- Unit-Type Exceptions --------
      • Set BuildingFire_UnitTypeException[1] = Siege Engine
      • Set BuildingFire_UnitTypeException[2] = Peasant
      • Set BuildingFire_UnitTypeException[3] = Altar of Kings
      • -------- --------------------------------- --------
      • Set BuildingFire_ExceptionAmount = 3
  • Building Fire Main
    • Events
    • Conditions
    • Actions
      • -------- 1 --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in BuildingFire_Rect) and do (Actions)
        • Loop - Actions
          • Set BuildingFire_PickedUnit = (Picked unit)
          • Set BuildingFire_PickedUnitType = (Unit-type of BuildingFire_PickedUnit)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsOr - Any (Conditions) are true
                  • Conditions
                    • (Level of On Fire for BuildingFire_PickedUnit) Equal to (==) 1
                    • (Level of On Fire (Human) for BuildingFire_PickedUnit) Equal to (==) 1
                    • (Level of On Fire (Night Elf) for BuildingFire_PickedUnit) Equal to (==) 1
                    • (Level of On Fire (Orc) for BuildingFire_PickedUnit) Equal to (==) 1
                    • (Level of On Fire (Undead) for BuildingFire_PickedUnit) Equal to (==) 1
                • (BuildingFire_PickedUnit is in BuildingFire_FireImmuneGroup) Equal to (==) False
                • (BuildingFire_PickedUnit is in BuildingFire_ConstrGroup) Equal to (==) False
                • (Percentage life of BuildingFire_PickedUnit) Less than (<) 75.00
                • (BuildingFire_PickedUnit is alive) Equal to (==) True
              • Then - Actions
                • Unit Group - Add BuildingFire_PickedUnit to BuildingFire_OnFireGroup
              • Else - Actions
                • Unit Group - Remove BuildingFire_PickedUnit from BuildingFire_OnFireGroup
            • Do Multiple ActionsFor each (Integer BuildingFire_LoopIntegerA) from 1 to BuildingFire_ExceptionAmount, do (Actions)
              • Loop - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BuildingFire_PickedUnitType Equal to (==) BuildingFire_UnitTypeException[BuildingFire_LoopIntegerA]
                  • Then - Actions
                    • Unit Group - Add BuildingFire_PickedUnit to BuildingFire_FireImmuneGroup
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BuildingFire_ExceptionsNoFire Equal to (==) True
                        • Then - Actions
                          • Unit - Remove On Fire from BuildingFire_PickedUnit
                          • Unit - Remove On Fire (Human) from BuildingFire_PickedUnit
                          • Unit - Remove On Fire (Night Elf) from BuildingFire_PickedUnit
                          • Unit - Remove On Fire (Orc) from BuildingFire_PickedUnit
                          • Unit - Remove On Fire (Undead) from BuildingFire_PickedUnit
                        • Else - Actions
                    • Custom script: exitwhen true
                  • Else - Actions
      • -------- 2 --------
      • Unit Group - Pick every unit in BuildingFire_OnFireGroup and do (Actions)
        • Loop - Actions
          • Set BuildingFire_CustomUnitValue = (Custom value of (Picked unit))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to (==) False
                • BuildingFire_SEQ[(Custom value of (Picked unit))] Equal to (==) 0
              • Then - Actions
                • Set BuildingFire_SEQ[(Custom value of (Picked unit))] = (BuildingFire_SEQ[(Custom value of (Picked unit))] + 1)
                • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_InitialDamage damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
              • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • BuildingFire_DamageSpread Equal to (==) True
              • Then - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to (==) False
                    • BuildingFire_SEQ[BuildingFire_CustomUnitValue] Equal to (==) 1
                  • Then - Actions
                    • Set BuildingFire_TempPoint = (Position of (Picked unit))
                    • Set BuildingFire_Radius[BuildingFire_CustomUnitValue] = (BuildingFire_Radius[BuildingFire_CustomUnitValue] + BuildingFire_IncrementalRadius)
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BuildingFire_Radius[BuildingFire_CustomUnitValue] Less than (<) BuildingFire_RadiusLimit
                        • Then - Actions
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[BuildingFire_CustomUnitValue]) of BuildingFire_TempPoint) and do (Actions)
                            • Loop - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to (==) False
                                • Then - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BuildingFire_Damage[BuildingFire_CustomUnitValue] Less than (<) BuildingFire_DamageLimit
                                    • Then - Actions
                                      • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = (BuildingFire_Damage[BuildingFire_CustomUnitValue] + BuildingFire_IncrementalDamage)
                                      • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                                    • Else - Actions
                                      • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = BuildingFire_DamageLimit
                                      • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                                • Else - Actions
                        • Else - Actions
                          • Set BuildingFire_Radius[BuildingFire_CustomUnitValue] = BuildingFire_RadiusLimit
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[BuildingFire_CustomUnitValue]) of BuildingFire_TempPoint) and do (Actions)
                            • Loop - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to (==) False
                                • Then - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • BuildingFire_Damage[BuildingFire_CustomUnitValue] Less than (<) BuildingFire_DamageLimit
                                    • Then - Actions
                                      • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = (BuildingFire_Damage[BuildingFire_CustomUnitValue] + BuildingFire_IncrementalDamage)
                                      • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                                    • Else - Actions
                                      • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = BuildingFire_DamageLimit
                                      • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                                • Else - Actions
                    • Custom script: call RemoveLocation( udg_BuildingFire_TempPoint )
                  • Else - Actions
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to (==) False
                    • BuildingFire_SEQ[BuildingFire_CustomUnitValue] Equal to (==) 1
                  • Then - Actions
                    • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = (BuildingFire_Damage[BuildingFire_CustomUnitValue] + BuildingFire_IncrementalDamage)
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BuildingFire_Damage[BuildingFire_CustomUnitValue] Less than (<) BuildingFire_DamageLimit
                        • Then - Actions
                          • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                        • Else - Actions
                          • Set BuildingFire_Damage[BuildingFire_CustomUnitValue] = BuildingFire_DamageLimit
                          • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[BuildingFire_CustomUnitValue] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                  • Else - Actions
  • Building Fire Constr Begins
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • ((Constructing structure) is in BuildingFire_FireImmuneGroup) Equal to (==) False
      • ((Constructing structure) is in BuildingFire_ConstrGroup) Equal to (==) False
    • Actions
      • Unit Group - Add (Constructing structure) to BuildingFire_ConstrGroup
  • Building Fire Constr Finishes
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • ((Constructed structure) is in BuildingFire_FireImmuneGroup) Equal to (==) False
      • ((Constructed structure) is in BuildingFire_ConstrGroup) Equal to (==) True
    • Actions
      • Unit Group - Remove (Constructed structure) from BuildingFire_ConstrGroup
Contents

Building Fire System 0.6 (Map)

Reviews
KILLCIDE
Other than a few more spots where you can store (Picked unit) and its custom value, it looks this system is ready for approval. It is still missing a few things I would really like this system to have, but I don't want to keep bugging you about it. It...
Level 14
Joined
Jul 1, 2008
Messages
1,314
great idea, simple and really useful.
I would make the percentage of life adjustable. Also, it would be nice to be able to define, if only buildings or all ground units are able to spread fire. Also would be cool, if you could implement the possibility to exclude specific units/types.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
In terms of configurability as a system, it is rather lacking. However, I do like the idea. The system would be ready for approval once you fix a few simple things:
  • Is it necessary to pick units within the entire map? I feel the playable map area is enough
  • On Fire abilities should be configurable
  • As stated by Emm-A-, percentage life should be configurable
  • As stated by Chaosy, you should store (Picked unit) into a variable when you need to refer to it more than once
  • This leaks a point:
    • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_IncrementalRadius) of (Position of (Picked unit))) and do (Actions)
  • Why do you check to see if DamageSpread is true inside the unit group loop? The boolean is global, meaning that all buildings are affected by it, so there is no need to constantly check for it in the unit group loop. The check should be done before the group enumeration
  • Attack and damage type should be configurable
I'm not next to my computer, so I was unable to open the demo map. However, judging from the way the triggers look, it looks like it was made in WEU. If so, you will need to make sure it works in the vanilla editor or JNGP for me to approve it. Other than that, if you only do the suggestions I made, I would have to give this system a low rating due to how lacking the config trigger is. It's a rather interesting system, so I would love to see more freedom for users to play around with it.

Set to Awaiting Update.
 
great idea, simple and really useful.
I would make the percentage of life adjustable. Also, it would be nice to be able to define, if only buildings or all ground units are able to spread fire. Also would be cool, if you could implement the possibility to exclude specific units/types.

Why would you want to make percentage of life adjustable? The fire only appears if the unit/building has less than 75% of health. This system uses Blizzard abilities (On Fire) that are hardcoded, which I can't edit.

Units who have On Fire abilities will receive fire damage and if damage spread is turned on they will spread fire damage in a radius to nearby units/buildings. Buildings and mechanical units are set to have On Fire abilities by default.

The exclusion of specific types is plausible, thank you for your suggestions.

If you use picked unit more than once, store it into a variable.

I don't think picked unit leaks, the groups are automatically destroyed.
In terms of configurability as a system, it is rather lacking. However, I do like the idea. The system would be ready for approval once you fix a few simple things:
  • Is it necessary to pick units within the entire map? I feel the playable map area is enough
  • On Fire abilities should be configurable
  • As stated by Emm-A-, percentage life should be configurable
  • As stated by Chaosy, you should store (Picked unit) into a variable when you need to refer to it more than once
  • This leaks a point:
    • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_IncrementalRadius) of (Position of (Picked unit))) and do (Actions)
  • Why do you check to see if DamageSpread is true inside the unit group loop? The boolean is global, meaning that all buildings are affected by it, so there is no need to constantly check for it in the unit group loop. The check should be done before the group enumeration
  • Attack and damage type should be configurable
I'm not next to my computer, so I was unable to open the demo map. However, judging from the way the triggers look, it looks like it was made in WEU. If so, you will need to make sure it works in the vanilla editor or JNGP for me to approve it. Other than that, if you only do the suggestions I made, I would have to give this system a low rating due to how lacking the config trigger is. It's a rather interesting system, so I would love to see more freedom for users to play around with it.

Set to Awaiting Update.

I'm afraid that's not possible, On Fire abilities are hardcoded since I based this system on top of Blizzard one. I can make the percentage of life configurable but that would be useless, there is no need to change that value. As I said previously, fire only appears below 75%.

Thank you for your review, I'm working on an update.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
The fire only appears if the unit/building has less than 75% of health.
I didn't think about that. Fair enough o:

I don't think picked unit leaks
It doesn't have to do with leaks. It's a mean of efficiency :p instead of having to constantly call GetEnumUnit(), you can just refer to the variable.

On Fire abilities are hardcoded
Oh? Sorry I thought they were custom abilities you made.
 
Why do you check to see if DamageSpread is true inside the unit group loop? The boolean is global, meaning that all buildings are affected by it, so there is no need to constantly check for it in the unit group loop. The check should be done before the group enumeration

Could you be more elaborate?
 
The boolean isn't unique to every unit in the OnFireGroup. If it is true for one, it is true for all. There is no need to check if they should spread the damage per loop iteration. With that in mind, there is also no need to enumerate through the list if DamageSpread is false.

I updated the system.
 
Last edited:
Level 14
Joined
Jul 1, 2008
Messages
1,314
Sry, A Void, obviously I did not think of that 75% fire-thing. Still, if you would set this to lets say 25%, the unit would only be considered by the system way later, or am I completely wrong? Like that, you could have the fire only deal actual damage and spread after the building was severely damaged.

But I guess, thats maybe too special.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Hmm I still have a few issues with this system that I would like to see addressed:
  • What purpose does IncrementalDamage do? All I see it doing is adding it to whatever value the InitialDamage is (which would always be 6 damage by default)
  • Store (Picked unit) into a variable where you enumerate through the playable map area
  • The Do Nothing function is useless. It literally does nothing but add an extra function call :p get rid of it!
  • You still call the (Picked unit) function in the OnFireGroup unit group loop when you already stored (Picked unit) into a variable
  • BuildingFire_TempPoint leaks for every loop iteration
On your next update, is it possible for you to post using the vanilla editor instead of WEU? Other than that, the system will be ready for approval.

Set to Awaiting Update.
 
Hmm I still have a few issues with this system that I would like to see addressed:
  • What purpose does IncrementalDamage do? All I see it doing is adding it to whatever value the InitialDamage is (which would always be 6 damage by default)
Incremental damage has been temporarily removed until I figure out how to use it properly, same goes for incremental radius. Map updated.

Edit: Map works in normal editor.
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
A rather simple system, but a very unique mechanic that will add new strategies to base building. The triggers are in an approvable state. However, I would love for you to continue working on this system by adding more configurability such as unit-type exceptions, the use of a unit indexer or hashtable to store incremental damage + range, etc. When you make those changes, I will be happy to bump up my rating for it.

Approved with a 3/5 rating.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
  • Use a custom integer for the loop instead of (Integer A) to avoid clashing triggers
  • Move the first set bj_wantDestroyGroup = true after the for loop. The boolean will be set back to false because of the for loop after it, meaning that the Pick every unit in (Units in BuildingFire_Rect) group loop will leak
  • I would avoid using the "Unit Group - Units of Type" function. It has a leak that is unpreventable
  • When you Pick every unit in (Units in BuildingFire_Rect), store (Picked unit) into a variable
  • What does BuildingFire_SEQ[] do?
  • Remove the call RemoveLocation( udg_BuildingFire_TempPoint ) inside the If / Then / Else here:
    • Set BuildingFire_TempPoint = (Position of (Picked unit))
    • Set BuildingFire_Radius[(Custom value of (Picked unit))] = (BuildingFire_Radius[(Custom value of (Picked unit))] + BuildingFire_IncrementalRadius)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BuildingFire_Radius[(Custom value of (Picked unit))] Less than BuildingFire_RadiusLimit
      • Then - Actions
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[(Custom value of (Picked unit))]) of BuildingFire_TempPoint) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to False
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BuildingFire_Damage[(Custom value of (Picked unit))] Less than BuildingFire_DamageLimit
                  • Then - Actions
                    • Set BuildingFire_Damage[(Custom value of (Picked unit))] = (BuildingFire_Damage[(Custom value of (Picked unit))] + BuildingFire_IncrementalDamage)
                    • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[(Custom value of (Picked unit))] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                  • Else - Actions
                    • Set BuildingFire_Damage[(Custom value of (Picked unit))] = BuildingFire_DamageLimit
                    • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[(Custom value of (Picked unit))] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
              • Else - Actions
        • Custom script: call RemoveLocation( udg_BuildingFire_TempPoint )
      • Else - Actions
        • Set BuildingFire_Radius[(Custom value of (Picked unit))] = BuildingFire_RadiusLimit
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[(Custom value of (Picked unit))]) of BuildingFire_TempPoint) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is in BuildingFire_FireImmuneGroup) Equal to False
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BuildingFire_Damage[(Custom value of (Picked unit))] Less than BuildingFire_DamageLimit
                  • Then - Actions
                    • Set BuildingFire_Damage[(Custom value of (Picked unit))] = (BuildingFire_Damage[(Custom value of (Picked unit))] + BuildingFire_IncrementalDamage)
                    • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[(Custom value of (Picked unit))] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
                  • Else - Actions
                    • Set BuildingFire_Damage[(Custom value of (Picked unit))] = BuildingFire_DamageLimit
                    • Unit - Cause (Picked unit) to damage (Picked unit), dealing BuildingFire_Damage[(Custom value of (Picked unit))] damage of attack type BuildingFire_AttackType and damage type BuildingFire_DamageType
              • Else - Actions
        • Custom script: call RemoveLocation( udg_BuildingFire_TempPoint )
    And move it outside and after the If / Then / Else

  • Why not just initialize BuildingFire_Radius[] to BuildingFire_RadiusLimit? Also, why do you add InitialRadius + Radius[] instead of just storing it into Radius[] and referencing that? It makes your triggers slighty harder to read
  • ^ The same applies to BuildingFire_Damage[]
  • Store the Custom value of (Picked unit) into a variable as well for readability and slight performance. More importantly for the former
No offense, but some of the way you did things seems a little lazy. You just enumerate through the entire map every second instead of adding structures to a global unit group when they are built and removing them when they are destroyed. I personally think the latter would overall be better for the system. You could also use a hashtable for direct look up instead of having to loop through them each time. You don't have to do it, but I'm really not digging the current setup.

Also, pleease post the vanilla editor triggers :p I really don't like how WEU triggers look.

Set back to Awaiting Update.
 
Remove the call RemoveLocation( udg_BuildingFire_TempPoint ) inside the If / Then / Else ...

Why? It prevents a leak.

What does BuildingFire_SEQ[] do?

BuildingFire_SEQ[] ensures that initial damage is dealt first and only once, incremental damage will be continually dealt after initial damage. It's short for word "Sequence".

Why not just initialize BuildingFire_Radius[] to BuildingFire_RadiusLimit? Also, why do you add InitialRadius + Radius[] instead of just storing it into Radius[] and referencing that? It makes your triggers slighty harder to read.

^ The same applies to BuildingFire_Damage[]...

Could you be more elaborate?

No offense, but some of the way you did things seems a little lazy. You just enumerate through the entire map every second instead of adding structures to a global unit group when they are built and removing them when they are destroyed. I personally think the latter would overall be better for the system. You could also use a hashtable for direct look up instead of having to loop through them each time. You don't have to do it, but I'm really not digging the current setup.

Thank you for your suggestions. I'm not sure about hash-tables as I have no experience with them and have no desire to revamp this system with their use. When I created this system I had in mind to have only one main trigger and one setup trigger, the less the better, that's why I did not do additional triggers with build events.
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
Why? It prevents a leak.
Read the full bullet :)
...And move it outside and after the If / Then / Else
The reason I made this suggestion is because they all reference the same location, so you only have to remove it once at the very end instead at different spots of the If / Then / Else

Could you be more elaborate?
  • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[(Custom value of (Picked unit))]) of BuildingFire_TempPoint) and do (Actions)
^ Instead of checking for Units within the arithmetic, why not just store it into Radius[] and reference it from there?
 
Read the full bullet :)

The reason I made this suggestion is because they all reference the same location, so you only have to remove it once at the very end instead at different spots of the If / Then / Else​

Can't believe I missed that :p


  • Unit Group - Pick every unit in (Units within (BuildingFire_InitialRadius + BuildingFire_Radius[(Custom value of (Picked unit))]) of BuildingFire_TempPoint) and do (Actions)
^ Instead of checking for Units within the arithmetic, why not just store it into Radius[] and reference it from there?

Like this?

Set Radius[(Custom value of (Picked unit))] To InitialRadius
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Uhhh if I'm understanding that correctly, yes. The unit group function should look like this:
  • Unit Group - Pick every unit in (Units within BuildingFire_Radius[(Custom value of (Picked unit))] of BuildingFire_TempPoint) and do (Actions)
And of course store custom value of (Picked unit) into a variable. You don't have to do the arithmetic thing I talked about, but at least store the custom value so that it's a lot easier to read the arithmetic operators.
 
System has been updated to v0.4. Added a brand new option in Setup - BuildingFire_ExceptionsNoFire.

BuildingFire_ExceptionsNoFire - Excluded unit-types that are not affected by burning damage will have fire effect removed purely for aesthetic purposes. This works solely on excluded units in "Building Fire Exceptions" trigger, it doesn't affect units that were manually added to "BuildingFire_FireImmuneGroup" group.

Basically fire won't show up if unit/building can't burn. It's much more realistic now.

Added a couple of comments as separators to keep it clean and tidy. Most of non-function comments has been moved to upper comment field.
 
Last edited:
Level 37
Joined
Jul 22, 2015
Messages
3,485
  • What do you have against storing (Picked unit) and Custom value of (Picked unit) into variables? xD all of your unit group enumerations reference them multiple times, yet you still prefer to call the function everytime instead of using a varibale
  • That for loop looks extremely taxing to be running every second. I would instead do it like this:

    • Unit Group - Pick every unit in (Units in BuildingFire_Rect) and do (Actions)
      • Loop - Actions
        • -------- STORE PICKED UNIT !! --------
        • Set BuildingFire_PickedUnit = (Picked unit)
        • Set BuildingFire_PickedUnitType = (Unit-type of BuildingFire_PickedUnit)
        • For each (Integer BuildingFire_LoopIntegerA) from 1 to BuildingFire_ExceptionAmount, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • BuildingFire_PickedUnitType Equal to BuildingFire_UnitTypeException[BuildingFire_LoopIntegerA]
              • Then - Actions
                • Unit Group - Add BuildingFire_PickedUnit to BuildingFire_FireImmuneGroup
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • BuildingFire_ExceptionsNoFire Equal to True
                  • Then - Actions
                    • Unit - Remove On Fire from BuildingFire_PickedUnit
                    • Unit - Remove On Fire (Human) from BuildingFire_PickedUnit
                    • Unit - Remove On Fire (Night Elf) from BuildingFire_PickedUnit
                    • Unit - Remove On Fire (Orc) from BuildingFire_PickedUnit
                    • Unit - Remove On Fire (Undead) from BuildingFire_PickedUnit
                  • Else - Actions
                • Custom script: exitwhen true
              • Else - Actions
    this makes it so that you only enumerate through the entire map once instead of enumerating through the entire map for every loop iteration. Oh also, store (Picked unit) and unit-type :D
The for loop is my only gripe with the system. Enumerating through the entire map is a really taxing function, so having it done in a for loop every single second sounds scary.

Awaiting Update
 
Map has been updated. :)

Optimized the main code to save performance. I'm not sure why but triggers are messed up here in Hive, they show up normally in the editor.

What do you have against storing (Picked unit) and Custom value of (Picked unit) into variables?

There were multiple issues I had to deal with when I added picked unit to variable. It's solved now.
 
Is it just me or does the fire spread before the Building is even finished being build? In the case of the Undead: The Buildings gets destroyed instantly. (I have seen that with the Computer-Player. It was funny to see, but it was anoying as hell)

Wow, how could I forget about constructing structures? Thank you for your feedback. Version 0.6 has just been released.
 
Top