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

Triggering Chain Lightning

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
Solved! :)

Edit: It seems Bribe's Damage Detection system is causing my spell to not work. Why is this and how can I fix it?

So I decided to trigger Chain Lightning because I wanted to modify an integer variable (StaticCounter) each time a unit is hit by the lightning. I can't seem to get the ability to work however. The special effect just plays at the same point, and the dummy isn't zapping any units. Here's my code:

  • Chain Lightning
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to ChainLightningGroup
      • Set ChainLightningCaster = (Triggering unit)
      • Set ChainLightningPoint = (Position of (Target unit of ability being cast))
      • Set ChainLightningCounter = (ChainLightningCounter + 1)
      • Countdown Timer - Start ChainLightningTimer as a One-shot timer that will expire in 0.30 seconds
  • Chain Lightning Link
    • Events
      • Time - ChainLightningTimer expires
    • Conditions
    • Actions
      • Special Effect - Create a special effect at ChainLightningPoint using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set TempUnitGroup = (Units within 375.00 of ChainLightningPoint matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in ChainLightningGroup) Equal to False)) and (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Game - Display to (All players) for 5.00 seconds the text: (String((Number of units in TempUnitGroup)))
      • Set TempUnit = (Random unit from TempUnitGroup)
      • Game - Display to (All players) for 5.00 seconds the text: (Name of TempUnit)
      • Custom script: call DestroyGroup (udg_TempUnitGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempUnit Not equal to No unit
          • ChainLightningJumpCounter Less than (7 + (Level of Chain Lightning for ChainLightningCaster))
        • Then - Actions
          • Set StaticCounter = (StaticCounter + 1)
          • Set ChainLightningJumpCounter = (ChainLightningJumpCounter + 1)
          • Unit Group - Add TempUnit to ChainLightningGroup
          • Unit - Create 1 Dummy Unit 5 for (Owner of ChainLightningCaster) at ChainLightningPoint facing Default building facing degrees
          • Unit - Set level of Chain Lightning (Dummy) for (Last created unit) to (Level of Chain Lightning for ChainLightningCaster)
          • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning TempUnit
          • Custom script: call RemoveLocation (udg_ChainLightningPoint)
          • Set ChainLightningPoint = (Position of TempUnit)
          • Countdown Timer - Start ChainLightningTimer as a One-shot timer that will expire in 0.30 seconds
        • Else - Actions
          • Game - Display to (All players) for 5.00 seconds the text: ELSE CONDITIONS MET
          • Custom script: call RemoveLocation (udg_ChainLightningPoint)
          • Unit Group - Remove all units from ChainLightningGroup
          • Set ChainLightningJumpCounter = 0
 
Last edited:
Level 10
Joined
Apr 4, 2010
Messages
509
I don't seem to find anything worn with it, try moving this
  • Custom script: call DestroyGroup (udg_TempUnitGroup)
to the bottom, It might do nothing, but I have a feeling :|
EDIT: If you post a test map, I could fiddle around with it.
EDIT2: You should also turn off Chain Lightning Link when Else conditions are met.
 
Level 2
Joined
Sep 16, 2014
Messages
17
The trigger seems fine,so maybe you forgot something really simple,check if the correct spell is given to dummy unit,set dummy units:turn rate to 1,cast animation to 0,mana to 10000,check other triggers for things that could stop creating a new unit,or anything that can stop executing of this one. And check if chain lightning(dummy ability) is created from chain lighting spell,and has correct base ID.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
DEE-BOO disabled all triggers in my map but Chain Lightning and it did work. I spent a bit of time narrowing down the cause. It was Bribe's Damage Detection system.

http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-v3-2-0-0-a-201016/

I noticed theres been a few new versions of his DDS so I'll update the DDS in my map and see it that resolves the problem. My current DDS version is 3.0.0.0.0

Edit: Updating to the DDS version 3.2.0.0 did not fix the problem. Does anyone know how to make Chain Lightning work with the DDS?
 
Level 10
Joined
Apr 4, 2010
Messages
509
Ive never used his system before, but from the looks of it, you're both using the TempUnit variable. Change the name of the one you're using for this spell to something else.

I just tested and you are right. Also Radicool, add this
  • Animation - Change (Last created unit) flying height to (Current flying height of Chain_Temp_Unit) at 1000000000.00
after you created the ChainLightningDummy
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Ive never used his system before, but from the looks of it, you're both using the TempUnit variable. Change the name of the one you're using for this spell to something else.

Awesome. The system must have been using a TempUnit then and was conflicting with my spell. Thanks!

Animation - Change (Last created unit) flying height to (Current flying height of Chain_Temp_Unit) at 1000000000.00
You can just set the rate to 0 to make fly height change instantaneous.

I didn't think about flying hight. That will fix chain lightning for flying units. Thanks.
 
Status
Not open for further replies.
Top