Adding custom weapons?

Posted:
31 May 2013, 15:38
by bentito
So are there only so many slots for weapons? I want to put in some custom weapons, but I can't find any docs on a full procedure for doing so...
I see all the weapons in data/models/weapons
I tried adding a new one cp -r shotgun newshotgun of one of those directories but it didn't show up...
Is there a cfg file that refers to them and then makes them show up in the editor?
Re: Adding custom weapons?

Posted:
31 May 2013, 17:45
by unixfreak
As far as i know, you can only "replace" the existing models without modifying any code. You can always customize what the weapon does through the in-game vars if it's able to suit your needs.
If you really wanted to add an extra weapon slot, you'd probably have to look at modifying these files (and possibly more);
http://redeclipse.svn.sourceforge.net/v ... /weapons.hhttp://redeclipse.svn.sourceforge.net/v ... /weapdef.hhttp://redeclipse.svn.sourceforge.net/v ... eapons.cpp...also changing some of the cfg files for the weapon loadout gui would be needed.
Re: Adding custom weapons?

Posted:
31 May 2013, 21:09
by bentito
Thanks very much for the reply.
OK, I would really like to add some more weapons, I'd like to created copies of all the basic ones, my copies will be the same, but they won't spin when they're sitting there. So for instance, trying to have the normal shotgun that spins and also a "no-spin" version. Want to walk around my map and see spinning and non-spinning versions of all the weapon models. So I tried copying all the shotgun lines in weapons.h and weapdef.h, wouldn't even build after that, possibly because I never found out how to change W_MAX.
Maybe I am going about this wrong. How about this? I don't care if the things I am adding act as weapons. Could I take the definition files for say, the shotgun, and add it as some other entity type (bot, player, etc) that would just sit there in the map not spinning and not acting as a weapon? How would I go about that? I see plants for instance in one of the maps, I am assuming those are models just like the weapons.
Re: Adding custom weapons?

Posted:
31 May 2013, 22:07
by Sniper-Goth
If you want to add static weapons, as static map models, just do this:
/mmodel weapons/pistol
/mmodel weapons/flamer
/mmodel weapons/plasma
/mmodel weapons/rifle
/mmodel weapons/grenade
/mmodel weapons/mine
/mmodel weapons/rocket
/mmodel weapons/shotgun
/mmodel weapons/smg
/mmodel weapons/sword
Then they will appear after /newent mapmodel 40
Re: Adding custom weapons?

Posted:
04 Jun 2013, 16:49
by bentito
Excellent. Thanks for the mmodel tips! They're almost perfect when added this way. One thing is they seem to have no Z height, like maybe mapmodels and weapons assume a different starting point off the ground? Is there a way to adjust if I make a copy of the weapon for use as a model, maybe a setting in the md5.cfg?