• 🏆 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!

Acceleration and Deceleration

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
So, I actually made this before using Paladon's Knockback system. However, I can't seem to figure out now...

This is my trigger currently:

  • Untitled Trigger 003
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A flying unit) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (X of Target Point = + (String((X of (Target point of issued order)))))
          • Game - Display to (All players) the text: (Y of Target Point = + (String((Y of (Target point of issued order)))))
          • Set KBA_Caster = (Triggering unit)
          • Set KBA_DestroyTrees = False
          • Set KBA_DistancePerLevel = (Distance between (Position of (Triggering unit)) and (Target point of issued order))
          • Set KBA_Level = 1
          • Set KBA_Speed = 15.00
          • Set KBA_StartingPosition = ((Target point of issued order) offset by ((Distance between (Target point of issued order) and (Position of (Triggering unit))) - ((Distance between (Target point of issued order) and (Position of (Triggering unit))) x 2.00)) towards (Angle from (Position of (TriggeringUnit))) x 2.00)) towards (Angle from (Position of (Triggering unit)) to (Target Point of Issued Order)
          • Set KBA_TargetUnit = (Triggering unit)
          • Trigger - Run Cast A Knockback <gen> (checking conditions)
          • Game - Display to (All players) the text: (X of Target Point = + (String((X of (Target point of issued order)))))
          • Game - Display to (All players) the text: (Y of Target Point = + (String((Y of (Target point of issued order)))))
        • Else - Actions
The point of this is to get the target point of the order, and then get the complete-opposite point relative to the unit of that point. Like this:

attachment.php


And what this does is instead of knocking the unit away from the target point of the order, it knocks them toward it. But I can't seem to get the angle right. It's always off or sometimes goes in the complete-opposite direction of the target point.
 

Attachments

  • Untitled211211211.png
    Untitled211211211.png
    3.1 KB · Views: 136

Deleted member 219079

D

Deleted member 219079

+180 degrees inverts the angle


e: Nvm myt already answered
 
Level 12
Joined
May 20, 2009
Messages
822
  • Untitled Trigger 003
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A flying unit) Equal to True
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Set KBA_Caster = (Triggering unit)
          • Set KBA_DestroyTrees = False
          • Set KBA_DistancePerLevel = (Distance between (Position of (Triggering unit)) and (Target point of issued order))
          • Set KBA_Level = 1
          • Set KBA_Speed = 9.00
  • Set KBA_StartingPosition = ((Target point of issued order) offset by ((...Distance....)) towards ((Angle from (Position of (Triggering unit)) to (Target point of issued order)) - 180.00) degrees)
    • Set KBA_TargetUnit = (Triggering unit)
    • Trigger - Run Cast A Knockback <gen> (checking conditions)
    • Else - Actions
I tried this and it still pushes the unit in the wrong direction. (+ or - results in the same thing.)
 
Level 12
Joined
May 20, 2009
Messages
822
Okay, so this seems to work:

EDIT: Cleaned it up some.
  • Set KBA_StartingPosition = (ACDC_UnitPoint offset by (ACDC_Distance - (ACDC_Distance x -2.00)) towards (ACDC_Angle - 180.00) degrees)
I'll do a few tests to fully make sure, though.

Also,
  • Unit - Order (Triggering unit) to Stop
Why would that not be working?

EDIT2: The units effected by this trigger, when crossing very long distances, they overshoot the target-point by a lot.
 
Last edited:
Status
Not open for further replies.
Top