Game Development Community

Remote triggered bombs?

by Sangwoo Hong · in Torque Game Engine · 05/25/2006 (5:11 pm) · 2 replies

Does anyone know of a resource that does this ala Duke Nukem?

#1
05/25/2006 (5:30 pm)
Nope, but it's really easy to do. Without a small source change you can't remote detonate projectiles, but that's easy to add and just gets you the explosion effect and onExplosion callback. You might want to use Item class objects too, because their physics are better for something that lies around. It's not something that's hard to code either way... the basis is store a reference to whatever you create when you fire it, then use that reference to detonate when you fire again or invoke an alternate trigger or whatever setup you want. Like in pseudo code:
blah::onfire(%this, %obj, %slot){

if(%obj.remoteDet){

<code to make your bomb thing blow up>

%obj.remotDet = 0;

}
else
{
<code making and firing projectile/item/whatever>

%obj.remoteDet = %yourBomb;
}


}
Of course you can, and I have, do more complex setups managing arrays of objects you can detonate and such. I haven't played DN3D in ages so I forget how it worked there.
#2
05/26/2006 (12:04 am)
Cool!

In DN3D you toss a dynamite then blow it up then toss another etc so what you describe should work. I will probably go the item route but modifying the land mine resource seems like an idea too.

Thanks!