[Spell] Triggered Locust Swarm

Chocobo

White-Flower
Reaction score
409
For the thread http://www.thehelper.net/forums/showthread.php?t=45018

I made a Triggered Locust Swarm, in which you can refer to each locust unit using [((((Custom value of (Triggering unit)) x 81) + ((<Xst unit) - 1)) mod 81)], I am currently working to get it to work perfectly.

This ability works at half, dummy units never gets removed at end. Someone knows how to do that?

Here is the triggers required :

Code:
Base Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Triggered Locust Swarm 
    Actions
        Set CurrentRegister = (CurrentRegister + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CurrentRegister Equal to 101
            Then - Actions
                Set CurrentRegister = 1
            Else - Actions
        Unit - Set the custom value of (Triggering unit) to CurrentRegister
        Set GetTriggerUnit[CurrentRegister] = (Triggering unit)
        -------- MODIFY WHATEVER NOW --------
        Set SwarmAmount[CurrentRegister] = 20
        Set SwarmDelay[CurrentRegister] = 0.03
        Set SwarmTime[CurrentRegister] = 30.00
        Set LifeStole[CurrentRegister] = 0.75
        Set SwarmUnitId[CurrentRegister] = Infestation
        Set SwarmDistance[CurrentRegister] = 1000.00
        Set UsePreAcquirement[CurrentRegister] = True
        Set AcquirementDistance[CurrentRegister] = 0.00
        Set SeekIfBelow[CurrentRegister] = False
        Set PercentageSeekHp[CurrentRegister] = 0.00
        Set SwarmExplodes[CurrentRegister] = False
        -------- DO NOT MODIFY AFTER --------
        For each (Integer A) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
            Loop - Actions
                Set TrgPos[1] = (Position of (Triggering unit))
                Set RReal[1] = (Random real number between (SwarmDistance[(Custom value of (Triggering unit))] x 0.80) and SwarmDistance[(Custom value of (Triggering unit))])
                Set RReal[2] = (Random real number between 0.00 and 359.99)
                Set TrgPos[2] = (TrgPos[1] offset by RReal[1] towards RReal[2] degrees)
                Unit - Create 1 SwarmUnitId[(Custom value of (Triggering unit))] for (Owner of (Triggering unit)) at TrgPos[1] facing TrgPos[2]
                Unit - Order (Last created unit) to Attack-Move To TrgPos[2]
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SwarmExplodes[(Custom value of (Triggering unit))] Equal to True
                    Then - Actions
                        Unit - Add a (SwarmTime[(Custom value of (Triggering unit))] - (SwarmDelay[(Custom value of (Triggering unit))] x (Real((Integer A))))) second Generic expiration timer to (Last created unit)
                    Else - Actions
                Set SwarmUnits[(((Custom value of (Triggering unit)) x 81) + ((Integer A) - 1))] = (Last created unit)
                Wait SwarmDelay[(Custom value of (Triggering unit))] game-time seconds
        For each (Integer A) from 1 to (Integer((SwarmTime[(Custom value of (Triggering unit))] - (SwarmDelay[(Custom value of (Triggering unit))] x (Real(SwarmAmount[(Custom value of (Triggering unit))])))))), do (Actions)
            Loop - Actions
                Set TrgPos[3] = (Position of (Triggering unit))
                For each (Integer B) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
                    Loop - Actions
                        Set RReal[3] = (Random real number between (SwarmDistance[(Custom value of (Triggering unit))] - (SwarmDistance[(Custom value of (Triggering unit))] x 2.00)) and SwarmDistance[(Custom value of (Triggering unit))])
                        Set RReal[4] = (Random real number between 0.00 and 359.99)
                        Set TrgPos[4] = (TrgPos[3] offset by RReal[3] towards RReal[4] degrees)
                        Set TrgPos[5] = (Position of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        SeekIfBelow[(Custom value of (Triggering unit))] Equal to False
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Distance between TrgPos[3] and TrgPos[4]) Greater than or equal to SwarmDistance[(Custom value of (Triggering unit))]
                                                (Distance between TrgPos[3] and TrgPos[5]) Greater than or equal to SwarmDistance[(Custom value of (Triggering unit))]
                            Then - Actions
                                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Move To TrgPos[3]
                            Else - Actions
                                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Attack-Move To TrgPos[4]
                Wait 1.00 game-time seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is dead) Equal to True
                    Then - Actions
                        For each (Integer B) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
                            Loop - Actions
                                Unit - Kill SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]
                        Skip remaining actions
                    Else - Actions
        For each (Integer A) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
            Loop - Actions
                Set TrgPos[6] = (Position of (Triggering unit))
                Set TrgPos[7] = (Position of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])
                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Move To TrgPos[6]
                Unit - Remove All buffs from SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]
                Unit - Add a ((Distance between TrgPos[6] and TrgPos[7]) / (Current movement speed of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])) second Generic expiration timer to SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]

Code:
Required Trigger 1
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to Required Trigger 3 <gen> the event (Unit - (Picked unit) Takes damage)
                Unit - Set the custom value of (Picked unit) to 1
        Trigger - Destroy (This trigger)

Code:
Required Trigger 2
    Events
        Unit - A unit enters (Entire map)
    Conditions
        And - All (Conditions) are true
            Conditions
                (Custom value of (Triggering unit)) Equal to 0
                (Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]
    Actions
        Trigger - Add to Required Trigger 3 <gen> the event (Unit - (Triggering unit) Takes damage)
        Unit - Set the custom value of (Triggering unit) to 1

Code:
Required Trigger 3
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Damage source)) Equal to SwarmUnitId[(Custom value of (Damage source))]
            Then - Actions
                Unit - Set life of GetTriggerUnit[(Custom value of (Damage source))] to ((Life of GetTriggerUnit[(Custom value of (Damage source))]) + ((Damage taken) x LifeStole[(Custom value of (Triggering unit))]))
            Else - Actions

A file is attached to the post so you can download it.

The Triggered Locust Swarm is able to handle 100 casters, each having a capacity of 81 locust units.
 

Attachments

  • [Spell] Triggered Locust Swarm.w3x
    107.2 KB · Views: 170

SFilip

Gone but not forgotten
Reaction score
634
Uh please make it so that it doesn't require WEU. :rolleyes:
 

Sim

Forum Administrator
Staff member
Reaction score
534
And - All (Conditions) are true
Conditions
(Custom value of (Triggering unit)) Equal to 0
(Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]

Conditions up there are already considered "And" conditions. You can remove the "and" part.
 

Chocobo

White-Flower
Reaction score
409
And - All (Conditions) are true
Conditions
(Custom value of (Triggering unit)) Equal to 0
(Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]

Conditions up there are already considered "And" conditions. You can remove the "and" part.

Ok, didn't see I wrote And in normal conditions.


For that line :

Code:
                Unit - Add a ((Distance between TrgPos[6] and TrgPos[7]) / (Current movement speed of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])) second Generic expiration timer to SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]

Do you know what the problem in it? It never worked.



Uh please make it so that it doesn't require WEU

Hmm? I didn't use WEU. I only used WE Helper without the LikeWEU.dll. :nuts: Or am I wrong?


Anyway it looks nice. I didn' t get it why there were two Locust Swarms.. then I realized it was for comparing, silly me Nice work !

Two locust swarms : One for Triggered, one for Normal. See the big differance between them, but this works REALLY fine. Need to fix the duration problem for locust units.
 

SFilip

Gone but not forgotten
Reaction score
634
> Or am I wrong?
Either that or something is seriously wrong with my editor.
weuhf2.jpg

Well if you simply disabled LikeWEU then that's not enough, vexorian figured out that disabling one plugin results in disabling something else...could be fixed in 1.6 though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top