• 🏆 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] Spell point bugging out

Status
Not open for further replies.
Level 9
Joined
Apr 23, 2011
Messages
527
[SOLVED] Spell point bugging out

SOLVED
i've made a simple dash spell, and it worked normally. and i noticed that it doesn't stop if the target point is in a doodad. so i found this handy trigger for checking pathability and put it in my map. after i made the changes to my spell, it mysteriously teleports me to a point near the center of the map. i tried to fix this, but nothing seems to work.


  • Dash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dash
    • Actions
      • Set caster[0] = (Casting unit)
      • Set facing[0] = (Facing of caster[0])
      • Set p[1] = (Position of caster[0])
      • Set p[2] = (Target point of ability being cast)
      • Unit - Make caster[0] Invulnerable
      • Unit - Pause caster[0]
      • Animation - Play caster[0]'s walk animation
      • Sound - Play CharmTarget1 <gen> at 100.00% volume, attached to caster[0]
      • Trigger - Turn on Dash Loop <gen>



  • Dash Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Dummy (Dash) for (Owner of caster[0]) at p[1] facing facing[0] degrees
      • Set dummy[0] = (Last created unit)
      • Unit - Add a 0.50 second Generic expiration timer to dummy[0]
      • Animation - Play dummy[0]'s walk animation
      • Animation - Change dummy[0]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 75.00% transparency
      • Set CP_Point = (p[1] offset by 50.00 towards facing[0] degrees)
      • Trigger - Run Check Walkability <gen> (ignoring conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CP_PointIsWalkable Not equal to True
        • Then - Actions
          • Sound - Destroy CharmTarget1 <gen>
          • Animation - Reset caster[0]'s animation
          • Unit - Unpause caster[0]
          • Unit - Make caster[0] Invulnerable
          • Trigger - Turn off (This trigger)
          • Custom script: call RemoveLocation(udg_CP_Point)
          • Custom script: call RemoveLocation(udg_p[1])
          • Custom script: call RemoveLocation(udg_p[2])
        • Else - Actions
          • Unit - Move caster[0] instantly to CP_Point
          • Custom script: call RemoveLocation(udg_CP_Point)
          • Custom script: call RemoveLocation(udg_p[1])
          • Set p[1] = (Position of caster[0])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Region centered at p[2] with size (60.00, 60.00)) contains caster[0]) Equal to True
            • Then - Actions
              • Sound - Destroy CharmTarget1 <gen>
              • Animation - Reset caster[0]'s animation
              • Unit - Unpause caster[0]
              • Unit - Make caster[0] Invulnerable
              • Trigger - Turn off (This trigger)
              • Custom script: call RemoveLocation(udg_CP_Point)
              • Custom script: call RemoveLocation(udg_p[1])
              • Custom script: call RemoveLocation(udg_p[2])
            • Else - Actions


i can't find anything wrong with this trigger and there's nothing that interferes with it. hopefully you guys can help.
(i used arrays for caster, target, facing etc. because my map has multiple classes)
spell is not supposed to be MUI.

EDIT: i tried putting p[1] in loop, the dash works, but it doesn't stop.


fuck, goddamnit, i was stupid again, it's fixed now.
i didn't see an interval trigger that uses the same arrays for points.
 
Status
Not open for further replies.
Top