Game Development Community

Playing and controling animations...

by Chris \"Hobbiticus\" Weiland · in Torque Game Engine · 11/26/2002 (11:29 am) · 5 replies

I'm writing an automated turret class, and I'm done just about everything that needs to be done. It's mostly a rip off of staticShape, and most of the controls are scripted, which is actually fairly useful for doing most of the aiming itself. However, I'm not quite sure about how to go about moving the pitch and yaw of the turret barrel to match its aim. I can get the vector at which the turret aims pretty easily, but how do I go about actually rotating the top of the turret to match the aim?

I think the way to do it is through animations, so that the turret has a 180 frame rotational animation and a 90 frame elevation animation, then control the animations accordingly to make the turret rotate smoothly to a certain vector. There are 2 things I don't know how to do:

1) Get the proper animation sequence to be played
2) How to actually play and control that sequence.

Any help would be GREATLY appreciated.

Also, in another instance, I'm not quite sure how to get the muzzle point of my turret. Obviously, I'd use the function getMuzzlePoint(), but that function requires a "slot" variable, and I cannot, for the life of me, figure out how to get that value, other than printing it in the console when it loads, then hard coding that value, which is REALLY hacked. Right now, it appears that shapeImage.cc assigns it some value that's stored in the model some way or another...I really have no idea. Again, any help would be greatly appreciated.

P.S. If any person from GG sees this: check the bug forum! I posted a bug fix and a potential bug that don't seem to be getting any attention. And, I think I'll have another bug fix soon.

#1
11/27/2002 (12:24 pm)
um....bumpity bump
#2
11/28/2002 (7:55 pm)
you people suck :(

no one is going to see this if it goes to the second page, so...if you know the answer, let me know so i don't have to be annoying and bump this again and again :P
#3
11/28/2002 (7:57 pm)
Great way to win friends and influence people ! Keep it up ...
#4
11/29/2002 (4:57 pm)
Chris,

Actually, I think the folks here are pretty helpful, but because of the holiday a lot of people are probably gone on vacation and what not. Anyway, I think the answer you need can be found by perusing these tutorials:

click here
I read them a while back and remember something about using a trigger to stop the animation of the flag. By expanding on this and not using the cyclic animation, you should be able to get the result you want.

Thats all I have for you. Best of luck.
Ed
#5
12/03/2002 (8:50 pm)
Yeah, i know, i'm just kidding... I could still use help with this - i don't feel like looking through the entire faq for this stuff because my specific question probably won't be answered...