Object Explosion
by Ali Akhavan · in Torque Developer Network · 07/22/2009 (4:37 am) · 1 replies
Hi,
I am using TGEA 1.8.0
I Want to load Barrel DTS model on game
------> I need to know how write a script , When player weapon fire to this Barrel , this Barrel play
Explosion animation <--------------
Thanks
I am using TGEA 1.8.0
I Want to load Barrel DTS model on game
------> I need to know how write a script , When player weapon fire to this Barrel , this Barrel play
Explosion animation <--------------
Thanks
Associate Michael Hall
Distracted...
You would need to give it Namespace::damage(), Namespace::onDamage() methods. Other useful functions would be Namespace::onEnabled(), Namespace::onDisabled(), and Namespace::onDestroyed().
Inside the damage() function is where you applyDamage()
Inside the onDamage() function you would compare damage states thought getDamageLevel().
Your object will need to be setup correctly with the various damageLevel fields in it's datablocks and you will need to have these damage methods in order to cause damage to the object. If you object has an explosion field defined, once it reaches the maxDamage level it will be "destroyed" and "explode".
Kaboom