1 item multiple mount points
by Neil Marshall · in Torque Game Engine · 07/06/2002 (1:00 pm) · 5 replies
In my game I have 1 rollerblade mesh and 2 mount points on my characters feet. I'm trying to modify the rifle/crossbow code so that it takes the one mesh and applies the same one to 2 different mount points.
The only problem is mountPoint in rifle.cs is just a standard variable, and I would like to change it to an array. My problem is that I can't seem to figure out what code reads in the mountPoint variable to actually attach the mesh.
Can anyone point me in the right direction?
The only problem is mountPoint in rifle.cs is just a standard variable, and I would like to change it to an array. My problem is that I can't seem to figure out what code reads in the mountPoint variable to actually attach the mesh.
Can anyone point me in the right direction?
#2
For now I'd settle for two left feet though.
07/06/2002 (6:07 pm)
I have one shoe modeled and I want to clone it, mirror it, then place one on each foot.For now I'd settle for two left feet though.
#3
07/06/2002 (6:16 pm)
Well i would create two shoe objects and mount one in each foot instead...
#4
07/08/2002 (12:38 pm)
Or create two image datablocks: one left, one right, that reference the same shoe shape. The image datablocks can have shape rotations and translations (no mirror though).
#5
I see in the ImageData for the rifle image className = "WeaponImage"; is defined and then in weapon.cs there is a WeaponImage defined with an onMount event, but I don't actually see where it does the actual attaching of the object to the player.
To me it looks like it's attaching the ammo to the slot.
I'm just generally confused as to how the images and data fit together.
07/08/2002 (2:39 pm)
Can you clarify what the difference between ImageData and just Data is?I see in the ImageData for the rifle image className = "WeaponImage"; is defined and then in weapon.cs there is a WeaponImage defined with an onMount event, but I don't actually see where it does the actual attaching of the object to the player.
To me it looks like it's attaching the ammo to the slot.
function WeaponImage::onMount(%this,%obj,%slot)
{
// Images assume a false ammo state on load. We need to
// set the state according to the current inventory.
if (%obj.getInventory(%this.ammo))
%obj.setImageAmmo(%slot,true);
}I'm just generally confused as to how the images and data fit together.
Torque 3D Owner Xavier "eXoDuS" Amado
Default Studio Name