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

[Trigger] Global Immolation

Status
Not open for further replies.
Level 9
Joined
May 21, 2014
Messages
580
:vw_wtf:

Greetings Hive.

I have a trigger that damages all units globally by 5 every 5 seconds, seemingly like an Immolation skill. The problem with using Permanent Immolation is that the skill kills any unit with an odd reason that I cannot discover. I just found it out when a wall building with 40% HP just died because of the immolation; no other sources of damage was detected. So I decided to make a triggered Immolation. But the thing is, it lags. Can anybody here give me advice of what to do?

Currently, my trigger's event is a periodic event 5 seconds game time. It turns on when the unit having the skill spawns. And when it dies, the trigger is turned off. Actions is I pick all units in range of 20000 (not really global but still...) from the unit, then I pick every unit within the unit group then damage it by 5. Then i destroy the unit group to avoid leaks.

Thanks Hive :ogre_kawaii:
 
Level 9
Joined
May 21, 2014
Messages
580
Here. The trigger I have.
  • Koishi Immolation
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitKoishiDamagePoint = (Position of UnitKoishi)
      • Set UnitKoishiVictimGroup = (Units within 20000.00 of UnitKoishiDamagePoint matching (((Matching unit) is A structure) Equal to True))
      • Unit Group - Pick every unit in UnitKoishiVictimGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause UnitKoishi to damage (Picked unit), dealing 5.00 damage of attack type Chaos and damage type Universal
      • Custom script: call DestroyGroup(udg_UnitKoishiVictimGroup)
      • Custom script: set udg_UnitKoishiVictimGroup = null
      • Custom script: call RemoveLocation(udg_UnitKoishiDamagePoint)
      • Custom script: set udg_UnitKoishiDamagePoint = null
Also, the lag is caused when this trigger is turned on. When it gets turned off, the lag will disappear, so it's most likely in this trigger.

---Edit

Though the trigger above is also turned on with another trigger. The other trigger is as follows:
  • Flandre Immolation
    • Events
      • Time - Every 2.50 seconds of game time
    • Conditions
    • Actions
      • Set UnitFlandreDamagePoint = (Position of UnitFlandre)
      • Set UnitFlandreVictimGroup = (Units within 250.00 of UnitFlandreDamagePoint matching (((Matching unit) is A structure) Equal to True))
      • Unit Group - Pick every unit in UnitFlandreVictimGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause UnitFlandre to damage (Picked unit), dealing 125.00 damage of attack type Chaos and damage type Universal
      • Custom script: call DestroyGroup(udg_UnitFlandreVictimGroup)
      • Custom script: set udg_UnitFlandreVictimGroup = null
      • Custom script: call RemoveLocation(udg_UnitFlandreDamagePoint)
      • Custom script: set udg_UnitFlandreDamagePoint = null
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
Best would be to create a global group including all structures matching your filter condition.

Dont destroy this group, just add/remove new/dead structures.

What may causes laggs is that you have filter out a lot of units when enumerating every unit of the map.

Ah! I get it. So I just have to create this said Unit Group, and just destroy it when UnitKoishi dies. How about UnitFlandre? I should just retain it as is because it isn't the "global."
 
Status
Not open for further replies.
Top