Question: Adding completely new guns/items?

OpenSpades is an open source alternative client for AoS Classic and beyond! Runs on Windows, Mac, and Linux. Created by yvt.
Compatible with AoS Classic.
11 posts Page 1 of 1 First unread post
DetectDefective
Deuced Up
Posts: 54
Joined: Tue Sep 24, 2013 8:17 pm


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.
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


scripting is AngelScript, sure its possible but no one cares enough to learn and help out
DetectDefective
Deuced Up
Posts: 54
Joined: Tue Sep 24, 2013 8:17 pm


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.
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


I would be very interested in this.

Not very good at coding, but would help with new weapon models etc.
learn_more
Coder
Coder
Posts: 891
Joined: Sun Mar 24, 2013 9:59 pm


yes it's possible, and if you would have had a brain you would have seen someone already did it.
DetectDefective
Deuced Up
Posts: 54
Joined: Tue Sep 24, 2013 8:17 pm


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?
Jdrew
Mapper
Mapper
Posts: 4808
Joined: Tue Oct 30, 2012 10:48 pm


Learn more is most likely talking about the flashlight not an actual new item
DetectDefective
Deuced Up
Posts: 54
Joined: Tue Sep 24, 2013 8:17 pm


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.
MrHaaax
Modder
Modder
Posts: 1360
Joined: Sun Nov 25, 2012 2:58 am


I could help with the models if you want.
Chameleon
Modder
Modder
Posts: 601
Joined: Thu Nov 22, 2012 6:41 pm


I can help w/ .as files (View.as) and C++. But I'll be away for two weeks, be back @ 2014.07.20
Hot Dog
Blue Master Race
Blue Master Race
Posts: 83
Joined: Sun Dec 22, 2013 2:36 am


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.
11 posts Page 1 of 1 First unread post
Return to “OpenSpades Discussion”

Who is online

Users browsing this forum: No registered users and 18 guests