Game Development Community

Mount point question

by Casey Weidner · in Torque Game Engine · 08/31/2004 (3:52 pm) · 8 replies

Hi, i may have over looked this, but when building models is there more mount points than just weapons? i.e. for armor clothes bags that sort of thing? or is that something that i am going to have to do from scratch? thanks

Casey

#1
08/31/2004 (4:35 pm)
Mount points can be used for a variety of things really its all what you tell to mount to the location. You could even bind an object to a bone if you really dug deep enough into the code and wanted that.

I hope that helps, just let us know if you need more info.
#2
08/31/2004 (5:55 pm)
Thanks for the quick replie, im sure i'll have more questions..lol... but i need to look into the dts exporter for gamespace some more to make sure i'm understanding every thing correctly ..

Thanks again

Casey
#3
09/01/2004 (6:49 am)
It's not that hard to use them.

In your model, create nodes called mount0,...mount9.

When mounting an image or an object, you just need to specify the node number ( 0...9)
#4
09/01/2004 (9:58 am)
Here are some more detailed explanations that may help you quite a bit. Be sure and read to the end because some of the info has changed and been updated towards the end.

www.garagegames.com/mg/forums/result.thread.php?qt=20978
#5
09/01/2004 (10:55 am)
Thanks for all the input every one, i'll take a look at that link

Casey
#6
09/01/2004 (11:39 am)
Casey,

You got some of this info, but I'm spewing anyways:

A shapeBase Derived object can have up to 32 mountpoints (not some may be off-limits or specialized, I'm looking into this now). They are represented by the a joint/node named mount0, mount1, ... mount31

If you wish to mount an image or a shape to mount point on another shape, the object to be mounted must have a node named: mountpoint.

Mounting images:

Images must specify which node they will mount to in the datablock ->
datablock shapeBaseImageData(myNewDatablockName) {
    shapefile = "xyz...";
...
    mountPoint = 0; // Mount me on mount0, etc.
}

Then to mount, assuming %obj is a handle to some shapeBase object you wish to mount to, you would type:

// The first argument is the image datablock ID or in this case the name
// The second argument is a slot (not a mountpoint), of which you have eight per shape
%obj.mountImage(myNewDatablockName, 0);

To mount a shape on a shape, assuming %obj is the shape to mount on and %obj2 is the shape be mounted:

// First argument is the shape to mount onto %obj
// Second argument is the MOUNT POINT (in this case mount0)
%obj.mountObject(%obj2,0);

Hope this helps!

Note: This will be covered as well as many other samples in EGTGE when it comes out.

[HOW]EdM|EGTGE
#7
09/01/2004 (6:14 pm)
Thanks Edward, That was helpful you explained it alittle more clear.

Casey
#8
08/22/2007 (9:40 am)
Hi All,
I am having a little problema with mount point,
I did a test with a character (player) - creating a mountpoint in dts player and dts obj...
Test in TorqueShowToolPro and its work fine but when I test in the game the mount point looks a little diference in the position (a little offset)

Here is my script test to do that:

datablock StaticShapeData(ObjTest)
{
catagory = "Misc";
shapeFile = "./obj.dts";
emap = true;
mountPoint = 0;
//eyeOffset = "0.0 1 0.0";
};


%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};

%obj = new StaticShape() {
canSaveDynamicFields = "1";
datablock = "ObjTest";
receiveSunLight = "1";
receiveLMLighting = "1";
useAdaptiveSelfIllumination = "0";
useCustomAmbientLighting = "0";
customAmbientSelfIllumination = "0";
customAmbientLighting = "0 0 0 1";
useLightingOcclusion = "1";
};

%player.mountObject(%obj,0);


There is any tip to do that? Its correct?