Game Development Community

How can i pick up new weapons!

by Casey Weidner · in Torque Game Engine · 01/22/2005 (10:31 pm) · 7 replies

Hi every one,

im trying to make it so i can pick up the rocket launcher that comes with the tuts from code sampler in the fps.starter mod, i've gotten then in the mission as weapon and ammo objects by editing the rocket_launcher.sc but ! when the player colides with the objects that are spining in the mission they arnt being picked up and added to the invintory!, i tryed looking threw the resources but no luck! i found a resource on scrolling threw weapons and that didnt help, and i added a key bind to #2 to use the rocketlauncher just like the crossbow uses in the inventory or item scripts...cant remember wich at the moment... but still no luck any one have a guess at whats wrong?? thanks!

Casey

#1
01/22/2005 (10:39 pm)
Do you have a line in player.cs where you state that

maxInv[RocketAmmo] = 50;
maxInv[Rocket_Launcher] = 1;

You need something like this so that the player can have it in his inventory.

Look for a similiar line like this for the crossbow, and add it after that.
#2
01/22/2005 (10:45 pm)
Hurump!!!

well that was helpfull no i didnt have that and i would have never figured that one out on my own... but still a no go... thanks for the help
#3
01/22/2005 (10:57 pm)
AHHH i've been staring at this too long! you were right! i was just so tired at looking at this stuff i copyed what you typed with out even trying to change the names to what i have the datablocks named as! i can pick them up now... but now it doesnt let me shoot! lol... hrrrmm.... i must of broke it some where
#4
01/22/2005 (11:37 pm)
Make sure you have ammo. :)

Try disabling the crossbow, by // the lines in the player file, and in the game.cs, where you have something like

exec["./crossbow.cs"]

Just keep playing with the scripts until you get it working.
#5
03/02/2005 (4:15 pm)
Hey any progress on this? I've had the EXACT same problem, i can mount the rocket launcher but i cant shoot!

And WTF.. Okay.. The datablocks are named RocketProjectile (for the ammo) and RocketLauncher i tried those in the inventory thing and it aint working.

EDIT: After reading through Crossbow.cs I figured out how to get the Rocket Launcher to work properly. Anyone still having trouble with this msg me.
#6
05/13/2007 (7:01 pm)
I seem to pick up the rocket launcher, it clicks, and then disappears. but I'm still carring the crossbow. how do I change?
#7
05/13/2007 (7:22 pm)
Never mind, used // crossbow, but.... I cant pick up ammo.