[Spell] Ability refuses to work on my map.

Level 15
Joined
Jul 19, 2007
Messages
855
Once again I have imported an ability named "Tunnel" from a spellpack and the ability works perfect on the test map but not in my map. I can swear I have imported everything requried for the ability but still it doesn't work... What could actually be wrong?
 

Attachments

  • SpellPack by PiCk.w3x
    270.8 KB · Views: 5
Level 15
Joined
Jul 19, 2007
Messages
855
if you only posted the original - that does work - how is anyone supposed to know why it doesn't work on your map?
Well I can post the triggers of the ability then.
  • Move
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Tunnel
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to False
        • Then - Actions
          • Set VariableSet P_Hole = (Position of (Triggering unit))
          • Unit - Create 1 Hole for (Owner of (Triggering unit)) at P_Hole facing Default building facing degrees
          • Animation - Play (Triggering unit)'s burrow animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to True
        • Then - Actions
          • Set VariableSet P_Hole = (Position of U_Hole)
          • Unit - Move (Casting unit) instantly to P_Hole
          • Special Effect - Create a special effect at P_Hole using Abilities\Spells\Undead\Impale\ImpaleHitTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set VariableSet UG_Hole = (Units within 200.00 of P_Hole matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True).)
          • Unit Group - Pick every unit in UG_Hole and do (Actions)
            • Loop - Actions
              • Set VariableSet P_HoleEffect = (Position of (Picked unit))
              • Special Effect - Create a special effect at P_HoleEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 0.00 damage of attack type Spells and damage type Normal
          • Unit - Kill U_Hole
          • Unit - Remove U_Hole from the game
          • Animation - Play (Triggering unit)'s unburrow animation
        • Else - Actions
  • Dig
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Hole
    • Actions
      • Set VariableSet U_Hole = (Triggering unit)
      • Set VariableSet P_Hole = (Position of U_Hole)
      • Set VariableSet B_HoleStats = True
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Hole
    • Actions
      • Set VariableSet U_Hole = No unit
      • Set VariableSet P_Hole = (Center of NONE <gen>)
      • Set VariableSet B_HoleStats = False
  • Tunnel
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tunnel
    • Actions
      • Set VariableSet P_Tunnel = (Position of (Triggering unit))
      • Set VariableSet R_TunnelAngle = (Facing of (Triggering unit))
      • Set VariableSet U_Tunnel = (Triggering unit)
      • Unit - Hide U_Tunnel
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Set VariableSet P_Tunnel = (P_Tunnel offset by 110.00 towards R_TunnelAngle degrees.)
          • Unit - Create 1 Dummy (Tunnel) for (Owner of (Triggering unit)) at P_Tunnel facing Default building facing degrees
          • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Tunnel (Dummy) for (Last created unit) to (Level of Tunnel for U_Tunnel)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
          • Special Effect - Create a special effect at P_Tunnel using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.90 seconds
      • Unit - Unhide U_Tunnel
      • Unit - Move U_Tunnel instantly to P_Tunnel
      • Selection - Select U_Tunnel for (Owner of U_Tunnel)
Btw I notice that the "Tunnel" trigger uses "Wait" on loop and I've heard that's not a good idéa and it might bug the trigger... Still strange it works on the original spellpack :-/
 
Level 24
Joined
Feb 27, 2019
Messages
833
The tunnel ability has a wait in a loop. Thats fine as long as the loop variable is unique. With a unique variable the entire trigger will be able to be cast by a single unit at a time without issues. So not MPI or MUI. Its fine in the original spellback since there arent any other triggers overwriting Integer A, so its a unique variable in that map for only that purpose.
  • Tunnel
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tunnel
    • Actions
      • Set VariableSet P_Tunnel = (Position of (Triggering unit))
      • Set VariableSet R_TunnelAngle = (Facing of (Triggering unit))
      • Set VariableSet U_Tunnel = (Triggering unit)
      • Unit - Hide U_Tunnel
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Set VariableSet P_Tunnel = (P_Tunnel offset by 110.00 towards R_TunnelAngle degrees.)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at P_Tunnel facing Default building facing degrees
          • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Tunnel (Dummy) for (Last created unit) to (Level of Tunnel for U_Tunnel)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
          • Special Effect - Create a special effect at P_Tunnel using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.90 seconds
      • Unit - Unhide U_Tunnel
      • Unit - Move U_Tunnel instantly to P_Tunnel
      • Selection - Select U_Tunnel for (Owner of U_Tunnel)
 
Level 15
Joined
Jul 19, 2007
Messages
855
The tunnel ability has a wait in a loop. Thats fine as long as the loop variable is unique. With a unique variable the entire trigger will be able to be cast by a single unit at a time without issues. So not MPI or MUI. Its fine in the original spellback since there arent any other triggers overwriting Integer A, so its a unique variable in that map for only that purpose.
  • Tunnel
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tunnel
    • Actions
      • Set VariableSet P_Tunnel = (Position of (Triggering unit))
      • Set VariableSet R_TunnelAngle = (Facing of (Triggering unit))
      • Set VariableSet U_Tunnel = (Triggering unit)
      • Unit - Hide U_Tunnel
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Set VariableSet P_Tunnel = (P_Tunnel offset by 110.00 towards R_TunnelAngle degrees.)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at P_Tunnel facing Default building facing degrees
          • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Tunnel (Dummy) for (Last created unit) to (Level of Tunnel for U_Tunnel)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
          • Special Effect - Create a special effect at P_Tunnel using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.90 seconds
      • Unit - Unhide U_Tunnel
      • Unit - Move U_Tunnel instantly to P_Tunnel
      • Selection - Select U_Tunnel for (Owner of U_Tunnel)
I tried to change the "Integer A" to an unique variable but still the ability does not work like it should. There also seems to be something wrong with the impale-special effect because it isn't created on damaged enemies...
 
Level 15
Joined
Jul 19, 2007
Messages
855
Post your updated trigger. The special effect is not created on enemies. Its created on a point.
Well I didn't change much I just made a new unique Integer variable instead of the standard Integer A.
  • Tunnel
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tunnel
    • Actions
      • Set VariableSet P_Tunnel = (Position of (Triggering unit))
      • Set VariableSet R_TunnelAngle = (Facing of (Triggering unit))
      • Set VariableSet U_Tunnel = (Triggering unit)
      • Unit - Hide U_Tunnel
      • For each (Integer TunnelInteger) from 1 to 9, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Set VariableSet P_Tunnel = (P_Tunnel offset by 110.00 towards R_TunnelAngle degrees.)
          • Unit - Create 1 Dummy (Tunnel) for (Owner of (Triggering unit)) at P_Tunnel facing Default building facing degrees
          • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Tunnel (Dummy) for (Last created unit) to (Level of Tunnel for U_Tunnel)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
          • Special Effect - Create a special effect at P_Tunnel using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.90 seconds
      • Unit - Unhide U_Tunnel
      • Unit - Move U_Tunnel instantly to P_Tunnel
      • Selection - Select U_Tunnel for (Owner of U_Tunnel)
 
Level 24
Joined
Feb 27, 2019
Messages
833
The Spellpack has a disabled condition. I think the spellpack is trash but adding these conditions appears to fix the main problem.
  • Move
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Tunnel
          • (Ability being cast) Equal to Tunnel (Dummy)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to False
        • Then - Actions
          • Set VariableSet P_Hole = (Position of (Triggering unit))
          • Unit - Create 1 Hole for (Owner of (Triggering unit)) at P_Hole facing Default building facing degrees
          • Animation - Play (Triggering unit)'s burrow animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to True
        • Then - Actions
          • Set VariableSet P_Hole = (Position of U_Hole)
          • Unit - Move (Casting unit) instantly to P_Hole
          • Special Effect - Create a special effect at P_Hole using Abilities\Spells\Undead\Impale\ImpaleHitTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set VariableSet UG_Hole = (Units within 200.00 of P_Hole matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True).)
          • Unit Group - Pick every unit in UG_Hole and do (Actions)
            • Loop - Actions
              • Set VariableSet P_HoleEffect = (Position of (Picked unit))
              • Special Effect - Create a special effect at P_HoleEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (50.00 + (20.00 x ((Real((Level of Unknown (A003) for (Triggering unit)))) - 1.00))) damage of attack type Spells and damage type Normal
          • Unit - Kill U_Hole
          • Unit - Remove U_Hole from the game
          • Animation - Play (Triggering unit)'s unburrow animation
        • Else - Actions
 
Level 15
Joined
Jul 19, 2007
Messages
855
The Spellpack has a disabled condition. I think the spellpack is trash but adding these conditions appears to fix the main problem.
  • Move
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Tunnel
          • (Ability being cast) Equal to Tunnel (Dummy)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to False
        • Then - Actions
          • Set VariableSet P_Hole = (Position of (Triggering unit))
          • Unit - Create 1 Hole for (Owner of (Triggering unit)) at P_Hole facing Default building facing degrees
          • Animation - Play (Triggering unit)'s burrow animation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • B_HoleStats Equal to True
        • Then - Actions
          • Set VariableSet P_Hole = (Position of U_Hole)
          • Unit - Move (Casting unit) instantly to P_Hole
          • Special Effect - Create a special effect at P_Hole using Abilities\Spells\Undead\Impale\ImpaleHitTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set VariableSet UG_Hole = (Units within 200.00 of P_Hole matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True).)
          • Unit Group - Pick every unit in UG_Hole and do (Actions)
            • Loop - Actions
              • Set VariableSet P_HoleEffect = (Position of (Picked unit))
              • Special Effect - Create a special effect at P_HoleEffect using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (50.00 + (20.00 x ((Real((Level of Unknown (A003) for (Triggering unit)))) - 1.00))) damage of attack type Spells and damage type Normal
          • Unit - Kill U_Hole
          • Unit - Remove U_Hole from the game
          • Animation - Play (Triggering unit)'s unburrow animation
        • Else - Actions
Could you please fix that and then send me map?
 
Top