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

[Problem] Projectile Strange Movement

Status
Not open for further replies.
Level 2
Joined
Apr 6, 2012
Messages
12
I'm making a point-targeted spell that fires a missile at the target point and damages the first unit it encounters.

The problem is that the missle doesn't travel exactly straight. I think I could leave it as it is if the problem is too difficult to solve, but I'd really like to have it move perfectly straight.

Currently, the missile moves in a sort of winding pattern (think slithering snake). The winding starts out almost unnoticeable, but gets quite noticeable nearing the end range of the spell (1000 range).

If someone could tell me how to post an image of the trigger that would be great, but for now I'm going to just type it out (there are two triggers used):

Summer Red Cast (Trigger)

  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to Summer Red (Patchouli)
  • Actions
  • Set SummerRedCaster = (Casting unit)
  • Set SummerRedCastPoint = (Position of SummerRedCaster)
  • Set SummerRedTargetPoint = (Target point of ability being cast)
  • Set SummerRedLevel = (Level of Summer Red (Patchouli) for SummerRedCaster)
  • Unit - Make SummerRedCaster face SummerRedTargetPoint over 0.00 seconds
  • Unit - Create 1 Projectile (Summer Red) for (Owner of SummerRedCaster) at SummerRedCastPoint facing SummerRedTargetPoint
  • Set SummerRedProjectile = (Last created unit)
  • Unit - Make SummerRedProjectile face SummerRedTargetPoint over 0.00 seconds
  • Unit - Turn collision for SummerRedCaster Off
  • Set SummerRedDistance = 0.00
  • Set SummerRedMaxDistance = 1500
  • Trigger - Turn on Summer Red Projectile <gen>
Summer Red Projectile (Trigger) (Initially Off)

  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions
  • Set SummerRedDistance = (SummerRedDistance + 15.00)
  • Unit Group - Pick every unit in (Units within 75.00 of (Position of SummerRedProjectile)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) belongs to an enemy of (Owner of SummerRedCaster)) Equal to True
        • Then - Actions
          • Unit - Cause SummerRedCaster to damage (Picked unit), dealing (66.66 x (Real(SummerRedLevel))) damage of attack type Spells and damage type Normal
          • Unit - Order SummerRedProjectile to Human Mountain King - Thunder Clap
          • Unit - Kill SummerRedProjectile
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Integer(SummerRedDistance)) Greater than or equal to SummerRedMaxDistance
    • Then - Actions
      • Unit - Order SummerRedProjectile to Human Mountain King - Thunder Clap
      • Unit - Kill SummerRedProjectile
      • Trigger - Turn off (This trigger)
    • Else - Actions
  • Unit - Move SummerRedProjectile instantly to (SummerRedCastPoint offset by SummerRedDistance towards (Facing of SummerRedProjectile) degrees), facing SummerRedTargetPoint
If someone could help me make the missile move in a straight line instead of zig-zagging, I would appreciate it =D
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
can you repost your triggers in
  • tags
  • to do this, right click where it says the name of the trigger in the trigger editor, hit copy as text, than hit the gear icon in the reply maker, than post your trigger
 
Level 17
Joined
Jul 17, 2011
Messages
1,864
exactly what projectile are you using? because if its the missile one here is your problem see the projectile you are using has that specific animation. the projectile, just like all units destructibles etc. is a model with an animation.
solution: use another missile model such as the mortar team's hf
 
Level 2
Joined
Apr 6, 2012
Messages
12
I'll repost in a second (after this DotA 2 game =D)

As for the projectile, it is a zone indicator base that has been tweaked with pathing removed and the such (dummy unit), except the projectile model is the dragon whelp attack projectile. Is that the problem?

*Edited for easier read*
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Don't use facing of unit as those are inaccurate. Even if you order a unit to face angle, the facing won't be exactly what you ordered it to face.

Store angle from caster to target point in the first trigger. Move the unit towards the stored angle in the looping trigger.

Use Starts the effect of an ability event since you can abuse Begins casting by pressing stop quickly after ordering to use the spell, and get away with no mana cost or cooldown.

Get rid of leaks: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Maker stated it... "unit facing" does not return the right value. You're going to want to do (angle between caster and target point)

also change the periodic to 0.03, 0.01 does not work well

and the last thing, you should use move to location rather than order move. Order to move looks a tad smoother, but it will bug up near walls
 
Level 2
Joined
Apr 6, 2012
Messages
12
@Maker

THANK YOU. Problem is fixed, and the missile is flying straight now. Also, thank you for that leaks link, I was able to fix the animation not playing properly with that =D. I would like to give you credit for this (if it even means anything since this hero will probably never be implemented in any game anyways =\), so if you want the credit just tell me under what name in this thread.

@Illidans911

I'll change the periodic, but I'm not sure what you mean by use move to location instead of order move. Right now I'm pretty sure I'm using move to location, unless you meant order move instead of move to location? The problem with order move for me is that the maximum movement speed of units is 522 which is a problem because the missile has to move fast.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
What i meant was, rather than ordering the missle to move to the location, use the Unit - Move Instantly trigger to where you want it to move to . 0.03 seconds and a move of 15 should be almost the same as moving
 
Status
Not open for further replies.
Top