Multiple Weapons mounting at the same time help!
by Bobby Leighton · in Torque 3D Professional · 10/16/2009 (5:08 pm) · 5 replies
I'm working on a school project and Ive been over and over my code comparing it with the usual methods of putting in extra weapons and from what I can tell I am doing it right, but it seems to try to mount all of my weapons at the same time. So I made a new project that was clean and then tried adding in the grenade-Launcher and I have the same problem, here's a screen. Please help! Its for school and I really have to get this fixed in fact its the last thing I need to fix! Thanks in advance:O)


#2
function GameCore::loadOut(%game, %player)
{
//echo (%game @"c4 -> "@ %game.class @" -> GameCore::loadOut");
%player.setInventory(RocketLauncher, 1);
%player.setInventory(RocketLauncherAmmo, %player.maxInventory(RocketLauncherAmmo));
%player.mountImage(RocketLauncherImage, 0);
%player.setInventory(M4A1Carbine, 2);
%player.setInventory(M4A1CarbineAmmo, %player.maxInventory(M4A1CarbineAmmo));
KILL THIS//%player.mountImage(M4A1CarbineImage, 2);
}
Only leave the rocketlauncher with the mount image, however not the second weapon
10/17/2009 (12:04 am)
Do an overall search for %player.mountImage which is most likely in GameCore::Loadout. The script would probably look like:function GameCore::loadOut(%game, %player)
{
//echo (%game @"c4 -> "@ %game.class @" -> GameCore::loadOut");
%player.setInventory(RocketLauncher, 1);
%player.setInventory(RocketLauncherAmmo, %player.maxInventory(RocketLauncherAmmo));
%player.mountImage(RocketLauncherImage, 0);
%player.setInventory(M4A1Carbine, 2);
%player.setInventory(M4A1CarbineAmmo, %player.maxInventory(M4A1CarbineAmmo));
KILL THIS//%player.mountImage(M4A1CarbineImage, 2);
}
Only leave the rocketlauncher with the mount image, however not the second weapon
#4
10/17/2009 (1:50 am)
Ok that works in letting the weapons work instead of one overriding the other but it still doesn't unmount them it still mounts them all atm, but Ill keep pawing through thanks for the help, but I would be happy for anything else to try.
#5
10/17/2009 (3:22 pm)
Still cant figure it out, but at least there is more than one weapon working, perhaps Ill look at the commands I see further down in that file about the slot cleanup or something like that, perhaps they are not getting unmounted when the new one moves into position??
Associate Steve Acaster
[YorkshireRifles.com]
Hint, check GameCore::loadout();