• 🏆 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] Thunder Stomp help

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2006
Messages
179
  • Thunder Stomp for Tauren Cheftain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Stomp
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit - Create 1 ThunderS for (Owner of TChieftain) at (Position of TChieftain) facing Default building facing degrees
          • Set TStomp = (Last created unit)
          • Unit - Turn collision for TStomp Off
          • Unit - Add a 1.00 second Generic expiration timer to TStomp
          • Unit - Order TStomp to Orc Far Seer - Chain Lightning (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 2
        • Then - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 3
        • Then - Actions
        • Else - Actions
The idea is on the first level (I'll do the rest). I did try this on the map and the chain lightning effect didn't work. It did show the War Stomp effect. The chain lightning must happen at the same moment the War Stomp is casted.
Is there a way to fix this?
TStomp = Unit;
TChieftain = Unit;
ThunderS = Dummy-like.
 
Level 1
Joined
Aug 18, 2018
Messages
4
You want the unit to use the chainlighting over the caster? You have to change the owner of the dummy or allow the ability to attack your own unit.
Or you want to use the spell against some units around? because in that case you could pick a random unit around the caster in a range of idk 100-300 and then order the dummy to use the spell against the picked unit.
Of course you have to remove the group leak with a custom script like
set bj_wantDestroyGroup = true (before picking units)
Or call DestroyGroup (udg_[YourGP]).
 
Last edited:
Level 6
Joined
Sep 19, 2006
Messages
179
Not sure, I did try your options. Here is the result below:
  • Thunder Stomp for Tauren Cheftain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Stomp
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit - Create 1 ThunderS for (Owner of TChieftain) at (Position of TChieftain) facing Default building facing degrees
          • Set TStomp = (Last created unit)
          • Unit - Turn collision for TStomp Off
          • Unit - Add a 1.00 second Generic expiration timer to TStomp
          • Unit - Set level of Chain Lightning (trigger) for TStomp to 1
          • Unit - Order TStomp to Orc Far Seer - Chain Lightning (Random unit from (Units within 700.00 of (Position of TStomp)))
          • Custom script: call DestroyGroup (udg_MyGP)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 2
        • Then - Actions
          • Unit - Create 1 ThunderS for (Owner of TChieftain) at (Position of TChieftain) facing Default building facing degrees
          • Set TStomp = (Last created unit)
          • Unit - Turn collision for TStomp Off
          • Unit - Add a 1.00 second Generic expiration timer to TStomp
          • Unit - Set level of Chain Lightning (trigger) for TStomp to 2
          • Unit - Order TStomp to Orc Far Seer - Chain Lightning (Random unit from (Units within 800.00 of (Position of TStomp)))
          • Custom script: call DestroyGroup (udg_MyGP)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Thunder Stomp for (Casting unit)) Equal to 3
        • Then - Actions
          • Unit - Create 1 ThunderS for (Owner of TChieftain) at (Position of TChieftain) facing Default building facing degrees
          • Set TStomp = (Last created unit)
          • Unit - Turn collision for TStomp Off
          • Unit - Add a 1.00 second Generic expiration timer to TStomp
          • Unit - Set level of Chain Lightning (trigger) for TStomp to 3
          • Unit - Order TStomp to Orc Far Seer - Chain Lightning (Random unit from (Units within 900.00 of (Position of TStomp)))
          • Custom script: call DestroyGroup (udg_MyGP)
        • Else - Actions
Even so, the code still doesn't work.
MyGP = Unit Group
I did set the mama of the dummy unit to 2000 and in the spell Chain Lightning (trigger), I also set the Alowed Targets option to Self.
Not sure what am I supposed to do. Can anyone fix this code for me? I appreciae it.
A reminder: I set:
...
Unit - Set level of Chain Lightning (trigger) for TStomp to 1
...
just to use the Chain Lightning spell via this piece of code.
 
Level 1
Joined
Aug 18, 2018
Messages
4
You didn't set the triggering unit, thats why the dummy don't use the ability you've to set TChieftain as the triggering unit at the start of the trigger so the rest of the code has someone to refer. And maybe you've created the gp in other trigger because i don't see the group, but just in case: you have to create a group variable with any name for ex. MyGP Then you have to set this group inside the trigger For ex.
Set MyGP=random unit in 900 matching condition(matching unit = enemy of TChieftain) And pick the units in MyGP
And then at the end remove the group with Custom script.
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
I also set the Alowed Targets option to Self.

Just Self? You should probably reset the Targets Allowed if you want it to target enemies.
Does the dummy have the correct object data (0cast point, invisible, etc.)
Is TChieftain variable properly set?

I have compressed the trigger below, I don't see any problems with your original trigger though. If it still doesn't work, try debugging it using messages.

  • Thunder Stomp for Tauren Cheftain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Stomp
    • Actions
      • Set TChieftain = (Triggering unit)
      • Set TPoint = (Position of TChieftain)
      • Unit - Create 1 ThunderS for (Owner of TChieftain) at TPoint facing Default building facing degrees
      • Set TStomp = (Last created unit)
      • Set TLevel = (Level of Thunder Stomp for TChieftain)
      • Set TGroup = (Units within (600.00 + (100.00 x TLevel) of TPoint)
      • Set TTarget = (Random unit from TGroup)
      • Unit - Add a 1.00 second Generic expiration timer to TStomp
      • Unit - Set level of Chain Lightning (trigger) for TStomp to TLevel
      • Unit - Order TStomp to Orc Far Seer - Chain Lightning TTarget
      • Custom script: call RemoveLocation(udg_TPoint)
      • Custom script: call DestroyGroup (udg_TGroup)
 
Level 6
Joined
Sep 19, 2006
Messages
179
@Light: Your code works great! I had to change it a bit, as I didn't know what TLevel had as a variable. I ended up in multiple conflicts. Here's the code that works for me:
  • Thunder Stomp for Tauren Chieftain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Stomp
    • Actions
      • Set TChieftain = (Triggering unit)
      • Set TPoint = (Position of TChieftain)
      • Unit - Create 1 ThunderS for (Owner of TChieftain) at TPoint facing Default building facing degrees
      • Set TStomp = (Last created unit)
      • Set TLevel = (Real((Level of Thunder Stomp for TChieftain)))
      • Set TGroup = (Units within (600.00 + (100.00 x TLevel)) of TPoint)
      • Set TTarget = (Random unit from TGroup)
      • Unit - Add a 1.00 second Generic expiration timer to TStomp
      • Unit - Set level of Chain Lightning (trigger) for TStomp to (0 + (Level of Thunder Stomp for TChieftain))
      • Unit - Order TStomp to Orc Far Seer - Chain Lightning TTarget
      • Custom script: call RemoveLocation(udg_TPoint)
      • Custom script: call DestroyGroup(udg_TGroup)
Still, I appreciate what you did for me! Thanks, Light!
 
Level 6
Joined
Sep 19, 2006
Messages
179
I see. However, sometimes chain lightning appears and sometimes it doesn't. Is there a way to solve this?
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
When it picks a unit that your chain lightning ability can't target the effect won't appear. I suspect it can only target enemies of the caster and when it fails it's picking an allied unit. You need to make sure your random target is valid. Change your group line to:

Units within (your range bologna) of TPoint Matching ((Matching Unit belongs to an enemy of (Owner of TChieftain)) equal to true)
 
Level 6
Joined
Sep 19, 2006
Messages
179
I tried:
  • Set TGroup = (Units within (600.00 + (100.00 x (Real(TLevel)))) of TPoint matching (((Triggering unit) belongs to an enemy of (Owner of TChieftain)) Equal to True))
The spell doesn't work anymore.
 
Level 6
Joined
Sep 19, 2006
Messages
179
  • Set TGroup = (Units within (600.00 + (100.00 x (Real(TLevel)))) of TPoint matching (((Triggering unit) belongs to an enemy of (Owner of TChieftain)) Equal to True))
Spell still doesn't work.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
I tried:
  • Set TGroup = (Units within (600.00 + (100.00 x (Real(TLevel)))) of TPoint matching (((Triggering unit) belongs to an enemy of (Owner of TChieftain)) Equal to True))
The spell doesn't work anymore.
  • Set TGroup = (Units within (600.00 + (100.00 x (Real(TLevel)))) of TPoint matching (((Triggering unit) belongs to an enemy of (Owner of TChieftain)) Equal to True))
Spell still doesn't work.
You didn't change anything. Triggering -> Matching in the "matching ..." condition.
 
Level 6
Joined
Sep 19, 2006
Messages
179
I see. You mean:
  • Set TGroup = (Units within (600.00 + (100.00 x (Real(TLevel)))) of TPoint matching (((Matching unit) belongs to an enemy of (Owner of TChieftain)) Equal to True))
Now the spell works! Thank you, Pyrogasm!
 
Status
Not open for further replies.
Top