Game Development Community

Items: Animating instead of spinning?

by Maddermadcat · in Torque Game Engine · 01/25/2007 (2:04 pm) · 4 replies

Is there any way to make my items play an animation instead of rotating? Also, I'd like to attach a light to one of them. How would I go about doing that?

Keep in mind that I'm still working with the demo... But if there's absolutely no way to change how the item works without touching the source code, I'd like to know how to do that, too. Just for the future.

Thank you in advance. =)

#1
01/25/2007 (2:48 pm)
In the item's onAdd you can set the object to plat an animation, if the animation loops it will repeat.

Lucky for you the item does have alight in stck torque.

here is a hint do a .dump() on the object or its datablock to get all of it's functions.

the light info is in the datablock

properties are

lightType = NoLight | ConstantLight | PulsingLight
lightColor = color
lightRadius = int

to name a few, Now I better see a good Screenshot of the day.

Keep on Torquen
#2
01/25/2007 (2:54 pm)
You can easily stop items from rotating:
new Item() {
...
rotate = "0";
...
};

Then to get it to play an animation, you should be able to make an "idle" animation and it should play? I tried this and didn't work for me (quite a while ago) but I'm no artist.

To attach a light, if you have the TLK or TGE 1.5. you can attach lights to objects on its creation, by putting a mount node on the model and then attaching the light like so:

$light.attachToObject(%item);

That should work.
#3
01/25/2007 (5:44 pm)
Topic: Item animations.

I already answered this for you.
#4
01/26/2007 (1:52 pm)
Whoops, I completely forgot about posting there. =)

Thank you for the help, guys.

EDIT: Ok, I've been trying to figure this out on my own, but I'm completely confused and need help... My light isn't showing up with the object. I don't know... I assume that I don't just type in the light's datablock's name? That's what I did... Would I have to create a new instance of the light and then get it to mount? If so, how?