Game Development Community

Mounting (nodes, points, names...)

by Infinitum3D · in Artist Corner · 04/14/2009 (11:46 am) · 14 replies

I'm using Studio Max, and trying to mount a stationary object to a moveable object. My stationary object (like a sword) gets a dummy node named mount0, and my moving object (like a hand) gets a dummy node named mountPoint?

Is that right?

If I'm trying to mount object1 to object2, does it matter which gets named mount0?

What's the difference (if any) between a mountPoint and a mount node?

And lastly, how do I connect the mountpoint (or whatever its called)? Do I use the schematic view to connect it to start01 or to sword2?

I'm trying to use Show Tool to mount the objects, but it never lists my mountpoint in the nodes, so it keeps mounting my objects at origin (0, 0, 0)...

Am I exporting something wrong?

I know this is asking alot of questions at once, but this is my first attempt at mounting and I've spent hours trolling the forums and exporting shapes, and I'm a bit loopy right now from it.

Thanks!

Tony

#1
04/14/2009 (1:04 pm)
OK, I guess I need a "mount.cfg" file with
Always Export:
mountPoint
mount0

but when I load the config file in the exporter, it doesn't work. The dump file says "Config file not found", so where do I put the config file so it can be found?

ANSWER: in the same folder as the .max file.

Thanks!
Tony
#2
04/15/2009 (12:14 pm)
OK, so I can mount the two objects in ShowTool. How do I mount objects in TGE?

Thanks!
Tony
#4
04/15/2009 (12:40 pm)
So it looks like the object being placed on another (like a hat) has a single "mountpoint", whereas, the receiving object (like the person) can have upto 8 mount "nodes" named mount0, mount1, etc.

Tony
#5
04/15/2009 (3:07 pm)
Here is a copy of the DTS Nodes PDF that I created ages ago that lists all of the normal/common nodes that Torque can use or expects (along with some functionality).
#6
04/16/2009 (2:41 am)
Thanks Logan,

that document seems very useful. Reading it now.
#7
04/16/2009 (4:27 am)
Awesome! That's a big help.

Thanks!

Tony
#8
04/16/2009 (5:13 am)
Quote:the receiving object (like the person) can have upto 8 mount "nodes" named mount0, mount1, etc.

I believe the DTS format will support up to 32[mount0-mount31] mount nodes per shape. It is in the 8 'image' slots that a limitation exists, only allowing 8 'triggerable' mounts...which, I believe, means you can only 'control'/manipulate up to 8 'images'/mounts.

You can also mount objects to other mounted objects...to increase the 'mount'ed object count, you still only get 8 mount 'slots' for control.
#9
04/16/2009 (11:03 am)
@Rex, thanks, but that confuses me even more than I already was...

When I "mount" objects, am I actually mounting two objects together, or am I mounting the "image" of an object onto an object? I thought it was ALWAYS an image that got mounted. But it sounds like I'm wrong on that.

Nevermind. I found it. By making an object an "ITEM" and NOT an "IMAGE", you can do 'combo' mounting.

Tony
#10
04/17/2009 (10:31 am)
So how does all this get scripted?

echo("sign.dts with 'mountPoint' to be"); 
echo("attached to pole.dts with 'mount0' node");

datablock ItemData(Sign)   
{   
        shapeFile = "~/data/shapes/Sign.dts";   
        mountPoint = 0;   
};   

datablock StaticShapeData(Pole)   
{   
        shapeFile = "~/data/shapes/Pole.dts";   
        mountPoint = 0;   
};   

function Pole::onAdd(%this, %obj)
{
%this.mountObject(Sign, 0);
}

I'm getting "unknown command mountObject"

Should this automatically mount a sign to a pole when you place a pole? I can't get it to work. Is there a way to use the editor or console to mount an object? I can mount the sign to the pole in ShowTool, just not in the game.

I've tried ItemData(Sign), StaticShapeData(Sign), ShapeBaseImageData(Sign) (but I don't want to use an 'image', I want to use an 'object'.

Any help?

Tony
#11
04/30/2009 (9:31 am)
try the correction shown below for this fragment:

find this:

function Pole::onAdd(%this, %obj)  
 {  
 %this.mountObject(Sign, 0);  
 }

replace it with this one:

function Pole::onAdd(%this, %obj)  
 {  
 %obj.mountObject(Sign, 0);  
 }

#12
05/01/2009 (1:34 am)
For the record, that still won't work, as 'Sign' is a datablock, not an object.

Also for the record, since I can't tell whether this was cleared up:
Quote:My stationary object (like a sword) gets a dummy node named mount0, and my moving object (like a hand) gets a dummy node named mountPoint?
Should be the other way around. The hand has a mount0 mode, and the weapon has a mountPoint. This is because a character with two hands might have to have mount0 for the right hand and mount1 for the left hand. A sword only has one handle, so its node is named mountPoint, of which there can only be one (there is no number distinction).
#13
05/01/2009 (3:38 am)
Hm, Daniel,
I guess Tony was trying to use mountObject method not the mountImage. I don't know what he was trying to do but i would suggest to make it work using mountImage.
Anyway you are right about the Sign object. :) I did a mistake , he needs to make an object first
#14
05/01/2009 (6:37 am)
I was able to get mountObject to work.

And Daniel was right. The mountable object (sword) needs a single mountPoint, while the receiving object (hand) can have multiple (mount0, mount1, etc.) nodes.

Both objects need datablocks with the correct data.

Thanks to everyone for their help!