Multiple weapon handling and changing dynamically
by Mahmudul Hasan Sohag · in Technical Issues · 10/08/2008 (10:42 am) · 4 replies
Hi,
I am new to torque. I am developing s simple FPS using TGEA 1.7
Now I can't figure out how I can neatly maintaina a weapon inventory and change player weapon in the game runtime . Can anyone please hint on this topic.
Thanks in advance.
I am new to torque. I am developing s simple FPS using TGEA 1.7
Now I can't figure out how I can neatly maintaina a weapon inventory and change player weapon in the game runtime . Can anyone please hint on this topic.
Thanks in advance.
About the author
#3
resWeapon Cycling in Torque
How to add a Weapon HUD
Dynamic Weapon Hud
10/08/2008 (12:55 pm)
These are old resources but are still applicable to TGEa:resWeapon Cycling in Torque
How to add a Weapon HUD
Dynamic Weapon Hud
#4
10/12/2009 (2:16 pm)
ok, i know this thred is old and all, but still, how would you name the editor dirk like you did? that would really help me fix many of my problems
Torque Owner Aaron E
Default Studio Name
But here's a very quick guide.
If you have a player with an editor name of Dirk, then at the console, or in script, you could do something like this . . .
That line places a functional version of a weapon object into the first weapon mount node.
While you're at it, you could add another weapon on the second node for dual wielding or grenade action or whatever . . .
That line adds a different 'weapon' to the second weapon mount node.
Now if you want to add ammunition to those two functional weapons, just execute the following . . .
That code adds 30 rounds of ammunition to be used with the machinegun functional weapon image and three grenades to be used for the grenadetosser functional weapon image.
You can only have one weapon in a mount slot at a time, so a subsequent issue of . . .
will replace the machine gun with a flamethrower, but leave the grenadetosser in place. You would still need to add flamethrower ammo in a separate command, but hopefully you get the idea of that process.
Now these commands are only a small part of what's possible with a larger weapons management system/inventory, but if you look through the script files listed above, and start experimenting with them, you should be able to get the hang of it quickly.
I hope that helps.