Help with custom function
by Pie · in Torque Game Engine · 02/17/2008 (8:39 am) · 1 replies
Im currently trying to create a function that changes the weapon my character has equipped.
The function gets called and the correct message shows up in the console.
However, the weapon doesn't change, and I get an error message stating:
Unknown command: mountImage
Unknown command: setImageAmmo
Ive used these commands in a different file to equip the weapon once the player has been created, so I know they exist.
Heres the function :
Any help would be appreciated, Thank You
The function gets called and the correct message shows up in the console.
However, the weapon doesn't change, and I get an error message stating:
Unknown command: mountImage
Unknown command: setImageAmmo
Ive used these commands in a different file to equip the weapon once the player has been created, so I know they exist.
Heres the function :
function changeWeapon(%obj,%wep)
{
if (%wep==0)
{
//Should equip Crossbow
echo("Equipping crossbow");
%obj.mountImage( Crossbowimage, 0 );
%obj.setImageAmmo( 0, 1 );
}
if (%wep==1)
{
//Should equip Rocket Launcher
echo("Equipping Rocket Launcher");
%obj.mountImage( RocketLauncherImage, 0 );
%obj.setImageAmmo( 0, 1 );
}
}Any help would be appreciated, Thank You
Torque 3D Owner Peter Simard
Default Studio Name