View Full Version: Another weapons type question

wolfers >>Coding Alliance >>Another weapons type question


<< Prev | Next >>

lizardcommando- 09-12-2005
Another weapons type question
I've decided that I will add in an SMG in Pokestein. Anyways, I want it so that if you pick up the SMG the first time, you can use it. Ok, that's obvious enough, but here's the tricky part: If you pick up another SMG, be it from a badguy or just lying around in some room, you will now be able to dual wield (go akimbo, hold two of 'em, etc.) How would I be able to do this?

Dr. Chainsaw- 09-12-2005

Do u mean shot them at the same time or say 'A key shots gun1 and S key shots gun2'. Max had that problem aswell.

lizardcommando- 09-12-2005

Well, not exactly. I just want it so that if you pick up the gun again, it would give you another SMG rather than keep giving you a single SMG. Example: pick up SMG = recieve one (it would be assigned to key 6) pick up another SMG = recieve second one (it would be assigned to key 7)

Dr. Chainsaw- 09-12-2005

U know when u kill an ss they drop a machine gun then once you have the machine gun the ss drop ammo. Maybe you can just change the ammo 2 a new weapon.

Hair Machine- 09-13-2005

First install Joe's 'don't get a lower weapon with a higher one' tutorial that Dr. Chainsaw posted here (if you haven't already). We'll say that the SMG is called "wp_smg" - add it, but you'll have to do a bit of editing to the tutorial. Basically, remember to add the "int smg" line in otherwise it won't work. It should all be fairly self-explanatory from Joe's tutorial... Then, add another new weapon; called for example "wp_smg2", except do not add the pickup sprites, or any "bo_" pickup code. Make this weapon double the power of the first SMG, as it is the 'double SMG' weapon that you select with the '7' key. Once you've got all this set up (I'll trust that you know what you're doing ;) ), open WL_AGENT.C. Find the "bo_" pickup definition in this file. In the case of bo_smg it should look something like this: case bo_smg: SD_PlaySound(BLAHSND); //whatever it is GiveWeapon(wp_smg); break; Edit it so it looks like this: case bo_smg: SD_PlaySound(BLAHSND); //whatever it is if (!smg) GiveWeapon(wp_smg); else GiveWeapon(wp_smg2); break; If you've done the first bit right, the first time an SMG is picked up the player will receive the "bo_smg" weapon; the second time, and on every subsequent occasion, he'll receive the "bo_smg2" weapon, which is two machineguns, thus giving the impression that the player has picked up a second SMG. Put any errors down here and I'll have a shot at fixing them :)

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.