• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Stacking movement speed reduction effect

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2008
Messages
346
I'm trying to make a channeling spell which hero can moves while doing it. everything is ok but this:
this is the periodic event of my spell
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
  • Actions
    • -------- Loop through the unit group of the example spell. --------
    • Unit Group - Pick every unit in SUPER_DOOPER_GROUP and do (Actions)
      • Loop - Actions
        • -------- Select the picked unit. --------
        • Set HANDLE_INDEX_UNIT = (Picked unit)
        • -------- Get the index of the picked unit. --------
        • Custom script: set udg_HANDLE_INDEX_OBJECT=udg_HANDLE_INDEX_UNIT
        • Trigger - Run HANDLE_INDEX_GETID (ignoring conditions)
        • -------- Generic example spell stuff. --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • SUPER_DOOPER_TIME[HANDLE_INDEX_ID] Greater than 0.00
          • Then - Actions
            • -------- Substract one second... --------
            • Set SUPER_DOOPER_TIME[HANDLE_INDEX_ID] = (SUPER_DOOPER_TIME[HANDLE_INDEX_ID] - 1.00)
            • -------- Get the position of the caster... --------
            • Set TempLoc = (Position of (Picked unit))
            • Set TempUnit = (Picked unit)
            • -------- Create the tunderclap effect. --------
            • -------- Get all units in the near of your caster. --------
            • Custom script: set bj_wantDestroyGroup=true
            • Unit Group - Pick every unit in (Units within 250.00 of TempLoc) and do (Actions)
              • Loop - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Owner of TempUnit) is an enemy of (Owner of (Picked unit))) Equal to True
                  • Then - Actions
                    • Unit - Cause TempUnit to damage (Picked unit), dealing 25.00 damage of attack type Spells and damage type Normal
                    • Unit - Set (Picked unit) movement speed to ((Current movement speed of (Picked unit)) - (((Current movement speed of (Picked unit)) x 15.00) / 100.00))
                  • Else - Actions
                • Unit - Set (Picked unit) movement speed to 300.00
            • Custom script: call RemoveLocation(udg_TempLoc)
          • Else - Actions
            • -------- Remove unit from the unit group of the example spell. --------
            • -------- No need to clean anything up. --------
            • Unit - Set (Picked unit) movement speed to 300.00
            • Unit Group - Remove (Picked unit) from SUPER_DOOPER_GROUP
    • -------- Turn the trigger off if there aren't any units in the unit group. --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in SUPER_DOOPER_GROUP) Equal to 0
      • Then - Actions
        • Special Effect - Destroy SpecialEffect[HANDLE_INDEX_ID]
        • Special Effect - Destroy SpecialEffect[(HANDLE_INDEX_ID + 1)]
        • Trigger - Turn off (This trigger)
      • Else - Actions
every second, I need the enemy units close to me to get movement speed reduction. like this procedure:

1. second- -%15 reduction
2. second- -%30 reduction
3. second- -%45 reduction..and so on....at the -%75 state I want them freezed for 6 seconds. btw, if an unit gets out of the spell range when its at for example -%30 state, the buff still gonna take long for like 3 seconds.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
This is something that'd probably be quite complicated to do in GUI(much more complicated than in vJASS, actually), but I'll try to explain it anyway.

Essentially you need 3 functionalities:
1. A periodic area effect that applies #2
2. A system for slows, which supports setting duration and slow amount.
3. A way to stun any unit that has been slowed for a certain amount.

So logically you'd have a trigger for each of those. (the last one actually doesn't need to be in a separate trigger)
You'd also need some object editor stuff. Let's start with this.

Make an ability based on slow aura(tornado). Make it have as many levels as many times you want the slow stack. Set the slow amount for each level and don't forget to set targets allowed to "self" for every level.
You also need a dummy stun ability. You can base it on firebolt, just remove damage, make missile speed very high and remove missile art.

You will also need a few variables:
Unit array for slowed units
Integer array that says how many slow stacks each slowed unit has
Integer that says how many units are currently slowed.

So back to the triggers. The first trigger is similar to what you have, except smaller. Essentially you want the trigger to do those things:
1. Loop through all units that have the aura
2. For each unit that has it you pick units around it that match some criteria.
3. For each picked unit you loop through the list of all units slowed by this ability to find if it's in the list. If not, add it. If it is, then increase its' slow stacks by 1 along with ability level(except if limit has been reached) and set remaining duration to 3 seconds (typically means 96 ticks in my systems. It depends on accuracy). If slow stacks have now reached a certain amount, then you stun the unit with a dummy caster.

The next trigger is also a looping trigger. I would put the timeout to 0.03, but if you don't need such accuracy for the slow's removal, then you can use a higher timeout.
This trigger loops through every slowed unit and sets its current ticks(duration) to 1 less than it currently is. After that it checks if the remaining ticks for this unit < 0. If so, it removes the unit from the system.

Helpful links(might be necessary for understanding my post):
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/visualize-dynamic-indexing-241896/
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=26751
 
Level 8
Joined
Jun 13, 2008
Messages
346
damn this is way too complicated and beyond my capabilities...btw its supposed to be this spell: http://www.wowhead.com/spell=108200/remorseless-winter

So you say I shouldn't use this then:
  • Unit - Set (Picked unit) movement speed to ((Current movement speed of (Picked unit)) - (((Current movement speed of (Picked unit)) x 15.00) / 100.00))
so this really means using another loop for this...using dummy and stuff...shit this really should be done with jass.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
every second: add slow aura to unit in range + increase level (before add)
when level is 5 (which is max) you make a dummy and stun the target. (check must be done before increasing the level ofc)
slow aura must be only self hit...

Works?

I know it is not a nice way but as long as he doesn't want jass or use a system for the movement of ALL units... this should be fine.
 
Level 8
Joined
Jun 13, 2008
Messages
346
I did this and it worked...its shame that duration of tornado slow doesnt take effect though:(...cuz that slow is supposed to last 3 seconds.


  • Unit Group - Pick every unit in (Units within 250.00 of TempLoc) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of TempUnit) is an enemy of (Owner of (Picked unit))) Equal to True
        • Then - Actions
          • Unit - Cause TempUnit to damage (Picked unit), dealing 25.00 damage of attack type Spells and damage type Normal
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Tornado (Slow Aura)) Not equal to True
            • Then - Actions
              • Unit - Add Remorseless Slow Effect to (Picked unit)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Remorseless Slow Effect for (Picked unit)) Less than 5
            • Then - Actions
              • Unit - Increase level of Remorseless Slow Effect for (Picked unit)
            • Else - Actions
              • -------- Do freeze effect... --------
        • Else - Actions
but couldn't figure out where to remove the slow effect from those picked units since its a dynamic loop. btw Im thinking to use this freeze tigger instead of using dummy and stun.

http://www.hiveworkshop.com/forums/...ts-like-dota-chronosphere-120176/#post1043076
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yea except that the freeze trigger does not allow other pause/unpause triggers.

To remove the slow effect, you should use timers... you could also use my Effect Over Time System (in my signature) which could be easier to use but requires some additional abilities and configuration to be made.

For the trigger you could also put it all together in this order:
Check if picked unit has level 6 of slow
- Freeze unit.
Increase level of slow.
Add slow to unit.
 
Level 8
Joined
Jun 13, 2008
Messages
346
but how its gonna increase the level of that ability if its not added first?...and if its gonna be more effective I'd like to use your system in this spell.

edit: it worked:)...now its time to remove the effect after 3 sec and find a way to freeze those units.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can use the freeze that you showed but I dislike the system of pause.
Especcially unpause. Because it does not work well with other pausez:
A unit get paused for 6 seconds.
3 seconds later he gets paused for 6 seconds by another spell.
3 seconds later he is free to walk around because both pausez are removed by the first spell.

Just be carefull.

You could use an array of timers associated to the units but it will get complicated very fast. However, you do not require any more data.
You can download my Effect Over Time System there and you should have something like this as a trigger:
  • Set TempUnitGroup = (Units within 250.00 of TempLocation)
  • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A structure) Equal to False
          • ((Picked unit) belongs to an enemy of TempPlayer) Equal to True
        • Then - Actions
          • Set EOT_Param_Target = (Picked unit)
          • Set EOT_Param_Ability = Ice Aura (Spell Book)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • EOT_Param_Ability_Level Greater than or equal to 6
                • Then - Actions
                  • -------- STUN --------
                • Else - Actions
              • Set EOT_Param_Duration = 3.00
              • Set EOT_Param_Ability_Level = (EOT_Param_Ability_Level + 1)
              • Trigger - Run EOT_Trigger_Save_Data (ignoring conditions)
            • Else - Actions
              • Set EOT_Param_Source = (Triggering unit)
              • Set EOT_Param_Duration = 3.00
              • Set EOT_Param_Interval = 1.00
              • Set EOT_Param_Hidden = False
              • Set EOT_Param_Buff = Custom Ice Aura
              • Set EOT_Param_Buff_Holder = Ice Aura (Buff Holder)
              • Special Effect - Create a special effect attached to the chest of EOT_Param_Target using Abilities\Spells\Undead\FrostArmor\FrostArmorTarget.mdl
              • Set EOT_Param_Special_Effect = (Last created special effect)
              • Set EOT_Param_Ability_Level = 1
              • Set EOT_Param_Positive = False
              • Set EOT_Param_Type = EOT_Type_Empty
              • Set EOT_Param_Existing_EOT_Handler = EOT_EEH_Override
              • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
        • Else - Actions
As you can see, you need a lot of data but it is a powerfull system and it will do exacly what you want.
 
Level 8
Joined
Jun 13, 2008
Messages
346
I see your point..so I should use stun after all. But using a freeze system with pauses would just be a temporary solution to me since there is no any other spell in my map that uses pause-unpause.
Your system seems very cool...generally consuming more space actually provides better performance, more quicker...or I just want to believe that:p. I'll let you know about results:)
 
Level 8
Joined
Jun 13, 2008
Messages
346
I'm getting compile errors on undeclared variables...I copied all of them but still seems like It can't copy all variables...and also copied map header.besides, I don't know what is that spell book for?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I don't really know what variable you are missing...
Because you know... the test map works and this is the first time that someone has this problem.
Make sure you have all variables copied properly.

The spell book is for the buff. However you already have a buff on your slow aura, so you could make the EOT Hidden... just "Set EOT_Param_Hidden = true"
You make a spell book and put your slow aura in that book and give the book to the unit.
Set EOT_Param_Ability = (Your Spellbook)
Make sure that you disable the spell book for all players.
 
Level 8
Joined
Jun 13, 2008
Messages
346
for example EOT_Effect_Search_Limit integer variable was not copied automatically when I copied all the triggers in the map so I had to declare it myself in mine. But am gonna try it again with default WE to be sure.
edit: its really interesting...my editor doesn't create variables automatically that are defined in jass code..so it wasn't about your system at all.
 
Last edited:
Level 8
Joined
Jun 13, 2008
Messages
346
I finished it. Thanks Wietlol.+rep btw

couldn't manage to make the units' animation 0 though. this is the part you gave...I modified it due to your directions.

  • Unit Group - Pick every unit in (Units within 250.00 of TempLoc) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of TempUnit) is an enemy of (Owner of (Picked unit))) Equal to True
        • Then - Actions
          • Set EOT_Param_Target = (Picked unit)
          • Set EOT_Param_Ability = Remorseless Spell book (Spell Book)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • EOT_Param_Ability_Level Greater than or equal to 6
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of TempUnit) at (Position of TempUnit) facing Default building facing degrees
                  • Set Remorseless_DUMMU[HANDLE_INDEX_ID] = (Last created unit)
                  • Unit - Add Remorseless STUN to (Last created unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                  • Trigger - Run Remorseless STUN <gen> (ignoring conditions)
                • Else - Actions
              • Set EOT_Param_Duration = 3.00
              • Unit - Cause TempUnit to damage (Picked unit), dealing 25.00 damage of attack type Spells and damage type Normal
              • Set EOT_Param_Ability_Level = (EOT_Param_Ability_Level + 1)
              • Trigger - Run EOT_Trigger_Save_Data (ignoring conditions)
            • Else - Actions
              • Set EOT_Param_Source = TempUnit
              • Set EOT_Param_Duration = 3.00
              • Set EOT_Param_Interval = 1.00
              • Set EOT_Param_Hidden = True
              • Set EOT_Param_Buff = Tornado (Slow Aura)
              • Set EOT_Param_Buff_Holder = Remorseless Slow Effect
              • Special Effect - Create a special effect attached to the chest of EOT_Param_Target using Abilities\Spells\Undead\FrostArmor\FrostArmorTarget.mdl
              • Set EOT_Param_Special_Effect = (Last created special effect)
              • Set EOT_Param_Ability_Level = 1
              • Set EOT_Param_Positive = False
              • Set EOT_Param_Type = EOT_Type_Empty
              • Set EOT_Param_Existing_EOT_Handler = EOT_EEH_Override
              • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)
        • Else - Actions
this is the freeze thing:

  • Remorseless STUN
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SUPER_DOOPER_GROUP and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Remorseless Stun (Pause)) Equal to True
            • Then - Actions
              • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
            • Else - Actions
              • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
              • Trigger - Turn off (This trigger)
but units still keep animate...don't know if its caused by stun's itself
 
Status
Not open for further replies.
Top