Game Development Community

Bot weapons wont work

by Chris Labombard · in Technical Issues · 04/21/2005 (5:59 am) · 3 replies

I set up a bot that fires a modified crossbow with bolts that act like a grenade... I got everything working fine, then decided to turn it into a grenade launcher. So I copied the crossbow directory and renamed it grenadelauncher. I copied the crossbow.cs file and renamed it grenadelauncher.cs and executed it in game.cs... I changed all references from crossbow to grenadelauncher except for the sound files, since they were in a different directory. I then changed the weapon name in my bot to grenadelauncher...

When I fire up my game the bots have the crossbow attached to them (the grenadelauncher) and the run at me and shoot but nothing comes out. I can hear the explosions but they dont shoot anything.

Ive put echo's in and know that they are firing. If I switch it back to crossbow then they fire correctly again.

There are no new console errors. I placed an echo in grenadelauncher::onFire() but it doesn't get called.

Any idea what is going on?

About the author

I have been a professional game programmer for over 5 years now. I've worked on virtually every platform, dozens of games and released a few of my own games, including 2 iPhone titles and a title waiting release on Big Fish Games.


#1
04/21/2005 (10:38 am)
You've missed a refference, probably somewhere in the ShapeBaseImageData.
#2
04/22/2005 (4:30 am)
I fixed the problem. What happened was I didn't set maxInv[GrenadeLauncherAmmo] in the Player.cs file... Apparently you can still mount the weapon without a maxInv[GrenadeLauncher] though... I would have caught it earlier if the dry fire sound hadn't sounded so much like an explosion...
#3
04/22/2005 (6:14 am)
BTW be careful, with that maxInv stuff, I did a complete removal of all refferences in all files to maxInv, and now there is no pickup on collision (which is ok I guess because it IS an RPG).