• 🏆 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] Help with triggers for spell?

Status
Not open for further replies.
Level 4
Joined
Jan 18, 2016
Messages
29
I'll start with the complicated one first: I wish to try and implement a chain lightning that stuns. Gamewise, the Hero is supposed to throw the shield that bounces through targets, stunning each unit hit. So either basing it on Chain Lightning that can stun or basing it on Storm Bolt that stuns.

If that's too complicated, my other idea is a Shield Bash that stuns the main target and the surrounding enemies get knocked back. So I'm guessing I can just base it on Storm Bolt and change its casting range to like 50, but how do I do the triggers for the knockback?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
Systems Needed:
For the Shield Bounce ability: Damage Engine 5.7.1.1
For the Shield Bash ability: GUI Knockback 2.5D v4.2.5.0

Note: The GUI Knockback comes with a Unit Indexer system, so be aware of that (you don't want multiples of the same system). Also, the Unit Indexer that comes with GUI Knockback is out of date.
I updated it in my example map so you should just copy and paste all of the systems from my map if you can.

Shield Bounce:
-Create a "fake" ability, this is what your Hero will cast. This ability does nothing besides setting off the cast trigger and going on cooldown/spending mana.
-Create a Chain Lightning ability and a Storm Bolt ability. Both should be Unit abilities with 0 cd, 0 mana cost, 999999 cast range, etc... so our Dummy can cast them. Chain Lightning will deal the damage, Storm Bolt will apply the stun.
-Create a unique Dummy unit. Give this unit your Chain Lightning and Storm Bolt abilities.
-When your Hero casts the fake ability, you create your Dummy and order it to Chain Lightning the target.
-You then create a Damage Event trigger to detect whenever your Dummy deals damage, and when it does you order the Dummy to cast Storm Bolt on the damaged unit.

Shield Throw:
-Create a Storm Bolt ability (like you said), with short cast range and all that stuff.
-When your Hero casts this ability you use the GUI Knockback system to push nearby enemy units, making sure to exclude the target unit.

  • Cast Shield Bounce
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shield Bounce (Hero)
    • Actions
      • Set VariableSet SB_Point = (Position of (Triggering unit))
      • Unit - Create 1 Shield Bounce Dummy for (Triggering player) at SB_Point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_SB_Point)
      • Set VariableSet SB_Dummy = (Last created unit)
      • Unit - Set level of Shield Bounce (Dummy - Chain) for SB_Dummy to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Set level of Shield Bounce (Dummy - Stun) for SB_Dummy to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Order SB_Dummy to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
      • Unit - Add a 8.00 second Generic expiration timer to SB_Dummy
  • Shield Bounce Stun
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Shield Bounce Dummy
      • DamageEventAmount Greater than 0.00
    • Actions
      • Set VariableSet SB_Point = (Position of DamageEventTarget)
      • Unit - Move DamageEventSource instantly to SB_Point
      • Custom script: call RemoveLocation (udg_SB_Point)
      • Unit - Order DamageEventSource to Human Mountain King - Storm Bolt DamageEventTarget
  • Cast Shield Bash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shield Bash (Hero)
    • Actions
      • Set VariableSet SB_Point = (Position of (Target unit of ability being cast))
      • Set VariableSet CenterPoint = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of SB_Point.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
              • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • (Picked unit) Not equal to (Target unit of ability being cast)
            • Then - Actions
              • Set VariableSet TargetPoint = (Position of (Picked unit))
              • Set VariableSet Knockback2DAngle = (Angle from CenterPoint to TargetPoint)
              • Custom script: call RemoveLocation(udg_TargetPoint)
              • Set VariableSet Knockback2DTime = 0.50
              • Set VariableSet Knockback2DDistance = 200.00
              • Set VariableSet Knockback2DUnit = (Picked unit)
              • Trigger - Run Knockback 2D <gen> (checking conditions)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_CenterPoint)
      • Custom script: call RemoveLocation (udg_SB_Point)

I realize these systems come with like +100 variables, but they're really powerful and enable you to create all sorts of cool spell effects with ease. It's worth the clutter.
 

Attachments

  • lachferagh spells 1.w3m
    90 KB · Views: 16
Last edited:
Level 4
Joined
Jan 18, 2016
Messages
29
Systems Needed:
For the Shield Bounce ability: Damage Engine 5.7.1.1
For the Shield Bash ability: GUI Knockback 2.5D v4.2.5.0

Note: The GUI Knockback comes with a Unit Indexer system, so be aware of that (you don't want multiples of the same system). Also, the Unit Indexer that comes with GUI Knockback is out of date.
I updated it in my example map so you should just copy and paste all of the systems from my map if you can.

Shield Bounce:
-Create a "fake" ability, this is what your Hero will cast. This ability does nothing besides setting off the cast trigger and going on cooldown/spending mana.
-Create a Chain Lightning ability and a Storm Bolt ability. Both should be Unit abilities with 0 cd, 0 mana cost, 999999 cast range, etc... so our Dummy can cast them. Chain Lightning will deal the damage, Storm Bolt will apply the stun.
-Create a unique Dummy unit. Give this unit your Chain Lightning and Storm Bolt abilities.
-When your Hero casts the fake ability, you create your Dummy and order it to Chain Lightning the target.
-You then create a Damage Event trigger to detect whenever your Dummy deals damage, and when it does you order the Dummy to cast Storm Bolt on the damaged unit.

Shield Throw:
-Create a Storm Bolt ability (like you said), with short cast range and all that stuff.
-When your Hero casts this ability you use the GUI Knockback system to push nearby enemy units, making sure to exclude the target unit.

  • Cast Shield Bounce
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shield Bounce (Hero)
    • Actions
      • Set VariableSet SB_Point = (Position of (Triggering unit))
      • Unit - Create 1 Shield Bounce Dummy for (Triggering player) at SB_Point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_SB_Point)
      • Set VariableSet SB_Dummy = (Last created unit)
      • Unit - Set level of Shield Bounce (Dummy - Chain) for SB_Dummy to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Set level of Shield Bounce (Dummy - Stun) for SB_Dummy to (Level of (Ability being cast) for (Triggering unit))
      • Unit - Order SB_Dummy to Orc Far Seer - Chain Lightning (Target unit of ability being cast)
      • Unit - Add a 8.00 second Generic expiration timer to SB_Dummy
  • Shield Bounce Stun
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Shield Bounce Dummy
      • DamageEventAmount Greater than 0.00
    • Actions
      • Set VariableSet SB_Point = (Position of DamageEventTarget)
      • Unit - Move DamageEventSource instantly to SB_Point
      • Custom script: call RemoveLocation (udg_SB_Point)
      • Unit - Order DamageEventSource to Human Mountain King - Storm Bolt DamageEventTarget
  • Cast Shield Bash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shield Bash (Hero)
    • Actions
      • Set VariableSet SB_Point = (Position of (Target unit of ability being cast))
      • Set VariableSet CenterPoint = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of SB_Point.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is A ground unit) Equal to True
              • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • (Picked unit) Not equal to (Target unit of ability being cast)
            • Then - Actions
              • Set VariableSet TargetPoint = (Position of (Picked unit))
              • Set VariableSet Knockback2DAngle = (Angle from CenterPoint to TargetPoint)
              • Custom script: call RemoveLocation(udg_TargetPoint)
              • Set VariableSet Knockback2DTime = 0.50
              • Set VariableSet Knockback2DDistance = 200.00
              • Set VariableSet Knockback2DUnit = (Picked unit)
              • Trigger - Run Knockback 2D <gen> (checking conditions)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_CenterPoint)
      • Custom script: call RemoveLocation (udg_SB_Point)

I realize these systems come with like +100 variables, but they're really powerful and enable you to create all sorts of cool spell effects with ease. It's worth the clutter.


I haven't got to try it out because I'm a beginner and I'm just having a hard time setting up variables.
I'm having difficulties on finding what their variable type is for:
"Set VariableSet Knockback2DAngle = (Angle from CenterPoint to TargetPoint)"
"Set VariableSet Knockback2DTime = 0.50"
"Set VariableSet Knockback2DUnit = (Picked unit)"

The rest of the variables, I think I've got them right
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
You aren't creating these variables, are you? Every variable besides "SB_Dummy" and "SB_Point" will come with the systems so you don't need to create them yourself.

If you can open my map then you can just copy and paste everything from it into your map. You shouldn't have to create anything yourself in this case. Just make sure to assign the correct abilities to your units/triggers, these will often change due to how ability id's work. What's considered Shield Bounce in one map could be Fireball in another map.

And you may have to go into the Editor's preferences (File/Preferences/General) and enable "Automatically create unknown variables while pasting trigger data". While you're there you should enable "Allow negative real values in the Object Editor" as well.

Also, those variable types:
Knockback2DAngle/Time = Real
Knockback2DUnit = Unit

The things you need to copy over:
-Shield Bounce Dummy unit
-Shield Bounce (Hero) ability
-Shield Bounce (Dummy - Stun) ability
-Shield Bounce (Dummy - Chain) ability
-Shield Bash (Hero) ability
-All of the triggers

Then make sure your Shield Bounce Dummy has the Dummy abilities (Stun/Chain), the Hero uses the (Hero) versions of the abilities, and the triggers reference the correct abilities. Use the triggers in my previous post as a reference.
 
Last edited:
Level 4
Joined
Jan 18, 2016
Messages
29
Oh I'm so sorry. I didn't see the file that you provided. Wow you've done so much. I thought you just shared the triggers so I was just copying them, but you even made all of that. Really, a huge thank you!

I just wanna ask, because I'm using reforged now, is everyone on Hiveworkshop using that? So does other stuff like the Damage core or something I saw that's recommended able to be used on Reforged?
 
I just wanna ask, because I'm using reforged now, is everyone on Hiveworkshop using that? So does other stuff like the Damage core or something I saw that's recommended able to be used on Reforged?

Seems like a 40/40/20 split on last 2 patches before reforged, reforged and other patches. Which Patch(es) are people Primarily Modding On? is a poll agreeing with this.
For example the Damage Engine 5.7.1.1 supports latest version (as does many other systems people use and recommend), you can see that by the "Recommended version: Current" in the example map.
 
Level 4
Joined
Jan 18, 2016
Messages
29
Seems like a 40/40/20 split on last 2 patches before reforged, reforged and other patches. Which Patch(es) are people Primarily Modding On? is a poll agreeing with this.
For example the Damage Engine 5.7.1.1 supports latest version (as does many other systems people use and recommend), you can see that by the "Recommended version: Current" in the example map.

Oh okay cool. So just curious, are old custom models able to be applied on the world editor then? Or must they be updated?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,517
Oh okay cool. So just curious, are old custom models able to be applied on the world editor then? Or must they be updated?
Sorry, I should've made it clear that I attached a map. I originally wasn't going to make a map so my post was written in a "how to do it yourself" kind of way, but then I figured I'd just make it myself since the triggers were rather simple.

And yeah, those 3 systems in the map, Damage Engine, Knockback, and Unit Indexer are all compatible with the latest patches, and in my opinion are the only systems you really need for your map. You will potentially lose out on some older custom spells from the Spell section on Hive, but I think it's important to learn how to create these yourself anyway, and with the new features that come with the latest patches doing so is a lot easier than it ever was.
 
Last edited:
Status
Not open for further replies.
Top