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

Purification Bomb v1.1.3x

PURIFICATION BOMB
"LAST M.A.D.M.A.N STANDING."

REQUIRES REFORGED PATCH TO OPEN MAP

ABILITY INFORMATION:
Channels destructive energy for 5 seconds from self. Afterward, detonates a destructive pure energy to a huge radius dealing pure damage to all units within radius. The damage increases as distance increases, capped at 2000 range. Canceled if killed before explosion.
Level 1 - 100 base damage at the center. 10 damage increase per circle. Total of 3 explosion directions
Level 2 - 200 base damage at the center. 20 damage increase per circle. Total of 5 explosion directions
Level 3 - 300 base damage at the center. 30 damage increase per circle. Total of 18 explosion directions

INSTALLATION GUIDE:
0. Enable 'Automatically Create Variables while Pasting Trigger Data' in Fil > Preference > General
1. Copy the Purification Bomb ability in Object Editor
2. Paste the ability to your map's Object Editor
3. Copy the Purification Bomb folder in Trigger Editor
4. Paste the folder in your map's Trigger Editor
5. DONE! If you want to configure things, just modify the PB Config trigger

MEDIA SHOWCASE:

CHANGELOG:
1.1.3x:
Updated Installation Guide
1.1.3:
Changed Unit Indexer method to Dynamic Indexing that I provided for a user in the past, fixing a critical bug mentioned by Wrda
Due to the map for this copy being based on 1.32, the spell now needs a 1.32+ editor to open.
1.1.2:
Added a warning to the spell
1.1.1x:
Just updating the description, no changes to the spellwork
1.1.1:
Added the forgotten credit section
1.1:
Added counter to replace unit count from group
Added timer for channel effect loop
Changed point effect to attachment effect for initial explosion and channeling effect
Changed PB_Timeout to cast variable
Changed angle calculation to an init trigger
Separate config and initialization to make them clear
1.0:
First Release

CREDIT:
Mentalmeisters - Original Idea
Bribe - Unit Indexer



If you like this work and wish to support me financially, you can support me via Ko-fi.
Contents

Purification Bomb v1.1 DynIndex (Map)

Reviews
Wrda
You can Remove the action that sets the variable to 0.00 since you're using it on the deindexing part (below stage 2). If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions PB_ExpTravelRange[PB_Index]...
Level 20
Joined
Aug 13, 2013
Messages
1,696
By just previewing triggers, (I don't use 1.31+ yet)

Why time out is on a custom script and seperated on those configs? for precision?
You might want to include this as the user must configure the number of iterations.

  • Set VariableSet PB_Point = (Position of PB_Unit)
  • Special Effect - Create a special effect at PB_Point using PB_ChannelExpSFX
  • Special Effect - Destroy (Last created special effect)
  • Custom script: call RemoveLocation(udg_PB_Point)
^You can discard point here and use on unit's origin instead.
(the caster doesn't move unless it's forced to by the way,
you must also consider flying casters to not spawn the effect on ground or else it may look weird.
plus you have no location to deal with this)

  • Set VariableSet PB_AngleDistance = (360.00 / (Real(PB_Splitter[PB_Level[PB_Index]])))
^Can be calculated once on initialization.

  • Trigger - Run PB_FilterTrigger (checking conditions)
^Why filtering is seperated just to make it configurable? you can just directly refer the conditions inside the unit group and make use of boolean config variables instead, it's much faster for the user to configure the filtration this way. Also exclude dead units by default.

I suggest to make a configuration of rate for that spamming caster effect.
Also make use of integers for enabling and disabling triggers instead of count units function per loop.

Overall, the spell concept is pretty much used I think ('channels then boom' mechanic)
the only notable here is the configurations for its spawned effects which is good by the way.
 
Thanks for the feedback!

By just previewing triggers, (I don't use 1.31+ yet)

Why time out is on a custom script and seperated on those configs? for precision?
You might want to include this as the user must configure the number of iterations.

  • Set VariableSet PB_Point = (Position of PB_Unit)
  • Special Effect - Create a special effect at PB_Point using PB_ChannelExpSFX
  • Special Effect - Destroy (Last created special effect)
  • Custom script: call RemoveLocation(udg_PB_Point)
^You can discard point here and use on unit's origin instead.
(the caster doesn't move unless it's forced to by the way,
you must also consider flying casters to not spawn the effect on ground or else it may look weird.
plus you have no location to deal with this)

  • Set VariableSet PB_AngleDistance = (360.00 / (Real(PB_Splitter[PB_Level[PB_Index]])))
^Can be calculated once on initialization.

  • Trigger - Run PB_FilterTrigger (checking conditions)
^Why filtering is seperated just to make it configurable? you can just directly refer the conditions inside the unit group and make use of boolean config variables instead, it's much faster for the user to configure the filtration this way. Also exclude dead units by default.

I suggest to make a configuration of rate for that spamming caster effect.
Also make use of integers for enabling and disabling triggers instead of count units function per loop.

Overall, the spell concept is pretty much used I think ('channels then boom' mechanic)
the only notable here is the configurations for its spawned effects which is good by the way.

It's technically the timer used for the loop and I prefer users to not touch that. Any better variable naming I can use so I can be more specific? I can consider shifting it to be user-change-able. Also, yes, I need that precision.

Good point there. It must be the laziness that I go with that route.

Technically true, but then I have to make said variable an index so it can be used in the loop. I doubt it's that operation heavy, though I'll consider it.

Pretty much a practice I have done recently for newer entries. I find having a separate trigger where configs are located help users configure without getting through all the main code. Oh yeah, I will exclude those.

Yeah, pretty overused concept to be honest. I just find this fun to code and allows me to improve my coding skills. Just learned to use channeling spells properly without Bribe's SpellEvent, so this is mostly for me to train my coding skills.
 
Last edited:
Updated.

1.1:
Added counter to replace unit count from group
Added timer for channel effect loop
Changed point effect to attachment effect for initial explosion and channeling effect
Changed PB_Timeout to cast variable
Changed angle calculation to an init trigger
Separate config and initialization to make them clear

@Directive255 yeah, pretty much looted from that. The fact using numbers can make some interesting patterns allows me to create some interesting different ones though ^^
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
I don't think you need PB_InitTrigger variable at all. Copying PB Initialization's trigger's contents and pasting at the end of config would turn out to be simpler. Maybe you did this because of possible trigger renaming?
There's a bug: At a certain point of spamming the hotkey R of the ability (you don't actually need to spam for this to happen, just have to click fast enough) will be reactivated while it is still ongoing, which will complete the rest of the "explosion spots" of the previous cast. Curiously, somehow the unit casts the ability for the third time, this time without any user interference, I don't know why.

The spell is nice, although I have to say, is it intended to be a full kamikaze spell? It targets the caster and allies. The caster appears to take nearly 1300 damage.
However, that first part of the bug should be solved first.
 
I don't think you need PB_InitTrigger variable at all. Copying PB Initialization's trigger's contents and pasting at the end of config would turn out to be simpler. Maybe you did this because of possible trigger renaming?
There's a bug: At a certain point of spamming the hotkey R of the ability (you don't actually need to spam for this to happen, just have to click fast enough) will be reactivated while it is still ongoing, which will complete the rest of the "explosion spots" of the previous cast. Curiously, somehow the unit casts the ability for the third time, this time without any user interference, I don't know why.

The spell is nice, although I have to say, is it intended to be a full kamikaze spell? It targets the caster and allies. The caster appears to take nearly 1300 damage.
However, that first part of the bug should be solved first.
The Kamikaze is intentional since it is meant for caster to be killed in the original source. I cannot recall exactly why for the PB_InitTrigger, but I am sure it is because sometimes I encounter copy-paste error so minimizing them is helpful.

I will take a look at this issue, though it might be related with Unit Indexer. I'll check Dynamic Indexing copy if this issue actually tied to Unit Indexer or something else from the code.
 
@Wrda I figured out the first bug and it is tied to how Unit Indexer works since the spell relies completely on them. In Unit Indexer, two separate instances are treated as one instance due to dependant on the unit, not the spell instance. For the InitTrigger, the idea is to ensure less red flashing on copying, (gen) tends to leave red mark when importing, though I am not sure if my approach is better than just let it point to the trigger directly.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
Perhaps the easiest way to fix is to have a boolean array setting when the unit is channeling/has started spell and when really ends, meaning it will only truly end when the explosions reach the max range and not when the first explosion happens.
The second problem might be just solvable if the ability cooldown is slightly longer than the channeling.
 
Perhaps the easiest way to fix is to have a boolean array setting when the unit is channeling/has started spell and when really ends, meaning it will only truly end when the explosions reach the max range and not when the first explosion happens.
The second problem might be just solvable if the ability cooldown is slightly longer than the channeling.
Cooldown longer than channeling is not solving core problem in my opinion, while the boolean array is an approach I can try look up. However, I think I stick with Dynamic Indexing now.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
Cooldown longer than channeling is not solving core problem in my opinion,
To be clear, this was a way to solve the unit casting the ability a 3rd time due to spamming/clicking very fast on the ability when it's almost out of cooldown. It casts the 3rd time, without any user intervention (order), if, and only if, the 2nd cast is done near the moment the ability is up.
Also, I've just found out that making follow through time 4.999s will solve this issue, without increasing the cooldown, at the cost of not being 100% accurate 5s channeling. This issue is independent from the other one mentioned.
Dynamic Indexing version sounds good too.
 
To be clear, this was a way to solve the unit casting the ability a 3rd time due to spamming/clicking very fast on the ability when it's almost out of cooldown. It casts the 3rd time, without any user intervention (order), if, and only if, the 2nd cast is done near the moment the ability is up.
Also, I've just found out that making follow through time 4.999s will solve this issue, without increasing the cooldown, at the cost of not being 100% accurate 5s channeling. This issue is independent from the other one mentioned.
Dynamic Indexing version sounds good too.
Ah, so there are two issues. This is mind-numbing.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
You can Remove the action that sets the variable to 0.00 since you're using it on the deindexing part (below stage 2).
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • PB_ExpTravelRange[PB_Index] Greater than or equal to PB_MaxRange[PB_Level[PB_Index]]
    • Then - Actions
      • Set VariableSet PB_ExpTravelRange[PB_Index] = 0.00 <--- this
      • Custom script: call RemoveLocation(udg_PB_ExplosionSpot[udg_PB_Index])
      • -------- Deindexing --------
      • -------- Stage 1 --------
      • Set VariableSet PB_Source[PB_Index] = PB_Source[PB_MaxIndex]
      • Set VariableSet PB_Level[PB_Index] = PB_Level[PB_MaxIndex]
      • Set VariableSet PB_DurationRemaining[PB_Index] = PB_DurationRemaining[PB_MaxIndex]
      • Set VariableSet PB_Stage[PB_Index] = PB_Stage[PB_MaxIndex]
      • Set VariableSet PB_ChannelingSFXTimer[PB_Index] = PB_ChannelingSFXTimer[PB_MaxIndex]
      • -------- Stage 2 --------
      • Set VariableSet PB_ExplosionSpot[PB_Index] = PB_ExplosionSpot[PB_MaxIndex]
      • Set VariableSet PB_PreservedAngle[PB_Index] = PB_PreservedAngle[PB_MaxIndex]
      • Set VariableSet PB_ExpTravelRange[PB_Index] = PB_ExpTravelRange[PB_MaxIndex]
      • Set VariableSet PB_ExplosionDamage[PB_Index] = PB_ExplosionDamage[PB_MaxIndex]
      • -------- Finishing --------
      • Set VariableSet PB_Index = (PB_Index - 1)
      • Set VariableSet PB_MaxIndex = (PB_MaxIndex - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PB_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
    • Else - Actions
A nice explosive spell with effects forming different shapes, suitable for bombastic maps.

Approved
 
Top