Weapons selection
by Morrie · in General Discussion · 08/06/2007 (7:47 pm) · 6 replies
I've created some weapons in max.
I was wondering how I would create selection key.
say I have 4 weapons.
weapon1 use key 1
weapon 2 use key two
weapon 3 use key 3
weapon 4 use key 4
Does anyone know how I would script this in.
where I would put the files.
I tried a couple off the GG search site but they are old and don't seem to work.
Thank you.
I was wondering how I would create selection key.
say I have 4 weapons.
weapon1 use key 1
weapon 2 use key two
weapon 3 use key 3
weapon 4 use key 4
Does anyone know how I would script this in.
where I would put the files.
I tried a couple off the GG search site but they are old and don't seem to work.
Thank you.
#2
08/06/2007 (9:45 pm)
I don't know. I figured you would have add something
#3
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5907
^_^
08/06/2007 (9:51 pm)
"Weapon Cycling in Torque" is a solution for you I think :www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5907
^_^
#4
1. Make a yourweapon.cs file for each weapon, use crossbow.cs as a template, and add yourweapons.cs files to the server/scripts folder.
2. Edit game.cs, at the top add exec("./yourweapon.cs"); for each weapon and around line 310 edit the Starting equipment.
%player.setInventory(yourweapon,1); // yourweapon set in inventory
%player.setInventory(yourweaponAmmo,100); // yourweaponAmmo set in inventory
%player.setInventory(otherweapon,1); // otherweapon set in inventory
%player.setInventory(otherweaponAmmo,100); // otherweaponAmmo set in inventory
%player.mountImage(yourweaponImage,0); // your starting weapon mounted to the player
3. Edit player.cs , around line 663 you need to add maxInv for each weapon and ammo.
maxInv[yourweapon] = 1; // max weapon player can have in inventory
maxInv[yourweaponAmmo] = 100; // max weaponAmmo player can have in inventory
maxInv[otherweapon] = 1; // max weapon player can have in inventory
maxInv[otherweaponAmmo] = 100; // max weaponAmmo player can have in inventory
Client side
1. Edit the client/config.cs file by adding
moveMap.bindCmd(keyboard, "2", "commandToServer(\'use\',\"yourweapon\");", "");
moveMap.bindCmd(keyboard, "3", "commandToServer(\'use\',\"otherweapon\");", "");
2. Edit the client/scripts/default.bind.cs file around line 223 by adding
moveMap.bindCmd(keyboard, "2", "commandToServer(\'use\',\"yourweapon\");", "");
moveMap.bindCmd(keyboard, "3", "commandToServer(\'use\',\"otherweapon\");", "");
Thats it. Let me know if you need more help.
08/07/2007 (6:58 am)
Server side1. Make a yourweapon.cs file for each weapon, use crossbow.cs as a template, and add yourweapons.cs files to the server/scripts folder.
2. Edit game.cs, at the top add exec("./yourweapon.cs"); for each weapon and around line 310 edit the Starting equipment.
%player.setInventory(yourweapon,1); // yourweapon set in inventory
%player.setInventory(yourweaponAmmo,100); // yourweaponAmmo set in inventory
%player.setInventory(otherweapon,1); // otherweapon set in inventory
%player.setInventory(otherweaponAmmo,100); // otherweaponAmmo set in inventory
%player.mountImage(yourweaponImage,0); // your starting weapon mounted to the player
3. Edit player.cs , around line 663 you need to add maxInv for each weapon and ammo.
maxInv[yourweapon] = 1; // max weapon player can have in inventory
maxInv[yourweaponAmmo] = 100; // max weaponAmmo player can have in inventory
maxInv[otherweapon] = 1; // max weapon player can have in inventory
maxInv[otherweaponAmmo] = 100; // max weaponAmmo player can have in inventory
Client side
1. Edit the client/config.cs file by adding
moveMap.bindCmd(keyboard, "2", "commandToServer(\'use\',\"yourweapon\");", "");
moveMap.bindCmd(keyboard, "3", "commandToServer(\'use\',\"otherweapon\");", "");
2. Edit the client/scripts/default.bind.cs file around line 223 by adding
moveMap.bindCmd(keyboard, "2", "commandToServer(\'use\',\"yourweapon\");", "");
moveMap.bindCmd(keyboard, "3", "commandToServer(\'use\',\"otherweapon\");", "");
Thats it. Let me know if you need more help.
#5
08/07/2007 (10:19 am)
Thanks for all of your help
Ben Immel