Game Development Community

Adding more weapons

by Eran Caspi · in Torque Game Engine · 10/15/2005 (1:08 pm) · 5 replies

Hello

Im trying to add more weapons to my game but without a luck
I tried to do Realistic shotgun script with multiple projectiles and impulse blast
but I ca't pick the weapon, I add it to the world with World Editor Creator, but when
I walk over it and nothing happens and the weapon is in the same place.
The weapon is spining and I made sure I didn't put it as a static object.

I add the shotgun file and media and I added the exec("./shotgun.cs"); to
starter.fps/server/scripts directoy.

What am I don't wrong?
and is this resource working for anyone else with TGE 1.3?

#1
10/15/2005 (1:59 pm)
Did you add a maxinv value for the shotgun?
you seem to have to set mav values for the weapons and ammo, or you can't pick it up.
#2
10/15/2005 (2:09 pm)
What Ramen says is true. You must look in server/scripts/player.cs and add a maxInv value for the ammo and weapon in order to be able to have it mount.
#3
10/15/2005 (4:14 pm)
Thank you both for the help.
I added what you said and now it's working
but I have a new problem :)
I can't assign a number to it, I tried to make a search but couldn't find anything
so how can I assign a number for the gun?
#4
10/15/2005 (4:22 pm)
To assign a number for the gun you can add the key in the default.bind.cs (which is located in "starter.fps\client\scripts") and look for this.

//------------------------------------------------------------------------------
// Item manipulation
//------------------------------------------------------------------------------

moveMap.bindCmd(keyboard, "h", "commandToServer('use',\"HealthKit\");", "");
moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");

Then just copy and paste the crossbow line and change "crossbow" to the name of your gun then change the "1" to "2" or any other key. And now when you start the game and you have a crossbow and that gun, you can press 1 and 2 to go back and forth.

Hope this helps,

-Stephen
#5
10/15/2005 (4:33 pm)
That's what I did, here is the line

moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"shotgun\");", "");

It doesn't work, is there some error?