Help me Clean up my spell

lindenkron

You can change this now in User CP
Reaction score
102
Leaks, things that can be improved / made difference, any input (that is relevant) is appreciated.

Trigger:
  • ShiveringFeeling
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shivering Experience
    • Actions
      • Set i = 3.00
      • Set TempLocation = (Target point of ability being cast)
      • Set TempGroup = (Units within 250.00 of TempLocation)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
            • Then - Actions
              • Unit - Set (Picked unit) movement speed to ((Current movement speed of (Triggering unit)) mod 2.00)
              • Animation - Change (Picked unit)'s size to (80.00%, 8.00%, 80.00%) of its original size
            • Else - Actions
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Wait 0.05 seconds
          • Set TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] = (TempLocation offset by (Random real number between 0.00 and 250.00) towards (Random angle) degrees)
          • Special Effect - Create a special effect at TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
          • Set SpecialEffect = (Last created special effect)
          • Trigger - Run DestroyEffect <gen> (ignoring conditions)
          • Custom script: call RemoveLocation(udg_TempPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
          • Set TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] = (TempLocation offset by (Random real number between 0.00 and 250.00) towards (Random angle) degrees)
          • Special Effect - Create a special effect at TempPoint[((Integer A) + (Player number of (Owner of (Casting unit))))] using Abilities\Weapons\DragonHawkMissile\DragonHawkMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • Environment - Create a 2.00 second random deformation at TempLocation with radius 250.00, using depths between -32.00 and 32.00, updating every 0.20 seconds
          • Environment - Stop (Last created terrain deformation) over 0.50 seconds
          • Custom script: call RemoveLocation(udg_TempPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
          • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 250.00 at TempLocation, dealing 5.00 damage of attack type Spells and damage type Normal
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
            • Then - Actions
              • Unit - Set (Picked unit) movement speed to (Default movement speed of (Triggering unit))
              • Animation - Change (Picked unit)'s size to (100.00%, 100.00%, 100.00%) of its original size
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempLocation)


Trigger:
  • DestroyEffect
    • Events
    • Conditions
    • Actions
      • Custom script: local effect tempEffect
      • Custom script: set tempEffect = udg_SpecialEffect
      • Set i = (i - 0.15)
      • Wait i seconds
      • Custom script: set udg_SpecialEffect = tempEffect
      • Custom script: call DestroyEffect( udg_SpecialEffect )


In advance,
Thanks
-Lindenkron
 

darkbeer

Beer is Good!
Reaction score
84
waits in an integer A loop can cause you some problems if you have any other integer A loop running while your trigger is running so better use a integer variable.

put setting of i inside the loop, since you have waits there other triggers will interfere as well. (unless youre using the destroy effect thing only for this trigger)

also does TempGroup always stay the same for 1 second?
i doubt it, so there can be bugs here as well and the units wont be resizedand get their normal movement speed. (if any other trigger is using tempgroup while this one is running it wont)

to avoid that use a local group.

hm im not sure but i think its better if you use a slow spell and a dummy to slow units, what if the current moemnt speed f the unit is affected by some buff or items, dont know if the default movemnt speed will include that. So not sure about this.

Note: Waits arent very accurate and not suited for very small values so yours will probably wait for around 0.2 seconds instead of 0.05 but if you dont have a problem with that then its okay :)
 

lindenkron

You can change this now in User CP
Reaction score
102
Hmm okay, thanks. Ill look into it.

Also, could you give me some suggestions on how to make it MUI? Kinda needed for spells :)
 

X-maul

AKA: Demtrod
Reaction score
201
if you want it MUI, then make all your Variables area, and then make the area' [Player number of owner of triggering unit], that might help
 

darkbeer

Beer is Good!
Reaction score
84
well using locals is enough for this i guess^^

basically we create a local for everything we need after the wait and set our Globals to the locals after each wait. Same principle you used in the destroy effect trigger.

Code:
    * ShiveringFeeling
          o Events
                + Unit - A unit Starts the effect of an ability
          o Conditions
                + (Ability being cast) Equal to Shivering Experience
          o Actions
                + Custom script: local group g
                + Custom script: local integer i = 1
                + Custom script: local location loc
                + Set i = 3.00
                + Set TempLocation = (Target point of ability being cast)
                + Custom script: set loc = udg_TempLocation
                + Set TempGroup = (Units within 250.00 of TempLocation)
                + Unit Group - Pick every unit in TempGroup and do (Actions)
                      # Loop - Actions
                            * If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  o If - Conditions
                                        + ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
                                  o Then - Actions
                                        + Unit - Set (Picked unit) movement speed to ((Current movement speed of (Triggering unit)) mod 2.00)
                                        + Animation - Change (Picked unit)'s size to (80.00%, 8.00%, 80.00%) of its original size
                                  o Else - Actions
                 + Custom script: set g = udg_TempGroup
                 + Custom script: loop //a loop^^
                            * Custom script: exitwhen i > 20 // does this 20 times
                            * Wait 0.05 seconds
                            * Custom script: set udg_TempLocation = loc // getting our old location
                            * Custom script: set bj_forLoopAIndex = i //sets integerA to the value of our local integer i
                            * Set TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] = (TempLocation offset by (Random real number between 0.00 and 250.00) towards (Random angle) degrees) // dont really get this^^ why does TempPoint need an array? and why the + Player number thing
                            * Special Effect - Create a special effect at TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] using Abilities\Spells\Other\Drain\ManaDrainTarget.mdl
                            * Set SpecialEffect = (Last created special effect)
                            * Trigger - Run DestroyEffect <gen> (ignoring conditions)
                            * Custom script: call RemoveLocation(udg_TempPoint[[COLOR="Red"]bj_forLoopAIndex +[/COLOR] GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) // wheres the integerA in the array which you used before?
                            * Set TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] = (TempLocation offset by (Random real number between 0.00 and 250.00) towards (Random angle) degrees)
                            * Special Effect - Create a special effect at TempPoint[((Integer A) + (Player number of (Owner of (Casting unit))))] using Abilities\Weapons\DragonHawkMissile\DragonHawkMissile.mdl
                            * Special Effect - Destroy (Last created special effect)
                            * Environment - Create a 2.00 second random deformation at TempLocation with radius 250.00, using depths between -32.00 and 32.00, updating every 0.20 seconds
                            * Environment - Stop (Last created terrain deformation) over 0.50 seconds
                            * Custom script: call RemoveLocation(udg_TempPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
                            * Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 250.00 at TempLocation, dealing 5.00 damage of attack type Spells and damage type Normal
                            * Custom script: set i = i + 1
                + Custom script: set udg_TempGroup = g
                + Unit Group - Pick every unit in TempGroup and do (Actions)
                      # Loop - Actions
                            * If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  o If - Conditions
                                        + ((Picked unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True
                                  o Then - Actions
                                        + Unit - Set (Picked unit) movement speed to (Default movement speed of (Triggering unit))
                                        + Animation - Change (Picked unit)'s size to (100.00%, 100.00%, 100.00%) of its original size
                                  o Else - Actions
                + Custom script: call DestroyGroup(udg_TempGroup) // this should destroy both groups i think
                + Custom script: call RemoveLocation(udg_TempLocation)
                + Custom script: call RemoveLocation(loc)
                + Custom script: set loc = null
                + Custom script: set g = null

EDIT: @ X-Maul isnt that called MPI?

EDIT2: @ Windwalk ... thats what he did there^^
 

Windwalk

New Member
Reaction score
8
Trigger:
  • Set TempPoint[((Integer A) + (Player number of (Owner of (Triggering unit))))] = (TempLocation offset by (Random real number between 0.00 and 250.00) towards (Random angle) degrees)
this leaks

when its offset by (REAL) towards (w/e) the offset will cause a leak..

just set another variable

Set TempPoint2 = TempPoint offset by w/ew/e

and destroy it later
 

lindenkron

You can change this now in User CP
Reaction score
102
Thanks darkbeer, I'll look into this later on :) It's kind of a site project when I'm not 'into' something else. At the moment I'm having the major issues with my bomb in the current map I'm working on. If it wouldn't be to much to ask, could you take a look at it? It's called changing ownership to custom value. :eek:

In advance,
Thanks
-Lindenkron
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top