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

Spell Request - Cone of Cold

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2017
Messages
8
Hello, talented people. I am fairly new to map making and when working on abilities and spells I tend to make do with as less use of triggers as possible. However, I have run into a wall by not being able to figure how to make this particular spell.

What I want is to basically take the 'Breath of Frost' (or Breath of Fire) spell, make it deal damage and instead of applying periodic damage, I want it to slow the movement of those it hits. I have been told that it would be best to use triggers, I have also been told that making a 'cone-like' effect is pretty damn complicated. I being a trigger-noob have zero chances of making it work, as such I place myself at the mercy of whoever will find themselves with the kindness and time to help me out.

Things of note : This ability is a Hero ability that has 5 levels, however the area of effect and the slow effect remain constant, the only thing that changes with each Lv-up is the damage dealt which is already done in the Object manager. The only thing that needs done is a trigger that causes the targets to become slowed down when they are hit by the spell.
 
Level 4
Joined
Apr 28, 2017
Messages
112
Here it is. I've done it best that I could. Only downside is when you "freeze" the units they won't turn blue as they would when you normally attack them with some frost/cold attack. I've edited slow spell art so it adds a freezing effect instead of the default one.


  • Breath of Frost
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Frost NEW
    • Actions
      • Set locCaster = (Position of (Triggering unit))
      • Set targetPoint = (Target point of ability being cast)
      • Set tempGroup = (Units within 700.00 of locCaster matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Set tempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Angle from locCaster to tempLoc) Greater than or equal to ((Angle from locCaster to targetPoint) - 30.00)
              • (Angle from locCaster to tempLoc) Less than or equal to ((Angle from locCaster to targetPoint) + 30.00)
            • Then - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
              • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_targetPoint)
      • Custom script: call RemoveLocation(udg_locCaster)


EDIT: here's the trigger
 

Attachments

  • FrostSpell.w3x
    22.3 KB · Views: 58
Last edited:
Level 2
Joined
Sep 2, 2017
Messages
8
First of all, thank you SO much for your effort! However, I noticed a problem. Everything works just as intended except the affected units aren't actually slowed. The spell sets off, it hits the intended targets, the buff is applied but their movement speed is unchanged. Weird...
 
Level 4
Joined
Apr 28, 2017
Messages
112
First of all, thank you SO much for your effort! However, I noticed a problem. Everything works just as intended except the affected units aren't actually slowed. The spell sets off, it hits the intended targets, the buff is applied but their movement speed is unchanged. Weird...

Likie millzy said, just replace peasants in test map with some faster units. Or hover over their move/attack speed with the mouse and you will see that their speed turned red (which is proof of itself that they are slowed). Tweak the slow and frost breath damage/lvls in object editor, and in trigger you can tweak the range and angle.


EDIT: Here's the improved slow, using cold arrow (which turns unit blue, so you see they're "frozen").
Now all you have to do is edit the duration and damage of abilities and you're set :)

EDIT2: Fixed the trigger, added Custom script: call RemoveLocation(udg_tempLoc)
 

Attachments

  • FrostSpell.w3x
    22.3 KB · Views: 38
Last edited:
Level 4
Joined
Apr 28, 2017
Messages
112
I will also look at these spells for if this situation arises again. Thank you too.
Keep in mind that the spell is not MUI though. I'll attempt to MUI-ify (?) the trigger (to help me improve my skills).

Well I don't have any expirience in making triggers MUI yet since we don't require it so much for our maps ^^ (M.Z.I series).I only started writing triggers not so long ago. But sure, go ahead and try to improve it!
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Keep in mind that the spell is not MUI though. I'll attempt to MUI-ify (?) the trigger (to help me improve my skills).
The spell is already MUI. Instant spells that have no need to store data through periodic loops or any other sort do not need any type of data structure like dynamic indexing or hashtables because... well the spell is instant.
 
Level 4
Joined
Apr 28, 2017
Messages
112
The spell is already MUI. Instant spells that have no need to store data through periodic loops or any other sort do not need any type of data structure like dynamic indexing or hashtables because... well the spell is instant.

Thanks for clarifying that, didn't know it before ^^. Guess I did well then

EDIT: 1 more thing. Do I need to call custom script to remove that tempLoc too to avoid leaks ?
 
Level 4
Joined
Apr 28, 2017
Messages
112
You need to move the custom script outside of the If/Then/Else. The leak will only be removed if the conditions are met. You also have one leak here:
  • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees

Ok moved the leak. But where's the leak here? I added expiration timer to the unit, so it will disappear after 3 sec
 
Level 4
Joined
Apr 28, 2017
Messages
112
Location -> (Position of (Picked unit))

That was the tempLoc I was refering in my previous post, here's the latest trigger update, see:

EDIT: ahh I saw what you meant now. Here fixed it.


  • Breath of Frost
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Frost NEW
    • Actions
      • Set locCaster = (Position of (Triggering unit))
      • Set targetPoint = (Target point of ability being cast)
      • Set tempGroup = (Units within 700.00 of locCaster matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Set tempLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Angle from locCaster to tempLoc) Greater than or equal to ((Angle from locCaster to targetPoint) - 30.00)
              • (Angle from locCaster to tempLoc) Less than or equal to ((Angle from locCaster to targetPoint) + 30.00)
            • Then - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at tempLoc facing Default building facing degrees
              • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Frost Arrows (Picked unit)
              • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_tempLoc)
      • Custom script: call RemoveLocation(udg_targetPoint)
      • Custom script: call RemoveLocation(udg_locCaster)
 
Last edited:
Level 4
Joined
Apr 28, 2017
Messages
112
Thanks, will keep it in mind in the future. You can edit it yourself for this spell if you want, I gtg to sleep now.

@Zamokra41 Here's the map with MUI/leakless trigger which does everything you wanted. Cheers!

EDIT: added Custom script: call DestroyGroup(udg_tempGroup)
 

Attachments

  • FrostSpell.w3x
    22.4 KB · Views: 50
Last edited:
Status
Not open for further replies.
Top