Game Development Community

Switching Weapon...?!

by Earl Li · in Torque Game Engine · 01/08/2002 (1:45 am) · 2 replies

Hi, Need some help from u guys = ). I have just started working with this engine, and I still have hard time trying to understand scripts. = ) So far, I have made a few duplicate of the Rifle weapon from the example, and I am wondering how to switch weapon in game.

I bind the key like
moveMap.bind( keyboard, "1", selectRifle );
function selectRifle(%val)
{
if (%val)
commandToServer( 'UseRifle' );
}
in inventory.cs
function serverCmdUseRifle( %client )
{
%client.getControlObject().use( 'Rifle' );
}
LoL, this seems like a long way and is totally wrong, but this is only what I can come up with after digging through the tribes 2 scripts and the forum =-p

Any help is greatly appreciated~

MoMo

#1
01/08/2002 (1:48 am)
Get the latest version from the CVS, it has 2 weapons in it with switching.
#2
01/08/2002 (2:06 am)
Oops,
thx a lot = )