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

[Trigger] Forked Lightning, Lightning Bolt not appearing.

Status
Not open for further replies.
Level 7
Joined
Aug 5, 2010
Messages
147
Made an item that has a 20% chance to cast Forked Lightning when the hero damages a unit. Only problem is the bolt of lightning doesnt appear.

Here is the trigger. I orginally used remove (last created unit) and i assumed that was causing the problem but after replacing it with an expiration timer the problem still occurs.
  • Lightning Sword
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource is A Hero) Equal to True
      • (DamageEventSource has an item of type Lightning Sword) Equal to True
    • Actions
      • Set OrbSword_Chance[(Player number of (Owner of DamageEventSource))] = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OrbSword_Chance[(Player number of (Owner of DamageEventSource))] Less than or equal to 20
        • Then - Actions
          • Set OrbPlayer_Number = (Player number of (Owner of DamageEventSource))
          • Set OrbSword_Points[(Player number of (Owner of DamageEventSource))] = (Position of DamageEventSource)
          • Unit - Create 1 Dummy for (Owner of DamageEventSource) at OrbSword_Points[(Player number of (Owner of DamageEventSource))] facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Orb - Forked Lightning [Lightning Sword] to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Forked Lightning DamageEventTarget
          • Custom script: call RemoveLocation(udg_OrbSword_Points[udg_OrbPlayer_Number])
        • Else - Actions
One last thing how do i make it so it only triggers from the Heroes attack and not from other DamageEvents?
 
Level 18
Joined
May 11, 2012
Messages
2,103
Why this?
  • [(Player number of (Owner of DamageEventSource))]
You can try placing debug messages in the else and then blocks to see does the condition even pass.

One last thing how do i make it so it only triggers from the Heroes attack and not from other DamageEvents?
You should have a variable (don't know which damage engine you use) that says something like attackType and the values should be something like 0=physical, 1=magical, 2=user damage or something
 
Level 7
Joined
Aug 5, 2010
Messages
147
Why this?
  • [(Player number of (Owner of DamageEventSource))]
You can try placing debug messages in the else and then blocks to see does the condition even pass.


You should have a variable (don't know which damage engine you use) that says something like attackType and the values should be something like 0=physical, 1=magical, 2=user damage or something


To stop conflicts with multiple heroes using the same items, not done something like this before so ive probably gone overboard with making every variable an array.

Was typing something here about the conditions but i found the problem causing the bolt to not appear, i had set the duration on the spell itself to 0, whereas the default is 0.7, i wasnt even aware of what that did but i guess i do now.

Thanks found it, items no longer activate from spells causing damage.
 
Status
Not open for further replies.
Top