Chain Lightning effect missing? Only for Computer?

Level 2
Joined
Dec 29, 2017
Messages
16
Hey guys. I ran into a little bit of a strange bug, and after some extensive testing I just cant wrap my head around it. Allow me to explain as best as I can.

I have a spell that chains a lightning in an infinite loops for a set amount of time, designed to be used by a boss through the use of trigger commands.

Now here are the triggers that comprise of such a spell.

  • Wild Lightning Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Chain Lightning (Boss)
    • Actions
      • Set Owner_Of_Caster = (Triggering player)
      • Set Anyunit = (Triggering unit)
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 4.00 seconds
      • Set Dummy_Chain_Lightning_TARGET = (Target unit of ability being cast)
      • Unit - Create 1 Dummy Caster for Owner_Of_Caster at ((Position of (Triggering unit)) offset by 100.00 towards ((Facing of (Triggering unit)) + 270.00) degrees) facing Default building facing degrees
      • Set Dummy_Chain_Lightning = (Last created unit)
      • Animation - Change Dummy_Chain_Lightning flying height to 150.00 at 0.00
      • Unit - Order Dummy_Chain_Lightning to Orc Far Seer - Chain Lightning Dummy_Chain_Lightning_TARGET
  • Wild Lightning Dummy Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Instant Chain Lightning
    • Actions
      • Set Dummy_Chain_Lightning_TARGET = (Target unit of ability being cast)
      • Set Dummy_Chain_Lightning_TARGET_P = (Position of Dummy_Chain_Lightning_TARGET)
      • Unit - Add a 0.10 second Generic expiration timer to (Triggering unit)
      • Unit - Cause Anyunit to damage Dummy_Chain_Lightning_TARGET, dealing 50.00 damage of attack type Spells and damage type Normal
      • Unit - Create 1 Dummy Caster for Owner_Of_Caster at Dummy_Chain_Lightning_TARGET_P facing (Facing of Dummy_Chain_Lightning_TARGET) degrees
      • Set Dummy_Chain_Lightning = (Last created unit)
      • Custom script: call RemoveLocation (udg_Dummy_Chain_Lightning_TARGET_P)
      • Wait 0.05 seconds
      • Set Dummy_Chain_Lightning_TARGET_P = (Position of Dummy_Chain_Lightning_TARGET)
      • Set UnitsWithinTarget = (Units within 400.00 of Dummy_Chain_Lightning_TARGET_P)
      • Unit - Move Dummy_Chain_Lightning instantly to Dummy_Chain_Lightning_TARGET_P
      • Unit Group - Pick every unit in UnitsWithinTarget and do (Actions)
        • Loop - Actions
          • If (((Picked unit) is Magic Immune) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • If (((Picked unit) is An Ancient) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • If (((Picked unit) is A structure) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • If (((Picked unit) belongs to an ally of Owner_Of_Caster) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • If ((Picked unit) Equal to Dummy_Chain_Lightning_TARGET) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • If (((Picked unit) is dead) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTarget) else do (Do nothing)
          • Unit Group - Remove all units of (Units owned by Owner_Of_Caster) from UnitsWithinTarget
      • Unit - Order Dummy_Chain_Lightning to Orc Far Seer - Chain Lightning (Random unit from UnitsWithinTarget)
      • Custom script: call RemoveLocation (udg_Dummy_Chain_Lightning_TARGET_P)
      • Custom script: call DestroyGroup (udg_UnitsWithinTarget)
As you can see - These triggers are player neutral, which should have the same result every time regardless of player or computer status.

Now here's the juicy bit.

For some unknown reason, when a unit belonging to any computer casts this ability using the below trigger, the actual "Lightning Effect" of the ability does not appear. The hit effect and damage instance still works as intended.

  • ThunderLord Chain Lightning
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set UnitsWithinTargetWildLightning = (Units within 500.00 of (Position of Thunder Lord Matsudomo 0347 <gen>))
      • Unit Group - Pick every unit in UnitsWithinTargetWildLightning and do (Actions)
        • Loop - Actions
          • If (((Picked unit) belongs to an ally of Owner_Of_Caster) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTargetWildLightning) else do (Do nothing)
          • If (((Picked unit) is dead) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTargetWildLightning) else do (Do nothing)
          • If (((Picked unit) is A structure) Equal to True) then do (Unit Group - Remove (Picked unit) from UnitsWithinTargetWildLightning) else do (Do nothing)
          • Unit Group - Remove all units of (Units owned by Owner_Of_Caster) from UnitsWithinTargetWildLightning
      • Unit - Order Thunder Lord Matsudomo 0347 <gen> to Orc Far Seer - Chain Lightning (Random unit from UnitsWithinTargetWildLightning)

However after some testing I had found that the when myself as a player (Regardless of player postion) cast this ability manually, it works exactly as intended and visuals are fully displayed.

This seems like some sort of technical bug , but if anyone has encountered this problem before, or know of a possible solution, or even have the slightest idea on why this is happening, any imput on this would be greatly appreciated, as it is just stumping me hard right now.

Thank you.
 
Level 17
Joined
Nov 21, 2012
Messages
836
I guess AI cancels your order right after it is issued. The "start effect of ability" runs, and your trigger "Wild Lightning Dummy Cast" is executed but chain lightning needs ~0.50sec to be casted succeffuly (with lightning effect and damage)
edit this event is not running, sorry

Are you using chain lightning for dummy with 0 damage set in OE? If so try to change this value to 0.1 dmg and test it.
 
Level 2
Joined
Dec 29, 2017
Messages
16
Ah, this has actually been resolved.

For some reason, if I add "AI - Ignore (Last created unit)'s guard position" below it fixes it completely.

Not sure why it has to do with guard positions, but I always have annoying problems with computer and guard positions, so i tried it randomly and it worked. If someone could explain why, a simpler solution might become available, but for now, this works.

Thank you for your response though.
 
Level 13
Joined
Jul 15, 2007
Messages
763
when a unit belonging to any computer casts this ability

Computer Players 1-12 behave very strangely when you order them to cast certain spells, from what i seen it's usually abilities guided by an "area of effect" AI for things like Rain of Fire, Blizzard etc. (and Chain Lightning in your case). The way i bypass Wc3 AI being problematic is to use Neutral Extra for my (computer-controlled) dummies which seems to have no AI at all.
 
Top