Enviornmental Object Health
by Pectabyte · in Technical Issues · 10/08/2008 (11:00 am) · 3 replies
So I'll assume Models that have been imported into Torque can have Health and then when that Health reaches zero another, messed up, model replaces it. Can the same be done with Brushes?
#2
Your assumption is (mostly) correct for .dts objects. Basic damage handling is already built in, but is not used by any of the stock scripts for anything other than the player. You will need to script in a solution to change the model once it is damaged/destroyed. Note that this change can be a complete swap and replacement with another model or a change due to an animation sequence.
10/08/2008 (2:15 pm)
No, brush based models (.dif) cannot have health/damage properties. This is due to the way in which they are designed. Your assumption is (mostly) correct for .dts objects. Basic damage handling is already built in, but is not used by any of the stock scripts for anything other than the player. You will need to script in a solution to change the model once it is damaged/destroyed. Note that this change can be a complete swap and replacement with another model or a change due to an animation sequence.
#3
10/08/2008 (2:48 pm)
Also to add to this you can do a search for mesh swapping, there are a couple of resources on how its done
Torque Owner Aaron E
Default Studio Name
I'll just focus on DTS shapes for now, but feel free to check out the Torque artists pages for more insight into the way Torque deals with various types of 3D content.
DTS objects are standard mesh shapes that can be created by traditional polygon modeling apps like 3D Studio Max, Maya, XSI, Lightwave, Houdini, Silo, Hexagon, Truespace, MilkShape and Blender. Such files must be exported from one of those programs into the DTS format for Torque before they can be used in any TGE or TGEA game.
DTS objects can be loaded into TGE/A two ways, as static objects and as scripted objects. Static DTS shapes do not have health or exhibit behaviors. Scripted DTS shapes can have a wide variety of behaviors, effects, and abilities, depending on how they are defined in Torquescript. Datablocks are the primary scripting areas that definine how scripted objects work in the game engine. Most (if not all) of those datablock definitions are 'prototyped' in the C++ engine code.
Adding health-enabled props, vehicles and characters to your game world will require some scripting. An elaborate health system might take a lot of scripting. Some basic examples of health-enabled objects can be found in certain Torquescript files like player.cs.
As for your question about brushes, I'm assuming that you are referring to Constructor/3DWS built DIF interiors. I don't work much with those, but using them for dynamic in-game elements is probably not a good idea, since they were designed to provide a static, monolithic presence in a game.
I hope that helps.