Home » MODDING HQ 1.13 » v1.13 Feature Requests » Fire Mode Lock/Unlock
| Fire Mode Lock/Unlock[message #309485]
|
Sat, 25 August 2012 01:26
|
|
| Wil473 |
  |
Messages:2808
Registered:September 2004 Location: Canada |
|
|
Yes yet again, I am asking for code support to control availability of fire modes in v1.13. For a while now we've had the full-auto only lock, and I thought it would be useful to have this expanded to a pair of bitmask tags in items.xml - one to make a fire mode unavailable, the other to negate the first tag and allow a fire mode (only as long as it is also defined in weapons.xml)
FMLock Tag:
no tag (0) = all fire modes defined in weapons.xml allowed
1st Bit (1) = removes all bullet firing modes, including under slung guns, leaving only grenade launching available (contingent on their being a grenade and round attached). This feature would be used to support the Rifle Launched Grenade system in my mod (and possibly Bun's WWII mod). 1st bit cannot be negated.
2nd Bit (2) = lock out single shot
3rd Bit (4) = lock out burst
4th Bit ( = lock out auto
5th Bit (16) = lock out grenade launcher (for completeness)
6th Bit (32) = lock out underslung gun (perhaps an attachment that covers the barrel of the underslung gun)
FMUnlock Tag:
1st Bit (1) = does nothing (1 in the lock tag's purpose removes all fire modes except grenade launching)
2-6th Bits = negates the bit set by the FMLock tag
FMUnlock combine, ie. three attachments on the gun with FMUnlock = 2, 2, 4 the effective FMUnlock would be 6 (2nd and 3rd bits of FMLock negated)
Existing Burst and Autofire bonus tags left as is.
ie. AR-15 Upper Receiver
- all AR-15 weapons would have the FMLock = 14 meaning all bullet fire modes would be unavailable. When bough all AR-15 are uppers only, unless they come with a lower as a default attachment.
- AR-15 lower receivers would have FMUnlock = 2 meaning when it is attached to an AR-15 upper it would allow single shot
- via the power of NAS the AR-15 lower would allow for attachment of trigger groups, attachments that either have FMUnlock = 4, 8, or 12 (semi/burst, semi/auto, and semi/burst/auto respectively)
- all AR-15 weapons in weapons.XML that will have the possibility of burst and/or auto will have the values filled in, even though they would not be usable unless the appropriate attachment is attached.
Yes, I know the above AR-15 system will lead to some oddities for AI troopers. Either any AR-15 available to the AI will have a lower receiver as a default attachment, or simply the AI will have a free FMUnlock = 6 (allow semi and burst). Otherwise, we need some kind of mandatory attachment list (a new feature unto itself) to fill in things for the AI.
Yes, this is a purely selfish request, as the entire purpose is to eliminate most of the redundant items.XML/weapons.XML entries needed to support AFS/UC-1.13/DL-1.13 upper receiver and rifle launched grenade features.
[Updated on: Sat, 25 August 2012 01:39] by Moderator Report message to a moderator
|
|
|
|
|
|
|
| Re: Fire Mode Lock/Unlock[message #309491]
|
Sat, 25 August 2012 03:00 
|
|
| Wil473 |
  |
Messages:2808
Registered:September 2004 Location: Canada |
|
|
Nope, still two new tags, both 16 bits. Basically, I'm suggesting a bit mask that governs what firing modes are available in the player interface, and a second bit mask that would negate bits of the first tag.
FlugenteQuestion: How exactly does the rifle grenade feature work if its no firing mode or (temporary?) grenade launcher? Do you transform the gun itself into a grenade launcher?
Yes, right now I am using an item transform (not HAM but the earlier USE merger) to transform guns into a copy of the gun that has an invalid firing cursor that stops anything other than grenade launcher from working. This is a major reason why right now I am looking at over 1000 gun items in the v4.xx mod, so many copies to support various "features" specific to my projects.
EDIT: alternatively, someone could sweep in with a proper rifle launched grenade implementation. One that: requires a bullet to launch the grenade, so it would not be a grenade necessarily, but instead is 1) an attachment that disappears when the gun fires, 2) before it disappears, a grenade defined by the attachment is launched (instead of the bullet flying). I for one would hail this hero coder (Buns would too I imagine, see: WWII mod).
[Updated on: Sat, 25 August 2012 03:12] by Moderator Report message to a moderator
|
|
|
|
|
| Re: Fire Mode Lock/Unlock[message #309544]
|
Sun, 26 August 2012 20:57 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
Well, in that case, you can call me 'hero' from now on 
I implemented a 'rifle grenade device' in GameDir revision 1533 and Build revision 5537.
Having the grenade itself being a grenade proved to be to difficult (as a result, the 'grenade' would not be explosive, I would have to add a new tag to Items.xml that refers from one item to another etc.)
So, you can now define an item to be of the Attachment Class AC_RIFLEGRENADE. Properties:
- works like a GL.
- is attached to the barrel slot. In the GameDir, it just looks like a flash hider (but Depri meant that it shouldn't be a 'real' flash hider). You can of course just add the proper Class for that.
- When a grenade is attached to a gun with a AC_RIFLEGRENADE- attachment, all fire modes except the GL single shot mode are locked.
- Cannot be used as a standalone launcher.
- On firing, one of the guns bullets is used up, this includes heat and dirt generation.
- If the magazine is empty, the launcher cannot be used (the cursor becomes '?').
- See item 1581 for specifics. It is currently used on the WW2-rifles and can fire 40mm grenades.
For reference reasons, here are the current attachment classes:
#define AC_BIPOD 0x00000001 //1
#define AC_SUPPRESSOR 0x00000002 //2
#define AC_LASER 0x00000004 //4
#define AC_SIGHT 0x00000008 //8
#define AC_SCOPE 0x00000010 //16
#define AC_STOCK 0x00000020 //32
#define AC_MAGWELL 0x00000040 //64
#define AC_INTERNAL 0x00000080 //128
#define AC_EXTERNAL 0x00000100 //256
#define AC_UNDERBARREL 0x00000200 //512
#define AC_GRENADE 0x00000400 //1024
#define AC_ROCKET 0x00000800 //2048
#define AC_FOREGRIP 0x00001000 //4096
#define AC_HELMET 0x00002000 //8192
#define AC_VEST 0x00004000 //16384
#define AC_PANTS 0x00008000 //32768
#define AC_DETONATOR 0x00010000 //65536
#define AC_BATTERY 0x00020000 //131072
#define AC_EXTENDER 0x00040000 //262144
#define AC_SLING 0x00080000 //524288 // rifle sling
#define AC_REMOTEDET 0x00100000 //1048576 // remote detonator for bombs
#define AC_DEFUSE 0x00200000 //2097152 // defuse item for bombs
#define AC_IRONSIGHT 0x00400000 //4194304 // for attachable Iron Sights
#define AC_FEEDER 0x00800000 //8388608 // allow external feeding
#define AC_MODPOUCH 0x01000000 //16777216 // for new modular pouches
#define AC_RIFLEGRENADE 0x02000000 //33554432 // GL, needs a bullet and blocks other firing modes
#define AC_MISC15 0x04000000 //67108864
#define AC_MISC16 0x08000000 //134217728
#define AC_MISC17 0x10000000 //268435456
#define AC_MISC18 0x20000000 //536870912
#define AC_MISC19 0x40000000 //1073741824
#define AC_MISC20 0x80000000 //2147483648
:sign: One word of advice: Do not use this together with regular grenade launchers on a gun. The current system can't handle that correctly, weird things will happen (like the wrong grenade is fired, or GL firing mode doesn't appear although it should...). Getting multiple underbarrel GLs or guns to work would take a significant amount of coding time, and I don't really see a reason for something odd like that :sadyellow:
Happy hunting!
[Updated on: Sun, 26 August 2012 21:04] by Moderator Report message to a moderator
|
|
|
|
|
|
|
| Re: Fire Mode Lock/Unlock[message #309548]
|
Sun, 26 August 2012 23:28 
|
|
| Wil473 |
  |
Messages:2808
Registered:September 2004 Location: Canada |
|
|
All hail the liberator of 115 item indexes (v4.xx AFS/UC-1.13/DL-1.13). I just reworked the planning spreadsheet, and there were 115 redundant items just for the now obsolete pseudo rifle-grenade system.
Now to update the UC-1.13 v3.7x flag lookup XML to support this.
EDIT: I just realized, you've also figure out a way to block firing modes from being available, en mass. Can this be spun off into a means of selectively removing firing modes? Say by a bitmask. On working on something else, I figured out the maths needed to produce trigger groups with just a means of selectively removing firing modes and Madd Mugsy's replaceable attachment feature.
Yes, I did warn everyone that this is the thread where I'm going to be a bit selfish...
EDIT2: oh, and yes before I forget, you do have explicitly my thanks for this feature. Good timing for this too, I saw that Buns seems to be considering updating the WWII mod soon.
EDIT3: now I have room to give the Micro-AR's upper's, and the C7/C8's too...
[Updated on: Mon, 27 August 2012 00:11] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sun Jun 14 16:54:30 GMT+3 2026
Total time taken to generate the page: 0.00725 seconds
|