Help with mountpoint
by KLEBER SEIXAS · in General Discussion · 10/18/2006 (12:36 pm) · 5 replies
They forgive for my English, but going direct to the subject:
My problem is that I want to place 2 objects in the world. E pressing only one button, one escache in the other. For this I want to use mountpoint. All help is coming well. ^^
My problem is that I want to place 2 objects in the world. E pressing only one button, one escache in the other. For this I want to use mountpoint. All help is coming well. ^^
About the author
#2
Now another one doubts: As I make this in the way of a animation. I want to make a animation in 3dMAx and decorer of it to add and to remove objects of mountpoint.
10/20/2006 (12:17 pm)
Thank Allyn ^^, Now another one doubts: As I make this in the way of a animation. I want to make a animation in 3dMAx and decorer of it to add and to remove objects of mountpoint.
#3
The objects attached to them WILL be effected by the changes (animation) of the Nodes.
Other than sizing it down to nothing, there is no way to use the animation to remove the object mounted to them.
You must use Torque Script.
I think thats what you were asking.
10/20/2006 (12:44 pm)
Mount point will accpet position, scale and rotation. The objects attached to them WILL be effected by the changes (animation) of the Nodes.
Other than sizing it down to nothing, there is no way to use the animation to remove the object mounted to them.
You must use Torque Script.
I think thats what you were asking.
#4
Here this mine codigo, what I am making of made a mistake?
datablock ItemData (Peca)
{
category = "Peca";
shapeFile = "~/data/domino/0x0.dts";
mountPoint = 0;
mass = 1;
friction = 1;
};
datablock ItemData (Peca1)
{
category = "Peca";
shapeFile = "~/data/domino/0x1.dts";
mountPoint = 0;
mass = 1;
friction = 1;
};
function ItemData::create (%data)
{
%obj = new ItemData()
{
dataBlock = %data;
rotate = true;
static = false;
};
return %obj;
}
function teste (%this, %this1)
{
%peca = new Item(%this)
{
datablock = %this;
rotation = "0 0 1 " @ (getRandom() * 360);
static = false;
};
%peca2 = new Item()
{
datablock = %this1;
rotation = "0 0 1 " @ (getRandom() * 360);
static = false;
};
MissionGroup.add(%peca);
MissionGroup.add(%peca2);
%peca.setTransform("211.452 -60.6528 179.65");
%peca2.setTransform("214.452 -60.6528 179.65");
%aux = %Peca.mountObject( Peca1 , 1 );
if (%aux){
echo("it functioned");
}
else echo ("no functioned");
}
10/26/2006 (12:35 pm)
Used this but he did not function. The objects are created, but are not joined in mount. Here this mine codigo, what I am making of made a mistake?
datablock ItemData (Peca)
{
category = "Peca";
shapeFile = "~/data/domino/0x0.dts";
mountPoint = 0;
mass = 1;
friction = 1;
};
datablock ItemData (Peca1)
{
category = "Peca";
shapeFile = "~/data/domino/0x1.dts";
mountPoint = 0;
mass = 1;
friction = 1;
};
function ItemData::create (%data)
{
%obj = new ItemData()
{
dataBlock = %data;
rotate = true;
static = false;
};
return %obj;
}
function teste (%this, %this1)
{
%peca = new Item(%this)
{
datablock = %this;
rotation = "0 0 1 " @ (getRandom() * 360);
static = false;
};
%peca2 = new Item()
{
datablock = %this1;
rotation = "0 0 1 " @ (getRandom() * 360);
static = false;
};
MissionGroup.add(%peca);
MissionGroup.add(%peca2);
%peca.setTransform("211.452 -60.6528 179.65");
%peca2.setTransform("214.452 -60.6528 179.65");
%aux = %Peca.mountObject( Peca1 , 1 );
if (%aux){
echo("it functioned");
}
else echo ("no functioned");
}
#5
also, is the rotation property in units of degrees or radians? I use radians for my game but I'm using version 1.3 of the engine. was this changed in 1.4? I would like my script to be compatible with all versions of torque.
10/26/2006 (12:49 pm)
You cant mount items onto other objects. use a staticshape instead.also, is the rotation property in units of degrees or radians? I use radians for my game but I'm using version 1.3 of the engine. was this changed in 1.4? I would like my script to be compatible with all versions of torque.
Torque Owner AllynMcelrath
The object that it will be mounted on needs a NODE named "mount0" (or mount1 ETC...)
%obj = Object you want to mount to
staticObjectDataBlockName = Datablock of the object to be mounted
slot = mount0 (etc...)
http://tdn.garagegames.com/wiki/Torque_Console_Objects_9#ScriptObject