How do you mount multiple images?
by Josh Albrecht · in Torque Game Engine · 01/22/2002 (2:58 pm) · 2 replies
I am having a little trouble mounting more than one weapon (image). My player model has two mount points, named:
Mount0
Mount1
I have two items that I want to mount. I created a server command to mount each:
function serverCmdSword(%client)
{
%item = new Item() {
dataBlock = Rifle;
};
//%client.player.pickup(%item);
%data = %item.getDatablock();
%client.player.mountImage(%data.image, 0);
}
function serverCmdShield(%client)
{
%item = new Item() {
dataBlock = Rifle;
};
%data = %item.getDatablock();
%client.player.mountImage(%data.image, 1);
//%client.player.pickup(%item);
}
The commented out lines are the "correct" Torque way to mount things. However, my code does succeed in mounting items. Unfortunately, the second parameter of mountImage is supposed to determine teh slot that the weapon goes into (I think), but it doesnt. Both of these commands add the weapon to my Mount0 node... :/ Does anyone have any idea why? Any suggestions on how else to tackle this?
Mount0
Mount1
I have two items that I want to mount. I created a server command to mount each:
function serverCmdSword(%client)
{
%item = new Item() {
dataBlock = Rifle;
};
//%client.player.pickup(%item);
%data = %item.getDatablock();
%client.player.mountImage(%data.image, 0);
}
function serverCmdShield(%client)
{
%item = new Item() {
dataBlock = Rifle;
};
%data = %item.getDatablock();
%client.player.mountImage(%data.image, 1);
//%client.player.pickup(%item);
}
The commented out lines are the "correct" Torque way to mount things. However, my code does succeed in mounting items. Unfortunately, the second parameter of mountImage is supposed to determine teh slot that the weapon goes into (I think), but it doesnt. Both of these commands add the weapon to my Mount0 node... :/ Does anyone have any idea why? Any suggestions on how else to tackle this?
Torque Owner Tim Gift
If you want the same shape to be mounted in two different places on the body then you need two different datablocks, such as one for a weapon in the hand, one for the back. The weapon on the back datablock could also include a rotation or offset to orient the weapon.