Interior Destruction
by James Thompson · in Torque Game Engine · 07/31/2006 (3:03 am) · 1 replies
Hi,
Some may remember that I was having big problems getting destructible interiors.
Well after a lot of thinking I decided to move the interior below ground, which was easy enough:
Then I had to call that whenever a projectile hit an interior, again easy enough:
I now have a simple system that moves the interior below ground
But after I get a simple system working, I add to it and add to it
I tried to:
-> create a particle effect by the interior
-> create a sound
-> delete the partciles and the sound
Creating them was easy, deleting them was harder, much harder
I tried to use schedules but that didnt work beacuse if I shot 3 interiors then the schedules would restart.
My question is:
How could I expand this to:
-> create a particle effect by the interior
-> create a sound
-> delete the partciles and the sound
for each interior that's shot?
Thanks In advance
Some may remember that I was having big problems getting destructible interiors.
Well after a lot of thinking I decided to move the interior below ground, which was easy enough:
function movedown(%object, %target)
{
%origin = %object.getTransform();
%x = getWord(%origin, 0);
%y = getWord(%origin, 1);
%z = getWord(%origin, 2);
%target = (%x) SPC (%y) SPC (%z -999);
%object.setTransform(%target);
}Then I had to call that whenever a projectile hit an interior, again easy enough:
function CrossbowProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
// Stock code is here
// new stuff
if (%col.getType() & $TypeMasks::InteriorObjectType){
movedown(%col, %pos);
}
//end new stuff
// Stock code is here
}I now have a simple system that moves the interior below ground
But after I get a simple system working, I add to it and add to it
I tried to:
-> create a particle effect by the interior
-> create a sound
-> delete the partciles and the sound
Creating them was easy, deleting them was harder, much harder
I tried to use schedules but that didnt work beacuse if I shot 3 interiors then the schedules would restart.
My question is:
How could I expand this to:
-> create a particle effect by the interior
-> create a sound
-> delete the partciles and the sound
for each interior that's shot?
Thanks In advance
About the author
Been a programmer for a few years, started when I was quite young and got into it so carried on through my life. Currently studying at Kent Uni in Canterbury.
Torque Owner James Thompson
Keiouu Studios
Just so you know why im not replying