Game Development Community

3d models adding?

by Odiel · in Torque Game Builder · 07/02/2008 (11:33 am) · 1 replies

Hi people.

I have a star shooter game, the ship is a model with some weapon, have by default the laser cannon, the turret, and some place to lunch missile, i want to add some dinamyc interaction, so i decide to add a shooping module where the player can shop weapons and add to the ship. All the weapons are models too, but the problem is : i don't know how to link, merge or something else other weapons on ship?

First i have the full model with the default weapon, but latterly y want to remove the default weapons by new weapons.

Any idea to make this possible?

thanks.

#1
07/02/2008 (11:46 am)
Lol. If there is no animation and it's always top view it's easy.

function mountGun(%gun){
%gun.mount($pShip);
}

certainly if you are replacing it you would want to kill the existing mount first.. but that's the basic idea. You can also create different mount points and specify which one.

If you have like an animated 3d character and need to add weapons, armor, etc to him it's more complicated. I hacked it in by assiging the same animations to each piece of weapon, and layering it on top of eachother. That worked well too, but It doesn't sound like you need to do anythgin that complicated.

also if you haven't setup your $ship you can do it easily, quickest but not best way, by adding the line: "pShip" to your "scripting" rollout in the editor when you have the ship selected.

then add the following in your script:
function pShip::onLevelLoaded(%this, %scenegraph)
{
   $pShip=%this;
}

now you have to pass whatever you want to mount to your mountGun function