• 🏆 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] Silent Strike (offset problems)

Status
Not open for further replies.
Level 4
Joined
Jul 20, 2011
Messages
77
i am working on a spell that silences enemy hero then teleports him to that hero. for some reason it keeps teleporting the hero to center of map instead of behind him.


  • Silent Kill
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Silent Strike (silence. Shadow Ninja)
    • Actions
      • Wait 0.75 seconds
      • Set SilentKillTempPoint1 = (Position of (Target unit of ability being cast))
      • Unit - Move (Casting unit) instantly to (SilentKillTempPoint1 offset by 75.00 towards (Angle from (Position of (Casting unit)) to SilentKillTempPoint1) degrees), facing SilentKillTempPoint1
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (75.00 x (Real((Level of Silent Strike (silence. Shadow Ninja) for (Casting unit))))) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation( udg_SilentKillTempPoint1 )

any help would be appreciated
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
why dont you make it all in custom scipts and use local variables?

  • Custom script: local unit caster = GetTriggerUnit()
  • Custom script: local unit target = GetSpellTargetUnit()
  • Custom script: local location loc1 = GetUnitLoc(target)
  • Custom script: local location loc2 = PolarProjectionBJ(loc1, 75.00, GetUnitFacing(target))
  • Custom script: local real damage = 75. * I2R(GetUnitAbilityLevel(caster, 'ABILITYCODEHERE'))
  • Wait 0.75 seconds
  • Custom script: call SetUnitPositionLoc(caster, loc2)
  • Custom script: call UnitDamageTarget(caster, target, damage, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, null)
  • Custom script: call RemoveLocation(loc1)
  • Custom script: call RemoveLocation(loc2)
  • Custom script: set caster = null
  • Custom script: set target = null
  • Custom script: set loc1 = null
  • Custom script: set loc2 = null
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
The best way is definitely an indexing system anyway. Most people need to store a lot more than just the (Triggering unit) or (Triggering player).

Are there other common functions that are MUI with a wait?
Lots of event responses except GetSpellTargetUnit and GetSpellTargetX/Y/Point

I am lying, I just tested this with Killing unit, dying unit, attacking unit long ago and they are working fine :D
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
why dont you make it all in custom scipts and use local variables?

  • Custom script: local unit caster = GetTriggerUnit()
  • Custom script: local unit target = GetSpellTargetUnit()
  • Custom script: local location loc1 = GetUnitLoc(target)
  • Custom script: local location loc2 = PolarProjectionBJ(loc1, 75.00, GetUnitFacing(target))
  • Custom script: local real damage = 75. * I2R(GetUnitAbilityLevel(caster, 'ABILITYCODEHERE'))
  • Wait 0.75 seconds
  • Custom script: call SetUnitPositionLoc(caster, loc2)
  • Custom script: call UnitDamageTarget(caster, target, damage, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, null)
  • Custom script: call RemoveLocation(loc1)
  • Custom script: call RemoveLocation(loc2)
  • Custom script: set caster = null
  • Custom script: set target = null
  • Custom script: set loc1 = null
  • Custom script: set loc2 = null

LOL DUDE it's just a JASS scipt captured in the fiery cage of GUI ^^
Oh and I'm not sure, but for me sometimes the "Starts the effect of an ability" functions doesn't give back the target correctly... (or was it the "finishes casting an ability"?)
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Because the learning curve on that is too steep for most GUI users. It's better to help people learn to help themselves, and putting the "solution" in custom script is going to confuse and/or turn off most people.

I regret that I'm stuck with GUI for a very long time in the past that's why
I'm encouraging people to learn jass immediately after learning the basics of GUI :)...

LOL DUDE it's just a JASS scipt captured in the fiery cage of GUI ^^
Oh and I'm not sure, but for me sometimes the "Starts the effect of an ability" functions doesn't give back the target correctly... (or was it the "finishes casting an ability"?)

local variables can make a simple spell MUI in a non-complicated way ;)...

Starts the effect works just fine but it's the starts the effect for the caster
or triggering unit, not the target so it will cast almost instant which is not
good if you want to delay the effect, to avoid this you may use timers for
the delay...
 
Status
Not open for further replies.
Top