[1.1] SimpleSidearms (1.4.0)

Started by PeteTimesSix, May 16, 2017, 04:21:35 PM

Previous topic - Next topic

Sarge

How do I get pawns with no melee weapons (because they have no melee skill) not switch to melee or UA when they get hit at melee range?

It feels like I've tried every setting and I can't find it. I need my guy to keep trying to shoot, it's all he has else he's just dead in any case.

SpaceDorf

I think you can only forbid the auto-switch to melee in general, not set it up for individuals.
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Sarge

Cut from Combat Extended thread for relevance:

Quote from: Maeyanie on January 09, 2018, 12:10:11 AM
I'm also noticing Simple Sidearms weapon switching doesn't seem to be working properly with CE B18. When someone with a ranged weapon gets into melee, they switch to fists, instead of a knife/shiv/whatever. Not sure if this is SS's fault, CE's fault, or my fault, but figured it was worth mentioning.

Yeah I get this too though I can't quite figure out why. I don't recall there being an update for this mod between the times that it worked and now doesn't.

DepOpt

How on earth did I miss the fact that this mod exists. I micromanage doing pretty much this with caravans and raids, and this makes it so much easier.
Ignore this notice

Nozza

Dumb question, but if my colonist only has a gun, how do i stop them from switching to unarmed when enemies get close? My colonists keep dying because they try to punch enemies rather than shoot them.

docssy

#200
Not to echo the number of comments about switching to unarmed vs sidearm melee weapon, but it would be nice to have clarification on if it is a bug, or if there is a setting we can manipulate?


Edit:  ACTUALLY, looking at your source (StatCalculator.cs) I see that speedBias is entirely commented out of the calculation for melee weapons.

Quoteinternal static float MeleeDPS(Pawn pawn, ThingWithComps weapon, float speedBias) {
            if (pawn == null)
                return 0;
            float dps = GetMeleeDamage(pawn, weapon) * GetMeleeHitChance(pawn, weapon) / GetMeleeCooldown(pawn, weapon);
            return dps;
            /*if (weapon == null)
                return 0;

            Verb atkVerb = (weapon.GetComp<CompEquippable>()).PrimaryVerb;
            VerbProperties atkProps = atkVerb.verbProps;

            ThingDef wepDef = weapon.def;

            float damage = atkProps.AdjustedMeleeDamageAmount(atkVerb, atkVerb.CasterPawn, weapon);
            float warmup = atkProps.warmupTime;
            float cooldown = atkProps.AdjustedCooldownTicks(weapon);
            float dps = damage / ((warmup * speedBias + cooldown));
            return dps;*/

        }

The GetterFilters.cs file (one function up) sets unarmedisbest as true. So what seems to be in line with the previous comments, pawns will use unarmed unless they have an ungodly powerful melee sidearm that puts out more dps then unarmed

doge316

Has anyone fixed the sidearm not being drawn?

Sarge


Mehni

Hi. I'm running into an error with Simple Sidearms when combined with Pick Up And Haul. When pawns put a rock chunk in their inventory, players can't manually order pawns to drop the picked up chunk as a result of a null ref exception caused by a prefix in Simple Sidearms.

Exception filling tab RimWorld.ITab_Pawn_Gear: System.NullReferenceException: Object reference not set to an instance of an object
at SimpleSidearms.intercepts.ITab_Pawn_Gear_InterfaceDrop_Prefix.InterfaceDrop (RimWorld.ITab_Pawn_Gear,Verse.Thing) <0x00041>
at (wrapper dynamic-method) RimWorld.ITab_Pawn_Gear.InterfaceDrop_Patch1 (object,Verse.Thing) <0x00022>
at RimWorld.ITab_Pawn_Gear.DrawThingRow (single&,single,Verse.Thing,bool) <0x0039e>
at RimWorld.ITab_Pawn_Gear.FillTab () <0x00b3e>
at Verse.InspectTabBase/<DoTabGUI>c__AnonStorey0.<>m__0 () <0x000e3>

Verse.Log:Error(String)
Verse.Log:ErrorOnce(String, Int32)
Verse.<DoTabGUI>c__AnonStorey0:<>m__0()
Verse.ImmediateWindow:DoWindowContents(Rect)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Tenshi~Akari

I came across a minor issue when playing with this & Miscellaneous MAI: The Mobile AIs don't switch over to their melee side arms like they should, but unfortunately there aren't any error logs that are being produced to help out with this one. Haplo mentioned when I had brought up the gizmo/UI issue with MAI & Run&Gun before that the Moble AI pawns were still supposed to be based off of the vanilla pawns to a certain extent, so it's a little unclear as to why it clashes somewhat with the two mods... :-\

(And it's kind of hard to choose between them all, because I find all 3 very essential to my Rim World experience...)

Ruisuki

youre a hero.

So is the biggest limiter to prevent OP shooter the weight or slots?

Harry_Dicks

#206
Quote from: Tenshi~Akari on January 31, 2018, 10:08:00 AM
I came across a minor issue when playing with this & Miscellaneous MAI: The Mobile AIs don't switch over to their melee side arms like they should, but unfortunately there aren't any error logs that are being produced to help out with this one. Haplo mentioned when I had brought up the gizmo/UI issue with MAI & Run&Gun before that the Moble AI pawns were still supposed to be based off of the vanilla pawns to a certain extent, so it's a little unclear as to why it clashes somewhat with the two mods... :-\

(And it's kind of hard to choose between them all, because I find all 3 very essential to my Rim World experience...)
Don't quote me on this, but I think this is somewhat how it works: any pawns added by any mods that are not based off of basePawn will not get certain benefits from certain mods. An example is MAI. So since she is not based on basePawn, she will not be able to work with certain mods like Pick Up and Haul, and/or she might have issues with Simple Sidearms and Run & Gun. I do believe I saw the author (of R&G) say they were going to fix the issue with Run & Gun and swapping weapons while firing was causing a crash if you tried it with MAI.

Anyway, unless these mods that change how these pawns (pawn doesn't always mean human necessarily) are handled in the defs, then I think we will need to expect some issues if we play a game with them. Maybe things like SS and PU&H could change how they apply their inventory changes to pawns, so that they could include other pawns added by mods. But then these authors will have to update their mods to work with new races added by other mods every single time. I think what should happen for it to happen properly, would be that these mods that are creating pawns will need to change how they create them, this way any other mods that require basePawn for them to work, will be future proofed against any other new mods that come along and add in new races.

I think the issue is, some mods need to add in new races that can't be based on basePawn for whatever reason. They have to have their own abstract, and the mods like SS and PU&H aren't configured for any pawns made with these custom abstracts.

Quote from: Ruisuki on February 14, 2018, 04:57:15 AM
So is the biggest limiter to prevent OP shooter the weight or slots?
This is completely customizable in the mod options. You can have the sidearm limits based on I think either mass or slots. These can be further split up into ranged/melee, and then further split up into tribal/not tribal. All of the options are completely customizable, so you can put some weapons in some categories, and different weapons in other categories, however you would like it. You can also change how pawns will drop weapons, and when they will auto-swap weapons, to ranged or melee, if even at all.

Ruisuki

Hmmm interesting. I'd be eager to hear the setup of the author to know what hes running because I want the most balanced option possible.

PeteTimesSix

Updated with melee fixes/additions provided by Alex TD. Many thanks!

Quote from: Ruisuki on February 14, 2018, 06:26:33 PM
Hmmm interesting. I'd be eager to hear the setup of the author to know what hes running because I want the most balanced option possible.

I havent actually played Rimworld in months, so... none. Back when I did though, I just used the basic preset.
Mods: SimpleSidearms | QOLTweaksPack
Check them out, feedback and suggestions are welcome.

Harry_Dicks

Nice! Thank you Pete! ;D

Curious, do you know if this will solve any issues that were popping up in the past with Pick Up and Haul?

Also, do you plan on doing an official update of your QOLTweaksPack?