Page 1 of 1

Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 2:14 am
by DetectDefective
Is it possible? I've been wanting to make a mod for the past while, and I've got quite a few guns in mind. Various rifles, shotguns, SMGs, even sidearms. Not skins, full weapons.

My coding knowledge is extremely poor, but I'd still like to give it a shot.

I have looked over the master files and I see how weapons are written.
Code: Select all
class RifleWeapon3: public Weapon {
		public:
			RifleWeapon3(World*w,Player*p):Weapon(w,p){}
			virtual std::string GetName() { return "Rifle"; }
			virtual float GetDelay() { return 0.5f; }
			virtual int GetClipSize() { return 10; }
			virtual int GetMaxStock() { return 50; }
			virtual float GetReloadTime() { return 2.5f; }
			virtual bool IsReloadSlow() { return false; }
			virtual WeaponType GetWeaponType() { return RIFLE_WEAPON; }
			virtual int GetDamage(HitType type, float distance) {
				switch(type){
					case HitTypeTorso: return 49;
					case HitTypeHead: return 100;
					case HitTypeArms: return 33;
					case HitTypeLegs: return 33;
					case HitTypeBlock: return 50;
					default: SPAssert(false); return 0;
				}
			}
			virtual Vector3 GetRecoil () {
				return MakeVector3(0.0001f, 0.05f, 0.f);
			}
			virtual float GetSpread() { return 0.006f; }
			virtual int GetPelletSize() { return 1; }
		};
The code reminds me of LUA, which I tinkered with for Trouble in Terrorist Town. I see it being easy to make new guns, but it's the implementation/addition that I'm worried about, since I'd like to have at around 15 guns of varying types.

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 2:29 am
by Jdrew
scripting is AngelScript, sure its possible but no one cares enough to learn and help out

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 2:53 am
by DetectDefective
Jdrew wrote:
scripting is AngelScript, sure its possible but no one cares enough to learn and help out
Thanks much for the code's exact name, I honestly thought it was some sort of C++. I've got the free time but lack the drive/patience, so I'll see if I can get into this.

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 8:52 am
by Warp
I would be very interested in this.

Not very good at coding, but would help with new weapon models etc.

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 6:16 pm
by learn_more
yes it's possible, and if you would have had a brain you would have seen someone already did it.

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 6:23 pm
by DetectDefective
Warp wrote:
I would be very interested in this.

Not very good at coding, but would help with new weapon models etc.
Damn, that was fast. You'd be a great help there, definitely, but I'd wait until I have this code thing settled. Rather not waste anyone's time other than my own, in case I still eat dirt at coding. Thanks much, though.
learn_more wrote:
yes it's possible, and if you would have had a brain you would have seen someone already did it.
Ah, my bad, didn't know. Care to link?

Re: Question: Adding completely new guns/items?

Posted: Thu Jun 26, 2014 6:26 pm
by Jdrew
Learn more is most likely talking about the flashlight not an actual new item

Re: Question: Adding completely new guns/items?

Posted: Sun Jun 29, 2014 6:16 am
by DetectDefective
Jdrew wrote:
Learn more is most likely talking about the flashlight not an actual new item
I'd like to know what he was talking about specifically, then.
learn_more wrote:
yes it's possible, and if you would have had a brain you would have seen someone already did it.
Still waiting on a link, since I lack the brain, friend.

Re: Question: Adding completely new guns/items?

Posted: Sun Jun 29, 2014 6:39 am
by MrHaaax
I could help with the models if you want.

Re: Question: Adding completely new guns/items?

Posted: Mon Jul 07, 2014 8:12 am
by Chameleon
I can help w/ .as files (View.as) and C++. But I'll be away for two weeks, be back @ 2014.07.20

Re: Question: Adding completely new guns/items?

Posted: Thu Jul 10, 2014 11:15 pm
by Hot Dog
Where exactly did you find the file posted in the OP?
DetectDefective wrote:
learn_more wrote:
yes it's possible, and if you would have had a brain you would have seen someone already did it.
Still waiting on a link, since I lack the brain, friend.
I too would like to see this, learn_more.