Physic/ Ballista missile Arrow

Level 13
Joined
Oct 28, 2019
Messages
523
HI everyone, I got an idea, Ikd if has already a topic directly about it, the idea is this:

Using missile gui system event,

A unit, using a "point" spell, the unit shoots an arrow, but the arrow dont hit the target point of ability casted. The hit target is 2x the distance of the "target point and casting unit"

I know that need use something that calcule the distance betwen the two points and etc, maybe the facing angle.

I´ve tried with no sucess need recomendations, TY !!!!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You need both the (Distance between points) and (Angle between points) functions, which will use the Point where your Caster is standing -> (Position of (Casting unit)) and the Point where you cast the ability -> (Target point of ability being cast). Once you have the Distance/Angle then you can use the (Point with polar offset) function to calculate an offset position.
  • Set Variable PointA = (Position of (Casting unit))
  • Set Variable PointB = (Target point of ability being cast)
  • Set Variable Angle = (Angle between PointA and PointB)
  • Set Variable Distance = ((Distance between PointA and PointB) x 2.00)
  • Set Variable PointC = (PointA offset by Distance towards Angle)
PointC is the final position where the arrow would land. If the angle goes in the opposite direction then you need to get the Angle between (B and A) instead of (A and B) or multiply the Distance by -2.00.

You generally don't want to rely on (Facing angle) since units cast spells before they've finished turning.
 
Last edited:
Level 13
Joined
Oct 28, 2019
Messages
523
You need both the (Distance between points) and (Angle between points) functions, which will use the Point where your Caster is standing -> (Position of (Casting unit)) and the Point where you cast the ability -> (Target point of ability being cast). Once you have the Distance/Angle then you can use the (Point with polar offset) function to calculate an offset position.
  • Set Variable PointA = (Position of (Casting unit))
  • Set Variable PointB = (Target point of ability being cast)
  • Set Variable Angle = (Angle between PointA and PointB)
  • Set Variable Distance = ((Distance between PointA and PointB) x 2.00)
  • Set Variable PointC = (PointA offset by Distance towards Angle)
PointC is the final position where the arrow would land. If the angle goes in the opposite direction then you need to get the Angle between (B and A) instead of (A and B) or multiply the Distance by -2.00.

You generally don't want to rely on (Facing angle) since units cast spells before they've finished turning.
Worked tY
 
Level 13
Joined
Oct 28, 2019
Messages
523
  • Missile End Arrow
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_FINISH
        • Then - Actions
          • Unit - Cause HeroVariable to damage circular area after 0.00 seconds of radius 100.00 at PointC, dealing 100.00 damage of attack type Pierce and damage type Normal
          • Set VariableSet Missile__WantDestroy = True
        • Else - Actions
why this trigger of damage of "missile end" isnt working @Uncle
 
Level 13
Joined
Feb 5, 2018
Messages
567
Are you using this? Relativistic Missiles [vJASS][LUA][GUI]

If you are using this system it's better to set up the damage, owner, source and collision size on the cast trigger.

And then just use the data on the Missile on hit trigger. Just an example, ofcourse you need to set the model and other stuff too.

Also if you are using some other missile system I recommend switching to this one.

  • MissileOnCast
    • Events
    • Conditions
    • Actions
      • Set VariableSet MissileDamage = 100.00
      • Set VariableSet MissileSource = (Triggering unit)
      • Set VariableSet MissileOwner = (Owner of (Triggering unit))
      • Set VariableSet MissileCollideZ = True
      • Set VariableSet MissileCollision = 125.00
  • MissileOnHit
    • Events
    • Conditions
      • (MissileHitUnit belongs to an enemy of MissileOwner.) Equal to True
      • (MissileHitUnit is alive) Equal to True
    • Actions
      • Unit - Cause MissileSource to damage MissileHitUnit, dealing MissileDamage damage of attack type Spells and damage type Magic
 
Level 13
Joined
Oct 28, 2019
Messages
523
  • Missile Collision Unit Arrow
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_COLLIDE_UNIT
          • Missile__UnitHit Not equal to Missile__Source
          • (Missile__UnitHit is alive) Equal to True
        • Then - Actions
          • Unit - Cause Missile__Source to damage Missile__UnitHit, dealing Missile__Damage damage of attack type Pierce and damage type Normal
          • Set VariableSet Missile__WantDestroy = True
        • Else - Actions
solved TY to all replies!!!
 
Top