[1.1] SimpleSidearms (1.4.0)

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

Previous topic - Next topic

Canute

Ok, seem's SimpleSideArms got problems with some custom faction/pawn at your modlist.
But it could be from some weapon mod too.

You can investigate self, what other mod made the problems.
But at last you could post a full hugslib logfile or modlist + normal logfile, so Pete the author can maybe take a look.

Pelador

(Copied comments as per steam page)

@PeteTimesSix

Great mod, should be part of vanilla imho.

Can I request a tweak to the process for weapon selection during combat? Simple sidearms can be used to help other mods allow players to more readily manually manipulate tools. I use it for the Fire Warden/Extinguisher mod I developed (https://steamcommunity.com/sharedfiles/filedetails/?id=1589401542) and recommend the use of Simple Sidearms with it.

The Fire Extinguisher, however when applied as a Sidearm, can then be recognised for use in combat. So pawns will swap to the FE when the range seems best to do so. Not ideal.

My request is can you ensure that Simple sidearms can continue to allow Fire Extinguishers to be used with it. But during combat can you check if the damage type is a type "Extinguish" as a weapon not to select for combat. However, in the mod I use I have a custom damage type def of "FExtExtinguish" so was hoping you could accommodate this in a similar way? Maybe as a cached [Def]?

---

(update)

@PeteTimesSix

Included in the following link are two files as a suggested fix for the Fire Extinguisher mod:

https://1drv.ms/f/s!Au3GsmKyQkDYg5QKRLSeUmIGUdBsmQ

I haven't tested it yet as thought best to seek your approval but also that you may have a better method in your coding of applying a fix, this very relevant due to your familiarity with the operations.

It includes potential changes to Simple Sidearms "GettersFilter.cs" and also includes a compatibility patch file for the FE mod if definitions are needed for the assembly by the installer but the Fire Extinguisher mod is not loaded/used by players.

Mehni

Your proposal is very specific to your mod. I recommend something more generic, like a Mod-Extension or something. That opens the door for a more global compatibility with other mods that can't/shouldn't be used as weapons. Mods such as [XND] Survival Tools.

Example here: https://github.com/jecrell/RimQuest/commit/54413b821233316c4057db87031aa6e528ab2db6
and other mods could use it like so: https://github.com/Mehni/MoreFactionInteraction/commit/a5b3d90d9809f36672b5801726496a0322e75a56#diff-9e8670c77a1c10b518ac6ba9432ceabaR76

Alternatively, the DamageDef has an "externalViolence" boolean. Maybe any weapon whose tools do damage that isn't externalViolence shouldn't be considered? Or the "harmsHealth" bool.

The mod extension gives *all* modders fine-grained control, the harmsHealth/externalViolence flags can be considered sanity checks.

Pelador

Actually, yes totally agree, the DamageDef harmsHealth flag of the tool/weapon would be a much easier/simpler way of doing it and much more encompassing.

This would also remove the need for DamageDef's needing to be present as a compatibility concern, where covered by these definitions.

(Though it would be sensible to remember that some ranged tools can still be used as a melee item, though usually not designed as a preference to other melee options. Though I think this is intrinsic to the verb use and how Simple sidearms applies weapon mode (Ranged or Melee)).

*ThumbsUp* Mehni.

Pelador

#334
An exception to the above might be the use of EMP against mechanoids. Though the external violence flag against mechanoids would still be a valid check here.

This still being a desirable damage choice for use with these encounters.

Also, there is the consideration of the likes of smoke weapons being applied, which are not harmful or have an external flag. But in these cases they are most likely used as a tactical choice, so the simple sidearms lock weapon mode could be applied for these cases.

There may also be some mods that have more unique def cases, e.g. tranquilisers or hediff appliers that dont do harm (or significantly less than other choices SS might evaluate against), but might still want to be applied. Though these again might be more the edge cases that would need specific recognition in some cases where not applied as a tactical weapon more micro-controlled by the player?

Mehni

Edge cases like smoke could make use of a mod extension.

- The value in the mod extension (if present) should take priority over other flags (since they're hand-picked by mod authors).
- After that the harmsHealth/externalViolence, because there's no point in equipping a side-arm if it does no/less damage than the pair of fists a pawn has strapped to its back.
- After that, regular rules apply.

I recommend you submit a pull request ;)

neltnerb

I just reopened a save game from a few months back, and thing seemed okay at first.

But after a battle when some weapons were dropped, I could not direct a pawn to "equip" the weapon, even after dropping all other weapons. It just allowed me to pick up the item (that is from another mod that lets my pawns carry things).

Seems the weapons are now somehow no longer marked as weapons? Anyone else see this?

Canute

Yes, SimpleSideArms got trouble with shields from Lord of the Rims at example.
Can't remove the shield with the mod's button and need to drop them over the inventory window.
And when a pawn want to requip them, it can happen that this pawn get and equip all shield he can find.

Basicly i works, but you need to watch it a bit closer.

PeteTimesSix

I havent ever messed with mod extensions (and still dont play Rimworld), but if you wanna submit a pull request I'm now paying enough attention to notice it, test it, and accept it in less than the six months it took me last time.

Quote from: neltnerb on March 08, 2019, 07:38:57 PMIt just allowed me to pick up the item (that is from another mod that lets my pawns carry things).
Are you running combat extended by any chance? Simple Sidearms disables most inventory handling in favor of CE's when its installed.
Mods: SimpleSidearms | QOLTweaksPack
Check them out, feedback and suggestions are welcome.

Heymom

Started getting errors, and i think its this mod.. not sure tho. And could be other issues ofc :)

error:
Exception in Verse.AI.ThinkNode_Priority TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
  at SimpleSidearms.utilities.WeaponAssingment.SetPrimary (Verse.Pawn pawn, Verse.Thing toSwapTo, Boolean intentionalEquip, Boolean fromInventory, Boolean dropCurrent, Boolean intentionalDrop) [0x00000] in <filename unknown>:0
  at SimpleSidearms.utilities.WeaponAssingment.reequipPrimaryIfNeededAndAvailable (Verse.Pawn pawn, SimpleSidearms.rimworld.GoldfishModule pawnMemory) [0x00000] in <filename unknown>:0
  at SimpleSidearms.rimworld.JobGiver_RetrieveWeapon.TryGiveJobStatic (Verse.Pawn pawn, Boolean inCombat) [0x00000] in <filename unknown>:0
  at SimpleSidearms.rimworld.JobGiver_RetrieveWeapon.TryGiveJob (Verse.Pawn pawn) [0x00000] in <filename unknown>:0
  at Verse.AI.ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0
  at Verse.AI.ThinkNode_SubtreesByTag.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0
  at Verse.AI.ThinkNode_Priority.TryIssueJobPackage (Verse.Pawn pawn, JobIssueParams jobParams) [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob_Patch1(Object, ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:EndCurrentJob_Patch0(Object, JobCondition, Boolean)
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick_Patch1(Object)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()


i wouldnt mind if it wasnt for the fact that the game freezes/pauses each time :D

anyone know how to fix it, or what the culprit might be? cheers.

Xaviien

Language warning!
https://www.twitch.tv/videos/425895077?t=00h15m19s

Didn't think to grab the log, but I couldn't find a solution other than forbidding the beer.
Not expecting much, just thought I'd share. It's likely due to another mod. I seem to have a fair bit of weird behaviour due to soft incompatibilities, such as pawns with rifles preferring to run in and attack zombies with their fists...

account13123

Toggles seems to terribly break SS's settings menu, causing an infinite error loop(pasted below). But there didn't really seem to be evidence of it ingame- basically the game seems *playable* with both mods installed but in the background stuff is going very wrong and who knows what might happen.

The errors:
Exception filling window for HugsLib.Settings.Dialog_ModSettings: System.NullReferenceException: Object reference not set to an instance of an object
at Toggles.Patches.Widgets_Patch.Prefix (string&) <0x00056>
at (wrapper dynamic-method) Verse.Widgets.Label_Patch1 (UnityEngine.Rect,string) <0x00023>
at HugsLib.Settings.Dialog_ModSettings.DrawHandleEntry (HugsLib.Settings.SettingHandle,UnityEngine.Rect,single&,single) <0x00a36>
at HugsLib.Settings.Dialog_ModSettings.DoWindowContents (UnityEngine.Rect) <0x00b95>
at Verse.Window/<WindowOnGUI>c__AnonStorey0.<>m__0 (int) <0x00882>

Verse.Log:Error(String, Boolean)
Verse.<WindowOnGUI>c__AnonStorey0:<>m__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Mouse position stack is not empty. There were more calls to BeginScrollView than EndScrollView. Fixing.
Verse.Log:Error(String, Boolean)
Verse.Widgets:EnsureMousePositionStackEmpty()
Verse.Root:Update_Patch1(Object)
Verse.Root_Entry:Update()

repeated in that order forever.

daemonjax

#342
I really love this mod, but the restriction settings have problems:

Tested with this as the only mod loaded...

You can bypass any kind of restriction that you set for what is allowed as a sidearm or even the number of slots allowed by switching to unarmed combat and then equipping a new weapon off the ground.

So, the only restriction setting(s) that works as intended is:
Limits: [No Limit]
Total Sidearm Limit Mode: [No Limit]

It's a shame, because I wanted to limit sidearms to be specific weapons and the number of slots to 1.

The mod would be way cooler if the restriction settings worked.

One way to fix it would be:  Everytime a pawn picks up a weapon, have the mod loop through the sidearms to verify the player is sticking to the rules defined in the mod settings.  If not, then it drops that sidearm on the ground and all other sidearms in the loop it hasn't gotten to yet.  So, the player could still pick up the weapon he just told the pawn to pick up, but he might end dropping his sidearms if not sticking to the rules.

btw: the problem isn't specifically with the "switch to unarmed combat" button, but it's just the most straightforward way to break the mod restrictions.   The other way involves filling up your sidearm slots normally, then switch to them before picking up something that couldn't be a sidearm -- granted, you couldn't bypass the slot number restriction this way.

Simstu

Howdy! Found a problem. Even tried to replicate it a few times... When my pawn gets downed they lose all pistols (equipped as sidearm) but not melee weapons... Anything that might help?

Canute

Try to swith the load order, Don't drop weapon <> Simple side arms.
Try it without the other mod.