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

How to increase the size of spell effects using triggers

Status
Not open for further replies.
Level 9
Joined
Apr 22, 2020
Messages
430
Hello guys how do i increase the size of spell of effects i guess in using triggers? For example the shadow Strike spell when you cast it on an enemy there is like a wierd black bat on top of the units head so how do i increase the size of it?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
You can't do that through triggers.

You can, however, modify special effects that were created through triggers like this:
  • Actions
    • Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    • Special Effect - Set Scale of (Last created special effect) to 2.00
Unfortunately, special effects attached to units CANNOT be scaled using this method. Although, some people have said that they've gotten it to work. Maybe it depends on the type of special effect.
  • Actions
    • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
    • Special Effect - Set Scale of (Last created special effect) to 2.00
Some other options you have related to scaling effects (found in the Object Editor):
1) Change the unit's Scaling Value and set Art - Scale Projectiles to True
2) Give the unit a Required Animation Name - Attachment. See the Mountain Giant for example, it has "large" under this field in the Object Editor which scales the size of effects on it.
 
Level 9
Joined
Apr 22, 2020
Messages
430
You can't do that through triggers.

You can, however, modify special effects that were created through triggers like this:
  • Actions
    • Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
    • Special Effect - Set Scale of (Last created special effect) to 2.00
Unfortunately, special effects attached to units CANNOT be scaled using this method. Although, some people have said that they've gotten it to work. Maybe it depends on the type of special effect.
  • Actions
    • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
    • Special Effect - Set Scale of (Last created special effect) to 2.00
Some other options you have related to scaling effects (found in the Object Editor):
1) Change the unit's Scaling Value and set Art - Scale Projectiles to True
2) Give the unit a Required Animation Name - Attachment. See the Mountain Giant for example, it has "large" under this field in the Object Editor which scales the size of effects on it.
I have a very dumb question here where can i find the special effect - set scale?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
There's many ways of doing so, all involving triggers.

One of the most basic ways:
  • Frost Armor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frost Armor (Autocast)
      • ((Target unit of ability being cast) is in FrostArmor_Group.) Equal to False
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to FrostArmor_Group
      • Unit - Add Item Life Regeneration to (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Frost Armor Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Frost Armor Loop <gen>
        • Else - Actions
  • Frost Armor Loop
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FrostArmor_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 Frost Armor) Equal to False
            • Then - Actions
              • Unit - Remove Item Life Regeneration from (Picked unit)
              • Unit Group - Remove (Picked unit) from FrostArmor_Group.
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (FrostArmor_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
So when you target a unit with Frost Armor, and it isn't already in the Frost Armor Group (a Unit Group variable), I add the Life Regen ability to it (based on the item ability) and add it to the unit group. Then I turn on the Frost Armor Loop trigger (but first I check to see if that's even necessary).

Then in the Loop trigger I periodically check each unit in the Frost Armor unit group to see if they still have the Frost Armor buff. If they no longer have the buff then the Life Regen ability is removed and they're removed from the Unit Group. Finally, I check to see if the Unit Group is empty, and if it is I turn off Frost Armor Loop for the time being (it will be turned back on once you cast Frost Armor again).

Note: Frost Armor Loop is Initially Off (checkbox near the top of the trigger, to the right of Enabled). This is so that the loop trigger is only on when a unit has the Frost Armor buff, which helps with performance. There's no need to check every 0.25 seconds if we know for a fact that no units have the Frost Armor buff.


There's simpler ways of doing this, but simplicity usually comes at a cost.

The more complex ways involve methods like Hashtables, Unit Indexing, Dynamic Indexing, etc... and allow for far greater control. And if you truly want full control, stop using GUI (the basic trigger editor) and learn how to code with Lua or something that transpiles to Lua.
 

Attachments

  • Frost Armor Example.w3m
    17.4 KB · Views: 35
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
Ok i know that i'm taking this thread out of it's topic but can you add one more trigger about the shadow strike ability having a stun for 3sec.:grin::grin:
 
Level 9
Joined
Apr 22, 2020
Messages
430
You already asked this kind of question: Enhancing Anti Magic Shell spell
If you already have it, just use the system again for it. I told you it's significant to have instead of jumping into these workarounds...
Sorry i never knew that i'm still a newbie here and i thought that the anti magic shell would be different from the frost armor since it's autocast so i thought that the triggers would be different.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Yes it would be different. Just copy and paste, change the condition of ability being cast to frost armor and remove the bonus armor part.
It can be done on one line instead. Or if you don't even have the system in your map, you may follow what Uncle suggested above if that's
your preference.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Ok i know that i'm taking this thread out of it's topic but can you add one more trigger about the shadow strike ability having a stun for 3sec.:grin::grin:
Create and order a Dummy unit to cast Storm Bolt on the target of Shadow Strike.

Dummy units are used in just about every single map that has custom spells. It's an unselectable/uncontrollable unit based on the Crypt Lord's locust (Any unit can be given the Locust ability to gain these attributes). It generally has no model so the players are completely unaware of it's existence. That being said, you can give it a model if you'd like, which can be used as a Special Effect sort of deal.

The Dummy is then given a spell to cast, which allows the player to create effects like a stunning Shadow Strike. So your Hero is casting Shadow Strike while a hidden unit is simultaneously casting Storm Bolt, and if setup correctly this can almost appear to be seamless.

  • Shadow Strike Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Strike
    • Actions
      • Set VariableSet TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Add Shadow Strike Stun (Dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
This same method can be used for any type of ability, however, you'll have to adjust it slightly to work for the other types of abilities like Thunderclap (Instant) or Shockwave (Target Point), since no (Target unit of ability being cast) will exist in those cases.

TempPoint and the Custom script are used to clean up memory leaks (in this case a Point aka Location leak). They aren't necessary, however, it's highly recommended to do this if you wish for your maps to perform well.
 

Attachments

  • Shadow Strike Stun.w3m
    17.6 KB · Views: 42
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
Create and order a Dummy unit to cast Storm Bolt on the target of Shadow Strike.

Dummy units are used in just about every single map that has custom spells. It's an unselectable/uncontrollable unit based on the Crypt Lord's locust (Any unit can be given the Locust ability to gain these attributes). It generally has no model so the players are completely unaware of it's existence. That being said, you can give it a model if you'd like, which can be used as a Special Effect sort of deal.

The Dummy is then given a spell to cast, which allows the player to create effects like a stunning Shadow Strike. So your Hero is casting Shadow Strike while a hidden unit is simultaneously casting Storm Bolt, and if setup correctly this can almost appear to be seamless.

  • Shadow Strike Stun
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Strike
    • Actions
      • Set VariableSet TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Add Shadow Strike Stun (Dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
This same method can be used for any type of ability, however, you'll have to adjust it slightly to work for the other types of abilities like Thunderclap (Instant) or Shockwave (Target Point), since no (Target unit of ability being cast) will exist in those cases.

TempPoint and the Custom script are used to clean up memory leaks (in this case a Point aka Location leak). They aren't necessary, however, it's highly recommended to do this if you wish for your maps to perform well.
Sorry i cannot open your map it saids level info of data is missing can you just tell me how you made the dummy unit?
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Sorry i cannot open your map it saids level info of data is missing can you just tell me how you made the dummy unit?
It is just a unit that have locust ability on it and contains no model other than dummy.mdx or just completely none.
To simply create it; go to your Object Editor -> Units tab -> Standard Units folder -> Undead -> Melee -> Special then
just find 'Locust' unit name there and copy/paste it, set the model to none then you're done but...
You may set the model to dummy.mdx for extras and nullify some data fields for a proper setup.

It's much more convenience to have a global dummy unit, only achievable if you setup properly.
If you intend it to be global, and using it for casting abilities, things like cast point,back & blend time
must be zeroed. If using it for movements, movespeed value should be greater than 0. movement type
depending to foot or fly, foot to stick the unit on the ground, fly for enabling it to use a fly height.
There are much more things to be discussed, but that is only the fundamentals setup to begin with.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
To create a "spell-casting" Dummy like the one in my map:
1) Copy and paste the Locust unit
2) Set it's Attacks Enabled to None (don't want it biting people)
3) Set it's Speed Base to 0 (this removes the need to face it's target to cast spells)

That's really all you need to adjust, as the original Locust has most of the other properties covered. I also remove it's Undead classification and set it's life to 999999 but that's probably not necessary.

Units with the Locust ability seem to ignore most interactions, so you generally don't have to worry about them getting targeted in any way, shape, or form.

I believe they still set off "A unit enters map" Events, so you may want to exclude them from such triggers if it will cause problems. Same goes for the order Events like "A unit issues an order" and "A unit casts an ability".
 
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
To create a "spell-casting" Dummy like the one in my map:
1) Copy and paste the Locust unit
2) Set it's Attacks Enabled to None (don't want it biting people)
3) Set it's Movement Type to None and Speed Base to 0 (this removes the need to face it's target to cast spells)

That's really all you need to adjust, as the original Locust has most of the other properties covered. I also remove it's Undead classification and set it's life to 999999 but that's probably not necessary.

Units with the Locust ability seem to ignore most interactions, so you generally don't have to worry about them getting targeted in any way, shape, or form.

I believe they still set off "A unit enters map" Events, so you may want to exclude them from such triggers if it will cause problems. Same goes for the order Events like "A unit issues an order" and "A unit casts an ability".
I'm confused of the part unit - add shadow strike (dummy) is that the dummy unit or something?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Shadow Strike Stun (Dummy) is an ability based on Storm Bolt. I renamed it to that because it's always good to keep things organized.

Ability info:
Missile Art: None
Missile Speed: 0 (makes it hit instantly)
Mana Cost: 0
Cast Range: 999999
Duration: 3.00 seconds
Targeted Allowed: make it the same as Shadow Strike's targets allowed
Name: Shadow Strike Stun
Editor Suffix: (Dummy)
 
Last edited:
Level 9
Joined
Apr 22, 2020
Messages
430
Okay it works now Thanks! By the way is thier like a way to rename your trigger? I have accedintaly clicked ok and the title is Untitled Trigger001.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
3) Set it's Movement Type to None and Speed Base to 0 (this removes the need to face it's target to cast spells)
I think this is unnecessary. And it breaks the purpose of having a global dummy unit.
As long these fields: cast point/back & blend time are zeroed it would be fine. But anyway,
it's all up to the preference as I've never encountered a dummy that needs facing to cast.

EDIT:
I also remove it's Undead classification and set it's life to 999999 but that's probably not necessary.
I'm just curious even you said it's not necessary, any specific reasons why you're doing these?
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
I think this is unnecessary. And it breaks the purpose of having a global dummy unit.
As long these fields: cast point/back & blend time are zeroed it would be fine. But anyway,
it's all up to the preference as I've never encountered a dummy that needs facing to cast.

EDIT:

I'm just curious even you said it's not necessary, any specific reasons why you're doing these?
After testing it further, the Movement Type can remain enabled, but the Speed Base needs to be set to 0 to fix the turn issue.

I'm 100% positive this Speed Base change is needed.

And I just do that extra stuff to prevent any weird cases where the Dummy would get caught in a trigger (A unit enters map -> classification == undead -> do unwanted stuff)
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
but the Speed Base needs to be set to 0 to fix the turn issue.
Is this turn issue you're having makes the dummy unit unable to cast the ability you ordered?
I'm 100% positive this Speed Base change is needed.
I'm doubting this cause I've never encountered that kind of turning issue you're having with dummies.
May I know how you script a dummy that casts an ability to a unit? I've created lots of resources using
a dummy unit that doesn't even have its movement speed set to 0 and they cast just fine.

I'm suspecting you order a dummy unit without SetUnitX/Y. You may test it and see if it helps.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Is this turn issue you're having makes the dummy unit unable to cast the ability you ordered?

I'm doubting this cause I've never encountered that kind of turning issue you're having with dummies.
May I know how you script a dummy that casts an ability to a unit? I've created lots of resources using
a dummy unit that doesn't even have its movement speed set to 0 and they cast just fine.

I'm suspecting you order a dummy unit without SetUnitX/Y. You may test it and see if it helps.
The "Shadow Strike Stun" trigger I posted earlier is exactly what I'm doing. I just tested it on Reforged, latest patch, and the Dummy had to turn to face it's target (that's without 0 movespeed).

With 0 movespeed, it didn't have to turn.

Maybe it doesn't matter in your case because of some extra steps you're taking like you said, but with the sort of bare-bones method I used it seems to be necessary.
 
Status
Not open for further replies.
Top