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

Help with Parabola movement.

Status
Not open for further replies.
Level 15
Joined
Sep 3, 2009
Messages
1,521
Hi everyone at hive. And before i start Merry Christmas. :D
well today i started learning about how to use a parabola in Wc3. ive gotten the triggering of it down almost but the problem is when im in game it only works once per unit. i have no idea why it does this. I have been trying to 2 fix it for hours now but with no luck. if someone could check my triggers would be greatly appreciated.

  • Boss Rage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Gorfang 0002 <gen>
      • Boss_Rage_On Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between Difficulty_adjuster and 15) Equal to 15
        • Then - Actions
          • -------- Add To Group --------
          • Unit Group - Add (Triggering unit) to P_Group
          • -------- Unit Being Thrown --------
          • Set P_unit = (Triggering unit)
          • -------- Speed --------
          • Hashtable - Save 25.00 as 1 of (Key (Triggering unit)) in P_hash
          • -------- Max Height --------
          • Hashtable - Save 500.00 as 2 of (Key (Triggering unit)) in P_hash
          • -------- Max Distance --------
          • Hashtable - Save 2000.00 as 3 of (Key (Triggering unit)) in P_hash
          • -------- Angle --------
          • Hashtable - Save (Facing of Gorfang 0002 <gen>) as 5 of (Key (Triggering unit)) in P_hash
          • -------- Time --------
          • Hashtable - Save (((Load 3 of (Key (Triggering unit)) from P_hash) x 0.03) / (Load 1 of (Key (Triggering unit)) from P_hash)) as 0 of (Key (Triggering unit)) in P_hash
          • -------- Makes Unit Fly --------
          • Unit - Add Storm Crow Form to P_unit
          • Unit - Remove Storm Crow Form from P_unit
          • -------- Runs Loop --------
          • Trigger - Turn on Boss Rage Loop <gen>
        • Else - Actions
  • Boss Rage Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in P_Group and do (Actions)
        • Loop - Actions
          • -------- ------------------------Preload All Variables ---------------------------- --------
          • Set P_time = (Load 0 of (Key (Picked unit)) from P_hash)
          • Set P_Speed = (Load 1 of (Key (Picked unit)) from P_hash)
          • Set P_Max_height = (Load 2 of (Key (Picked unit)) from P_hash)
          • Set P_max_distance = (Load 3 of (Key (Picked unit)) from P_hash)
          • Set P_Current_distance = (Load 4 of (Key (Picked unit)) from P_hash)
          • Set P_Angle = (Load 5 of (Key (Picked unit)) from P_hash)
          • -------- ------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P_time Less than or equal to 0.00
            • Then - Actions
              • -------- Remove Unit Once time is Done --------
              • Unit Group - Remove (Picked unit) from P_Group
            • Else - Actions
              • -------- Lower Time --------
              • Hashtable - Save (P_time - 0.03) as 0 of (Key (Picked unit)) in P_hash
              • -------- Increase Current Distance --------
              • Hashtable - Save (P_Current_distance + P_Speed) as 4 of (Key (Picked unit)) in P_hash
              • -------- Parabola Formula --------
              • Set P_height = (((4.00 x (P_Max_height / P_max_distance)) x (P_max_distance - P_Current_distance)) x (P_Current_distance / P_max_distance))
              • -------- Move Unit --------
              • Animation - Change (Picked unit) flying height to P_height at 0.00
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by P_Speed towards P_Angle degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (P_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
first of all you use a specified unit, atleast set it into a variable first :) looks better

the angle can create threw points instead of the facing of the "boss" unit as it might bug (dunno why, just rumors about facings being not accurate enough)

you never move the unit ...

  • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by P_Speed towards P_Angle degrees)
it is moveed to the same spot ...

and also you should clearchild hashtables when there are no instances left to run
 
Level 15
Joined
Sep 3, 2009
Messages
1,521
ah i completely forgot about the child hashtables but yes it does move. offset by p_speed which is 25 towards the facing angle which lets say is 45 degrees. so yes it does move. the unit moves always just that the unit only rises the first time.
so first time its a parabola movement second time its a knockback.
 
Level 15
Joined
Sep 3, 2009
Messages
1,521
ha im trying it but when i go to the function clear child hashtables i go to key of but then i cant select picked unit when before i always could... @_@. really weird.
EDIT: nvm it works now it was JNGP fail with hashtables yet again. testing now..
EDIT2: nope only works once still :/ i fixed everything you said.
EDIT3: Alas i cannot lol its for a contest.
EDIT4: GOT IT. i wasnt resetting the current height for the units so it wouldnt run now it works perfectly now. now i gotta remove leaks. yay :D ty basse
 
Last edited:
Status
Not open for further replies.
Top