Creating game objects that take hits and react
by Paul Hoza · in Torque Game Engine · 11/26/2003 (1:16 am) · 2 replies
I'm working on my first full game in Torque so I'd appreciate some direction for what I'm doing. I want to have objects in the game that you can shoot and affect with a script... basically, "targets".
I was originally hoping to be able to do this through scripts alone, but I'm starting to think I need to make a new ItemData-type class that can be damaged and such. Any help getting started on this endeavor would be appreciated... I've looked for a while for resources or examples of this, but have run dry. Help determining which existing class(es) to base this from would be great if that's the desired approach.
Here are the types of things I want to use the "target" object for/with:
- Destructible object (either using debris or animated .dts sequences)
- Target that starts up another event script when hit (like "hit an object and it starts spinning/moving" or some such)
- Target moves through the map (on path or randomly)
- When hit, triggers animations within the object (like death anims, etc.)
I was considering just basing this all from the AIPlayer, since it knows how to handle following paths and being killed, etc. However, I'm too new to this whole endeavor to know if that's completely foolish.
Thanks for any patience with my learning process! :-)
I was originally hoping to be able to do this through scripts alone, but I'm starting to think I need to make a new ItemData-type class that can be damaged and such. Any help getting started on this endeavor would be appreciated... I've looked for a while for resources or examples of this, but have run dry. Help determining which existing class(es) to base this from would be great if that's the desired approach.
Here are the types of things I want to use the "target" object for/with:
- Destructible object (either using debris or animated .dts sequences)
- Target that starts up another event script when hit (like "hit an object and it starts spinning/moving" or some such)
- Target moves through the map (on path or randomly)
- When hit, triggers animations within the object (like death anims, etc.)
I was considering just basing this all from the AIPlayer, since it knows how to handle following paths and being killed, etc. However, I'm too new to this whole endeavor to know if that's completely foolish.
Thanks for any patience with my learning process! :-)
About the author
Associate Kyle Carter