HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Projectile Z-Axis Angling

07-14-2006, 05:31 PM#1
Rising_Dusk
Ok, this may not be exactly what you're thinking.
I am not having problems getting a parabolic trajectory working, that isn't my problem. I know how to make a projectile move properly.
I'm just saying that in advance so everyone knows. :P

What my problem is is a smidge odder.
I need to angle the dummy unit that looks like the projectile (Say an arrow for example) towards the next point in the parabola.
If that makes no sense, let me try to explain a different way.

Zoom (requires log in)
See how while in flight, the arrow is pointed in the direction it's moving?
That's what I need to do with my dummy unit for the entire flight of the projectile.
I need to change it's angle along the Z-Axis to make it appear to actually flow with the trajectory.

Is this possible?
And if so, what triggers would be necessary to create that effect?
Also, how can I make it a smooth transition? I want it to look like a real and naturally moving projectile.

Thanks in advance for any help.
Attached Images
File type: jpgProjectile2.JPG (5.0 KB)
07-14-2006, 06:35 PM#2
PipeDream
The easy way is to let warcraft take the derivative numerically. Place a dummy unit ahead of the projectile in the trajectory and stare at it
Collapse JASS:
native          SetUnitLookAt       takes unit whichUnit, string whichBone, unit lookAtTarget, real offsetX, real offsetY, real offsetZ returns nothing
native          ResetUnitLookAt     takes unit whichUnit returns nothing
    call SetUnitLookAt(udg_projectile,"bone_chest",udg_leader,0.,0.,0.)
If bone_chest doesn't work, try bone_head. Failing that, edit the model so that bone_root becomes bone_head or bone_chest, and then use bone_head/bone_chest.
07-14-2006, 06:39 PM#3
Rising_Dusk
Hrm... That seems to be a very clever way to go about it.
I'll experiment with that idea and see how it works out -- Thanks a lot.
07-14-2006, 06:59 PM#4
Vexorian
I blame BLizzard . Some how SetUnitLookAt makes the model reset the bone position a little before setting it again. So it doesn't look right, I was going to add that to the caster system.

Reminds me that I need to make a modeller make a model with 90 variations of the stand animation with different z axis and then do SetUnitAnimationById
07-15-2006, 09:58 PM#5
Rising_Dusk
I tried the method Pipe suggested and well, as Vex mentioned it looks funky and makes it look the correct angle then down then to the correct angle, and so on.
It wasn't really fluid at all.

Was there another method to achieve this effect?
Or am I going to have to wait for Vex to make that model?
07-15-2006, 10:02 PM#6
PipeDream
It sounds like you're calling SetUnitLookAt multiply. You only need to set it once.
07-15-2006, 10:04 PM#7
Vexorian
Nope, SetUnitLookAt is bugged
07-15-2006, 10:05 PM#8
shadow1500
http://www.wc3campaigns.net/showpost...16&postcount=3
07-15-2006, 10:11 PM#9
Rising_Dusk
Perfect.
Absolutely perfect.

I'll try it right away.
Thank you all very much for your time.
07-15-2006, 10:39 PM#10
iNfraNe
Quote:
Originally Posted by shadow1500
Damn, you beat me to it!

What you CAN do however, is create a dummy unit for the dummy unit to look at. Makes sense? yes.

The first unit to which the the special effect is added will then only call the setlookat once, meaning it will not reset. Instead, you move the unit he is looking at around.
07-15-2006, 10:54 PM#11
Vexorian
that's overkill
07-15-2006, 11:09 PM#12
iNfraNe
I dont see why that would be overkill, moving a unit wouldnt be slower than setting lookat... It's how ani and I make all our maps :P (actually, ani mostly scripts them :P)
07-15-2006, 11:12 PM#13
Vexorian
But if it is an already heavy projectile system creating 2 dummies per projectile and requiring to move 2 units each time is overkill
07-15-2006, 11:35 PM#14
PipeDream
So it does work?
07-15-2006, 11:36 PM#15
Rising_Dusk
In the case of using it for an AoS map, I decided to go with the model.
I can sacrifice 34kb for the model, and quite frankly it makes less unit creating and such.

If it were for a cinematic or some such I'd probably use the SetUnitLookAt, but for now this should work.
If I decide to change it later, I may do that. I don't want to tread on sketchy waters when I know this will work just as happily.
Thanks again. :D