• 🏆 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] Backstab spell problem

Status
Not open for further replies.
Level 4
Joined
Jun 22, 2009
Messages
63
I made this spell called Backstab. Basicly the unit "teleports" to the back of the targeted unit, dealing extra damage. It works just fine the first time, but then it just teleporst you back to the middle of the map. +rep

  • Backstab
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Backstab (Neutral Hostile)
    • Actions
      • Set BS_Caster = (Triggering unit)
      • Unit - Pause BS_Caster
      • Set BS_Target = (Target unit of ability being cast)
      • Set BS_Facing = ((Facing of BS_Target) - 180.00)
      • Set BS_Position = ((Position of BS_Target) offset by 10.00 towards BS_Facing degrees)
      • Unit - Move BS_Caster instantly to BS_Position, facing (Facing of BS_Target) degrees
      • Wait 0.50 seconds
      • Animation - Play BS_Caster's Attack Slam animation
      • Wait 0.35 seconds
      • Unit - Cause BS_Caster to damage BS_Target, dealing 100.00 damage of attack type Hero and damage type Normal
      • Unit - Unpause BS_Caster
      • Custom script: call RemoveLocation(udg_BS_Position)
 
Level 6
Joined
Mar 22, 2009
Messages
276
Maybe you casted again the backstab spell before your trigger finishes executing.
The unit caster was teleported in the middle of the map for the reason of having a null value for location/point. Also make the spell MUI and dont use Waits.
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
You may be safer doing this spell without setting up global variables. It might be causing the main issue. Just do everything on the spot. Likely the global variables are nullifying during the wait which causes the unit to move to the middle of the map. If you remove those globals you may also be able to keep the MUI of the spell.
 
Status
Not open for further replies.
Top