Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: lempface on August 20, 2017, 04:13:14 PM

Title: [A17] An Unfortunate Misfeed v1.0.1 (11/24/2017) - Guns Now Misfire and Jam
Post by: lempface on August 20, 2017, 04:13:14 PM
Hello, this is my first mod. Let me know what you think.

Prerequisites:
HugsLib

Features:
v1.0.1

Bugfixes: Mechanoids could not shoot at all, excluded them from the jamming system. Grenades and Neolithic Weapons should not have a chance to jam, excluded them from the jamming system.

v1.0

Added a chance for a gun to misfire and explode. Size of explosion based on ammunition.
Added a chance for a jammed gun to be destroyed due to the misfire.
Added a Jinxed trait that makes jamming and explosions happen at a higher rate.
Added a Proficient Armsman trait that allows for 100% chance to unjam a weapon.
Added a jamming gun sound effect.

Bugfixes:
Restored ability for turrets to fire. Turrets now skip jam checking entirely.

v0.2

Guns may now be damaged when they jam. There are two settings in the HugsLib in-game mod settings to control this.
Damage on Jam Percentage: (default) 20%
Damage on Jam Amount: (default) 1 HP

As guns become more and more damaged, the chance to jam increases.

v0.1

Guns jam based on the quality of the gun. These percentages can be altered using the HugsLib in-game mod settings.

If a pawn tries to fire a jammed gun, they will attempt to clear the jam first. The chance of success is based on the pawns shooting skill. There is a minimum 20% chance to clear a jam, and the chance goes up by 5% for each experience level in shooting.

Download:
https://github.com/lempface/An-Unfortunate-Misfeed (https://github.com/lempface/An-Unfortunate-Misfeed)

Road map:
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: dezuman on August 20, 2017, 05:30:39 PM
If you make it work with Combat Extended I'll be sending tons of virtual cookies your way! :)
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: lempface on August 20, 2017, 05:38:41 PM
Quote from: dezuman on August 20, 2017, 05:30:39 PM
If you make it work with Combat Extended I'll be sending tons of virtual cookies your way! :)
I've not tried that mod, but I heard it isn't the most compatible mod out there. I will try to take a look at some point.
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: XeoNovaDan on August 20, 2017, 05:42:35 PM
Welcome to the community! I'll be sure to check this one out. Makes zero sense that some crappily-made, horrible condition gun can fire perfectly 100% of the time. Speaking of, is a weapon's jamming likelihood also based on condition, or solely quality?
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: lempface on August 20, 2017, 05:51:48 PM
Quote from: XeoNovaDan on August 20, 2017, 05:42:35 PM
Welcome to the community! I'll be sure to check this one out. Makes zero sense that some crappily-made, horrible condition gun can fire perfectly 100% of the time. Speaking of, is a weapon's jamming likelihood also based on condition, or solely quality?
Quality only at the moment, it does seem to be a good idea to include condition as well though, I'll add that to the road map.
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: Chicken Plucker on August 20, 2017, 06:16:43 PM
Hey, thanks for this mod. I will test it if I ever get the time to play the game again to see if it works with other gun mods just fine

Your entire mod reminds me of that Nicholas Cage film, Lord of War when some guy with an AK tried to shoot him with his own AK47 and it kept jamming. Please consider having a Nicholas Cage update, thanks
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: kaptain_kavern on August 20, 2017, 07:39:40 PM
A very good idea.

Thank you for your time/the mod

And welcome in here :-D
Title: Re: [A17] An Unfortunate Misfeed - Guns Now Misfire and Jam
Post by: lempface on August 21, 2017, 12:06:17 AM
Quote from: XeoNovaDan on August 20, 2017, 05:42:35 PM
Welcome to the community! I'll be sure to check this one out. Makes zero sense that some crappily-made, horrible condition gun can fire perfectly 100% of the time. Speaking of, is a weapon's jamming likelihood also based on condition, or solely quality?
XeoNovaDan, I liked the idea so much I stayed up late and released v0.2.

Now guns have a higher percentage chance to jam the lower HP they have. Also, there is a chance that a jam can damage the gun. Both the percentage and amount of damage are configurable in mod settings. Feedback always welcome! Let me know if you run into any bugs or other incompatibilities.
Title: Re: [A17] An Unfortunate Misfeed v0.2 - Guns Now Misfire and Jam
Post by: XeoNovaDan on August 21, 2017, 04:11:02 AM
Awesome stuff! Thanks!
Title: Re: [A17] An Unfortunate Misfeed v0.2 - Guns Now Misfire and Jam
Post by: Warforyou on September 01, 2017, 12:35:34 PM
Somehow my military grade turrets are out of condition and do nothing with this mod on.
Title: Re: [A17] An Unfortunate Misfeed v0.2 - Guns Now Misfire and Jam
Post by: lempface on September 05, 2017, 09:27:32 PM
Quote from: Warforyou on September 01, 2017, 12:35:34 PM
Somehow my military grade turrets are out of condition and do nothing with this mod on.

Thanks for pointing out the bug. I'll get it fixed ASAP!
Title: Re: [A17] An Unfortunate Misfeed v0.2 - Guns Now Misfire and Jam
Post by: lempface on September 05, 2017, 10:00:45 PM
Quote from: Warforyou on September 01, 2017, 12:35:34 PM
Somehow my military grade turrets are out of condition and do nothing with this mod on.

This should be sorted out in version 1.0, let me know if you run into any additional issues.
Title: Re: [A17] An Unfortunate Misfeed v1.0 - Guns Now Misfire and Jam
Post by: faltonico on September 05, 2017, 11:39:31 PM
I definitely see Tynan including this to the base game in the near future.
The more drama the better /s.
Title: Re: [A17] An Unfortunate Misfeed v1.0 - Guns Now Misfire and Jam
Post by: lempface on September 06, 2017, 08:42:22 AM
Quote from: faltonico on September 05, 2017, 11:39:31 PM
I definitely see Tynan including this to the base game in the near future.
The more drama the better /s.
I can't tell if you hate my mod idea or what. But! I've provided settings for nearly every calculation so YOU can tailor the experience to your liking. You can even disable some features by making the percentage chance 0.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: faltonico on September 06, 2017, 10:19:17 AM
I don't hate the mod, i simply wont use it, what i hate is the idea of Tynan using it in the base game, and knowing him, anything that adds drama is a good addition.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: dburgdorf on September 06, 2017, 10:36:00 AM
This seems brilliant.  Some day, when I finally find time to actually *play* RimWorld instead of just working on mods, I'll definitely be adding this to my mod list.  :)
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: XeoNovaDan on September 06, 2017, 10:43:15 AM
I know the feeling burg. Bogged down by mod authoring... and spreadsheet making.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: lempface on September 06, 2017, 05:13:38 PM
Quote from: dburgdorf on September 06, 2017, 10:36:00 AM
This seems brilliant.  Some day, when I finally find time to actually *play* RimWorld instead of just working on mods, I'll definitely be adding this to my mod list.  :)
What a nice compliment. Thanks!

Quote from: XeoNovaDan on September 06, 2017, 10:43:15 AM
I know the feeling burg. Bogged down by mod authoring... and spreadsheet making.

Anymore good ideas? I've finished my road map.  ;D
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: GlitchKs on September 07, 2017, 12:43:27 PM
Looks cool! I just fond this and obviously haven't' played with it yet...

Does this make combat easier as raiders tend to have terrible weapons where as, I tend to have 100% Good (or better)?
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: lempface on September 09, 2017, 07:14:15 PM
Quote from: GlitchKs on September 07, 2017, 12:43:27 PM
Looks cool! I just fond this and obviously haven't' played with it yet...

Does this make combat easier as raiders tend to have terrible weapons where as, I tend to have 100% Good (or better)?
I am terrible at the game so I'm not entirely sure. The base balance is still largely not play-tested but will be tweaked as I get more play time with the mod and any community suggestions.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: werty112 on September 17, 2017, 12:49:20 PM
That moment when your newly produced legendary charge rifle explodes in first burst. (Salty intesefines)
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: Spleenling on September 17, 2017, 09:13:01 PM
Does this work with modded-in Guns?
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: maculator on September 23, 2017, 06:25:12 AM
Quote from: faltonico on September 06, 2017, 10:19:17 AM
I don't hate the mod, i simply wont use it, what i hate is the idea of Tynan using it in the base game, and knowing him, anything that adds drama is a good addition.
Drama is what defines the game! The moment your colony gets erased by a poison ship dropping right infront of your kitchen you get verry mad but after playing a new colony for a while you remember that moment and all the little stories of your past colony and you think "actually this was fun".
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: SpaceDorf on September 23, 2017, 08:56:18 AM
Hi there, I have not played the mod yet, but I like the Idea behind it.

QuoteAdded a chance for a gun to misfire and explode. Size of explosion based on ammunition.
Out of curiosity .. could you clarify this feature for me ?
Between CE and Vanilla I wonder to what you are referring with ammunition.

Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: geojak on October 02, 2017, 04:49:55 PM
was playing around a bit with your mod (i like it xD ) i got a red error poping into my console when raided by some guys with molotov cooktails.

I must notify you, your mod breaks frag grneades, molotov cooktails and emp grenades both on enemy raiders and on colonist.

if anyone tries to throw then, then instead it will pop the red error. error wont stop until you drop the grenades on the ground.

ah and by the way. bows and pilas being jammes makes not much sense to me. is it possible to exclude these weapons from jamming? maybe the same way of excluding stuff could be used to fix the grenades bug.

anyway. i hope you see this

edit: i added a little bit of dirty code into your source to exclude grenades and bows from jamming. the way i coded it it doesnt support non vanilla weapons and is quite cpu unoptimised.

this code comes after your turret fix

var X = __instance.verbProps.projectileDef.defName.ToString();
                     
               
               
if (X == "Proj_GrenadeFrag" || X == "Proj_GrenadeMolotov" || X == "Proj_GrenadeEMP" || X == "Arrow_Short" || X == "Pilum_Thrown" || X == "Arrow_Great")
                {
//Weapon is not a suppost to be jammable.;
                    return true;
                }

if anyone can do it better, please contact me :D
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: r4ncr4ft on October 02, 2017, 08:24:39 PM
Great mod! :D

Will you release it on the Steam Workshop?
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: Sylph on October 03, 2017, 02:40:35 PM
Quote from: geojak on October 02, 2017, 04:49:55 PM
was playing around a bit with your mod (i like it xD ) i got a red error poping into my console when raided by some guys with molotov cooktails.

I must notify you, your mod breaks frag grneades, molotov cooktails and emp grenades both on enemy raiders and on colonist.

if anyone tries to throw then, then instead it will pop the red error. error wont stop until you drop the grenades on the ground.

ah and by the way. bows and pilas being jammes makes not much sense to me. is it possible to exclude these weapons from jamming? maybe the same way of excluding stuff could be used to fix the grenades bug.

anyway. i hope you see this

edit: i added a little bit of dirty code into your source to exclude grenades and bows from jamming. the way i coded it it doesnt support non vanilla weapons and is quite cpu unoptimised.

this code comes after your turret fix

var X = __instance.verbProps.projectileDef.defName.ToString();
                     
               
               
if (X == "Proj_GrenadeFrag" || X == "Proj_GrenadeMolotov" || X == "Proj_GrenadeEMP" || X == "Arrow_Short" || X == "Pilum_Thrown" || X == "Arrow_Great")
                {
//Weapon is not a suppost to be jammable.;
                    return true;
                }

if anyone can do it better, please contact me :D

I suggest checking the projectile speed and if it is below e.g. 55 (the speed of a crossbow bolt in Combat Realism), never jam. This encompasses most (all?) weapons that shouldn't jam (manual bows, thrown spears). It probably also includes grenades but to be safe I recommend a check on whether the projectile causes an explosion.

Speaking of Combat Realism, supporting it is easy, one just needs to allow for the fact that Verb_LaunchProjectile has been replaced by Verb_LaunchProjectileCE.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: Spleenling on October 08, 2017, 01:31:28 AM
Has anyone tested this with Rimsenal? I have been watching this Mod with interest but do not wish to install this if it is likely to break existing mods. If not how much XML work would be needed to adapt it?
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: lempface on October 12, 2017, 09:08:47 PM
Quote from: geojak on October 02, 2017, 04:49:55 PM
was playing around a bit with your mod (i like it xD ) i got a red error poping into my console when raided by some guys with molotov cooktails.

I must notify you, your mod breaks frag grneades, molotov cooktails and emp grenades both on enemy raiders and on colonist.

if anyone tries to throw then, then instead it will pop the red error. error wont stop until you drop the grenades on the ground.

ah and by the way. bows and pilas being jammes makes not much sense to me. is it possible to exclude these weapons from jamming? maybe the same way of excluding stuff could be used to fix the grenades bug.

anyway. i hope you see this

edit: i added a little bit of dirty code into your source to exclude grenades and bows from jamming. the way i coded it it doesnt support non vanilla weapons and is quite cpu unoptimised.

this code comes after your turret fix

var X = __instance.verbProps.projectileDef.defName.ToString();
                     
               
               
if (X == "Proj_GrenadeFrag" || X == "Proj_GrenadeMolotov" || X == "Proj_GrenadeEMP" || X == "Arrow_Short" || X == "Pilum_Thrown" || X == "Arrow_Great")
                {
//Weapon is not a suppost to be jammable.;
                    return true;
                }

if anyone can do it better, please contact me :D

Not surprised I missed this :). I also broke turrets in the initial go round. I'll see about officially fixing it this weekend and looking into CE compatibility. My colonies never last long enough for me to get advanced gear.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: lempface on October 12, 2017, 09:09:40 PM
Quote from: Spleenling on October 08, 2017, 01:31:28 AM
Has anyone tested this with Rimsenal? I have been watching this Mod with interest but do not wish to install this if it is likely to break existing mods. If not how much XML work would be needed to adapt it?
I plan to fix some bugs this weekend and will try and review Rimsenal.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (09/05/2017) - Guns Now Misfire and Jam
Post by: BetaSpectre on October 24, 2017, 12:13:14 AM
Unsure of the issue but this mod seems to cause mechanoids to be unable to fire their guns.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (11/24/2017) - Guns Now Misfire and Jam
Post by: lempface on November 24, 2017, 09:36:23 AM
Whew, sorry for taking so long but I believe I squashed the reported bugs.

Next up is getting it to work with B18.
Title: Re: [A17] An Unfortunate Misfeed v1.0 (11/24/2017) - Guns Now Misfire and Jam
Post by: Umbreon117 on November 24, 2017, 09:57:47 AM
This would be a great mod in Combat Extended. o.o I look forward to when it comes into B18.