RimWorld

RimWorld

Drafted Auto-Combat
128 kommentarer
Mechanomical 17. okt. kl. 21:09 
A bit of a weird request but could you add a run away style for those with run and gun, I like to have one good shooting pawn run around and act like a coward to catch attention while everyone else does their thing
Albino Monkey 16. okt. kl. 8:40 
@RedMattis I would definitely do a add-on mod instead of adding it into this one. You could call it "Auto-Combat: Formations" which just add more options to this mod, or if you show me the ropes I could do it myself as I've always been interested in rimworld modding.
Squishyjellyfish 12. okt. kl. 23:00 
does this work with run and gun?
Alexander Zagirov 12. okt. kl. 17:00 
AI auto-combat ignore turrets for some reason.
RedMattis  [ophavsmand] 12. okt. kl. 2:51 
Update
Now works with the old VEF Abilities such as those from Dragon's Descent, probably psycasts, etc. as well.

It hooks into their code which includes things like random-chance-to-not-use, etc., so if a pawn doesn't use an ability it might be due to that kind of setting.

I've not checked how friendly-fire prone they are, but probably exactly the same how the VEF-style autocast usually is.

@Albino Monkey
It would be interesting, but I'm a bit worried that might over-complicate things. While the mod lets you turn off buttons I still don't want to go too crazy on the complexity, and options hidden in the mod menu 98% of users probably never learn about.
Zaphiel 11. okt. kl. 6:02 
This mod doesn't seem to be working well with Simple sidearms mod. The moment I enable the Auto-combat and AI control, all ranged pawns switches to their available melee weapon and starts chasing the enemy instead of using their ranged weapon.
Albino Monkey 10. okt. kl. 10:18 
An idea I have now that I see that you've added full AI drafting, maybe dive into squads and proper formations? I am running a full synthetic army playthrough right now and being able to have ai squads that stay together and fight a little more smart (more than what we have now) would be amazing. Also thank you for the work you have put in so far, the mod is awesome.
Minitialize 9. okt. kl. 21:22 
thank you for this. Everytime my colonists are downed, I feel the need to savescum hard because as vanilla AI is right now, drafted colonists are only as smart as the players handling them so if they die, 7 times out of 10, its def. player fault. At least that's how I view it, so thank you again.
Shampooh 9. okt. kl. 14:27 
Oh good call, now that I check Steam still hadn't downloaded the update. Check the time on your AutoCombat.dll on disk and if it's before the update time here (2:16 pm EDT), you're outdated. Unsub and resub, force a redownload through RimPy, restart Steam, whatever you gotta do. All good now for me.
Albino Monkey 9. okt. kl. 14:07 
Ay, I just had that problem everyone is having where the drafting wasnt working and the UI didnt show up but the patch you just released fixed it. If you are still having problems try to restart your game first before coming here.
Shampooh 9. okt. kl. 13:56 
Not getting any problems with a new colony, only when trying to draft in my ongoing save that had the prior version. I have a very beefy modlist as you can tell which might be a related factor with the differences people are getting, but here's what I'm getting:
Exception in Verse.GizmoGridDrawer.DrawGizmoGridFor: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 1A58987C]
at BigAndSmall.DraftedActionHolder.GetData (Verse.Pawn pawn) [0x0000c] in <75e8245ce183483ca398166bbf6ac5d7>:0
at BigAndSmall.DraftGizmos.ClearPrioritizedWorkAndJobQueuePostfix (Verse.PriorityWork __instance) [0x0002a] in <75e8245ce183483ca398166bbf6ac5d7>:0
at Verse.PriorityWork.ClearPrioritizedWorkAndJobQueue () [0x00017] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX RedMattis.AutoCombat: Void BigAndSmall.DraftGizmos:ClearPrioritizedWorkAndJobQueuePostfix(PriorityWork __instance)
Full thing: https://hastebin.com/share/qopegiwoce.txt
bigd 9. okt. kl. 13:48 
My bad. Here's the error message from the beginning.

System.NullReferenceException: Object reference not set to an instance of an object
[Ref 56CFA0E4]
at BigAndSmall.DraftedActionHolder.GetData (Verse.Pawn pawn) [0x00000] in C:\Games\Steam\steamapps\common\RimWorld\Mods\1 BigSmall_Framework\1.6\Base\Source\BigSmallFramework\Auto-Combat\DraftedJobsUtils.cs:332
at BigAndSmall.DraftGizmos.GetGizmosPostfix (System.Collections.Generic.IEnumerable`1[T] __result, RimWorld.Pawn_DraftController __instance) [0x00031] in C:\Games\Steam\steamapps\common\RimWorld\Mods\1 BigSmall_Framework\1.6\Base\Source\BigSmallFramework\Auto-Combat\DraftedJobsUtils.cs:88
at RimWorld.Pawn_DraftController.GetGizmos () [0x00026] in <24d25868955f4df08b02c73b55f389fe>:0
Cute Pie 9. okt. kl. 12:58 
Any work around for the gizmo disappearing?
Riven 9. okt. kl. 11:38 
I had the gizmo bug, the update fixed it
RedMattis  [ophavsmand] 9. okt. kl. 11:17 
Update: Took a shot in the dark. I'm guessing the list of auto-fire set abilities has somehow scribed as null for some users.

Can't reproduce it myself though.
RedMattis  [ophavsmand] 9. okt. kl. 11:07 
@bigd
What is the error? The copied text is just pointing at a line. Is it a NullReferenceException?
NoClip 9. okt. kl. 11:05 
Echoing recent statements here, also getting the gizmo bar disappearing when a pawn is drafted now since the update
LeInsurge 9. okt. kl. 10:58 
gizmo bar stopped working with the latest mod update :(
bigd 9. okt. kl. 9:41 
This is what I get. Its trying to look for files dealing with dealing with Big and small files. I tried with big and small mod installed and uninstalled and the same results.

at BigAndSmall.DraftedActionHolder.GetData (Verse.Pawn pawn) [0x00000] in C:\Games\Steam\steamapps\common\RimWorld\Mods\1 BigSmall_Framework\1.6\Base\Source\BigSmallFramework\Auto-Combat\DraftedJobsUtils.cs:332
at BigAndSmall.JobGiver_AutoCombat.TryGiveJob (Verse.Pawn pawn) [0x00013] in C:\Games\Steam\steamapps\common\RimWorld\Mods\1 BigSmall_Framework\1.6\Base\Source\BigSmallFramework\Auto-Combat\AutoCombatJob.cs:84
Paolini 9. okt. kl. 8:20 
So this is not needed if we already have Big and Small Framework ?
Mara 9. okt. kl. 7:35 
Simple sidearms compatible?
ASaltyTwixBar 9. okt. kl. 6:53 
I'm having the same issue. Disabling the buttons in the mod settings doesn't do anything, and I'm using Character Editor to down Pawns that are drafted and cannot be un-drafted.
Ev 9. okt. kl. 6:49 
Yeah, just experienced that too.
Logical Terror 9. okt. kl. 6:28 
this update broke something, the mod is looking for big and small references and the gizmo bar is disapearing when drafted.
Ev 9. okt. kl. 6:20 
Does the full-auto mode in this update obsolete loading Search & Destroy together with this mod?
RedMattis  [ophavsmand] 9. okt. kl. 5:10 
Update

Added a full-auto mode.

When enabled they will hunt down any hostile threats (which you are aware of/aren't fogged), beating down doors if required to reach them.

As always you can disable any extra buttons in the mod setting.
ELF SLAYER 28. sep. kl. 15:48 
Thanks for adding the option to disable gizmos! It was getting really crowded
biowreck 23. sep. kl. 16:24 
Works now ::cozyspaceengineersc:
RedMattis  [ophavsmand] 23. sep. kl. 14:26 
@biowreck
Try updating it again. The name of the settings menu button had gone missing.
biowreck 22. sep. kl. 20:24 
Hey, just trying to confirm if it's on my end or not. The options don't show up with only DLCs, Harmony, and your mod running. I've tried resubscribing a couple of times too. Does it work on your end?
RedMattis  [ophavsmand] 22. sep. kl. 11:15 
Update:
Added mod settings menu and ability to toggle on and off display of buttons.

Also added the ability to make the main button be a dropdown menu instead.


@Roque the Rogue
The problem with swapping the state on abilities individually is that when you use it on a large group of pawns the behaviour becomes a bit chaotic.

I might add it as a right-click-menu option though.
Roque the Rogue 8. sep. kl. 22:20 
Greetings RedMattis, I've had an idea for improving the toggle gizmo on left click;

What if when you click to autocast, it shuffles between;
-Normal mode (just the usual autocast, for basic abilities)
-1 Cast Once (like buffing or triggering a shield)
-2 Cast Twice (useful for certain powerful abilities)

It does another layer of utility.

I think doing this can solve some of the spam issues pawns seem to have with certain abilities, especially ones that consume a resource pool, like force abilities, like hemogen abilities, some mods, allows you use shield abilities and pawns will proceed to spam the ability quickly depleting resources.

Awesome if possible, thanks for your contributions.
next0ne22 7. sep. kl. 12:57 
Thanks for reply, I will keep your mod in my list and check it later. Good piont is that auto-combat now is auto-disabled when undrafting, that was one of the reasons I had to look for alternatives. What I like in Drafted AI is avoiding friendly fire is also there.
RedMattis  [ophavsmand] 6. sep. kl. 9:32 
Seems like I missed the language keys. This should be fixed now. Thanks for pointing it out. :)
DAOWAce 6. sep. kl. 9:24 
Yeah, code text is displaying instead of a friendly name on the, I assume, new option (3rd gizmo).
天才少公子 5. sep. kl. 15:44 
The newly added Auto-Combat mode option seems to display incorrect text in the game.
RedMattis  [ophavsmand] 5. sep. kl. 13:28 
@elĐeve
Correct. This is a standalone version of the optional built-in auto-combat. :)
elĐeve 5. sep. kl. 0:59 
now i think of it it's the same autocombat that it's integrated in big and small? i just noticed i can enable it lol (i'm not subbed to this one) :SG0_BestGirl:
RedMattis  [ophavsmand] 5. sep. kl. 0:03 
@next0ne22
If your issue is them charging too much then the new update might be what you were looking for.

If you wanted them to chase foes around corners then it is better to combine this mod with something like Search & Destroy.

I've not tried the Drafted AI mod, so I can't say how it compares to it, but if you have specific feedback I'm always grateful for it. :)

@elĐeve
I don't think this mod has any performance issues at all. Most of the methods I've created are probably cheaper than what the vanilla AI foes uses against you.

@tanyfilina
I don't know what the other mod does, but I did read a comment from someone saying they used them together.

@Some Random Pleya
Thanks!
RedMattis  [ophavsmand] 4. sep. kl. 23:55 
New update!
Melee characters can now be set to only engage nearby foes. Of course if you want them to hold their ground, just toggle autocombat on that pawn.

This was a feature voted by our supporters. :3

Also, auto-combat now is auto-disabled when undrafting. If you want to change the settings for this the auto-combat settings are in the B&S Framework.

I might make a setting menu for the standalone mod too though, it seems to get requested a fair bit.

Also pondering if I can make ability auto-cast clearer since I think most people miss what is probably the coolest feature. In my humble opinion ofc... :D
next0ne22 4. sep. kl. 17:40 
Had to disable this mod, melee pawns didn't act smart. Drafted AI mod works better for me.
elĐeve 1. sep. kl. 23:15 
does it perform better than 'search and destroy'?, that mod sometimes kills my tps when i activated for a high skilled melee pawn
Phoenix-D 31. aug. kl. 23:56 
Run and Gun amazingly actually works fairly well un-updated.
tanyfilina 31. aug. kl. 12:14 
It's amasing that there apeared two auto-combat mods at one time, I've missed this one! Would be helpful to know the differences. Do I understand right that this mod allows for auto-combat when not drafted too?
I would generally expect this mod to be better, as it's made by much more experienced modder, while that one, I suspect, is made largely by AI :)
(and while I'm here and if you engaged into the combal modding, maybe you could add the functionality of the Run and Gun mod? We're all waiting for Meme Goddess to update it, but still no news)
k/\ttnjiå 29. aug. kl. 8:44 
"At the moment you need Big & Small Framework since this mod doesn't have a mod menu for settings, but I might add it to this standalone as well if there is enough interest for tuning things in detail."

Certainly interested here uwu
Some Random Pleya 24. aug. kl. 21:21 
ow this is better than search and destroy I love it
RedMattis  [ophavsmand] 18. aug. kl. 13:16 
Update:
I've added an option for toggling off the auto-combat when a pawn is undrafted.

At the moment you need Big & Small Framework since this mod doesn't have a mod menu for settings, but I might add it to this standalone as well if there is enough interest for tuning things in detail.
RedMattis  [ophavsmand] 18. aug. kl. 12:01 
@Bear
You mean for my abilities? Otherwise I don't have friendly fire avoidance, that is from the other mod.

if I disable the friendly-fire avoidance for abilities they will literally fireball their own team if an enemy would also be hit. I doubt there are many instances where you'd want this.

@Ali50
Sounds good. :)
Bear 18. aug. kl. 10:26 
Could you please add an option to disable the friendly fire avoidance behaviour?
Ali50 18. aug. kl. 6:41 
@RedMattis yes they work together with no real issues for ranged pawns. They use Drafted Auto-Combat for enemies in their sight and then switch to Drafted AI to search for new enemies on the map.

If both are activated for melee pawns, Drafted AI's code for "avoid friendly fire lines" seems take precedent over your / B&S framework's code.
They will not close in on enemies shot by other pawns and only wriggle on the spot if those are the only enemies left. Otherwise they search for new targets on the map.

I think the severity of this can be configured in the mod config for Drafted AI but I have not tinkered with that yet. So far I would simply deactivate the DAI gizmo for melee pawns.