RimWorld

RimWorld

275 ratings
Drafted Auto-Combat
8
5
2
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.6
File Size
Posted
Updated
1.496 MB
10 Aug @ 9:40am
23 Sep @ 2:25pm
9 Change Notes ( view )

Subscribe to download
Drafted Auto-Combat

In 2 collections by RedMattis
Red's Workshop Mods
45 items
Quality of Life & Base Pack
69 items
Description
[www.patreon.com]

Adds drafted auto-combat feature for any draftable player-controlled pawn.


Features

Colonists will engage enemies reasonably nearby that they can see.

They will somewhat try to use cover when choosing how to approach.

Abilities on auto-cast will automatically be used (including self-buffs) in combat, and the AI will try to avoid friendly fire.


Pawns can be toggle to automatically seek cover. When active pawns will actively seek out cover against their target, including finding new cover if their previous cover becomes sub-optimal.




Design Goal

The goal of the mod was to create a sort of "reactive" drafted mode where colonists don't run off to the other side of the map (like search and destroy) or relentlessly chase distant foes... but also don't stand around being shot in the face if enemies are out of range or you forget about them for 10 seconds.

I also wanted to get them to utilize abilities automatically since with large colonies this can become a bit of a hassle.


Instructions

When drafted colonists will have a new "Auto-Combat" button, this enables the auto-combat.

To let them use abilities, either right-click the ability to toggle auto-use, or right click auto-combat to toggle auto-use of all abilities.

Abilities without AI parameters
The mod does let you toggle abilities from other mods not set for AI use, but if they have no AI targeting logic the use may be...unpredictable.

Generally ranged attacks will be fine, but self-cast AoEs and such might just get mindlessly spammed if there is no targeting data.

The mass-toggle won't touch such abilities, so this is an easy way to identify abilities that may lack the required data for intelligent use.


Compatibility

It should work with almost any ability, "verb" or weapon approved for AI-use. This includes Vanilla Expanded's custom ability class.

Search & Destroy
Reportedly works well together.

If combined with S&D I expect this mod will take over once the pawns spot the foes, which should make them try to take position to shoot, use abilities, or go into melee.

Big and Small Framework
This also exists built into Big and Small Framework as an optional setting (Mod Option Menu). If both are used it will simply force-enable the auto-combat in B&S Framework instead and otherwise load no extra code.


For modders

The AI can use almost any "AI Can Use" ability that can target foes or themselves.

It relies on Ludeon's "AICanTargetNow" method on abilities for avoiding friendly-fire, so if you find that abilities are often used in a way that harms friends you need to update that method to check so no friends are in the radius.



Mod Discord
[discord.gg][ko-fi.com]
Popular Discussions View All (1)
0
28 Sep @ 7:13pm
just 1,6?
riley
102 Comments
ELF SLAYER 28 Sep @ 3:48pm 
Thanks for adding the option to disable gizmos! It was getting really crowded
biowreck 23 Sep @ 4:24pm 
Works now ::cozyspaceengineersc:
RedMattis  [author] 23 Sep @ 2:26pm 
@biowreck
Try updating it again. The name of the settings menu button had gone missing.
biowreck 22 Sep @ 8:24pm 
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  [author] 22 Sep @ 11:15am 
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 @ 10:20pm 
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 @ 12:57pm 
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  [author] 6 Sep @ 9:32am 
Seems like I missed the language keys. This should be fixed now. Thanks for pointing it out. :)
DAOWAce 6 Sep @ 9:24am 
Yeah, code text is displaying instead of a friendly name on the, I assume, new option (3rd gizmo).
天才少公子 5 Sep @ 3:44pm 
The newly added Auto-Combat mode option seems to display incorrect text in the game.