Combat Training Mod

Started by Iamkriil, October 19, 2018, 01:45:38 PM

Previous topic - Next topic

Iamkriil

This mod adds a new work type to let you train your combat skills.  This can be added to 1.0 and B19 save games

New Feature: Training weapons added

Usage
1. Create a combat dummy (or several).
  a. Combat dummies are structures located in the Misc tab.
2. Designate a combat dummy with the train combat designation.
  a. Select the combat dummy or dummies you want to designate for combat training and then click the train combat button
3. Open the work tab and make sure to prioritize Train Combat as desired
  a. Your colonist will use their currently equipped weapon to attack the dummies.
  b. Equip a training weapon to avoid damaging the combat dummies too much.  Training knives can be created at a craft spot or smithy, while training BB guns need to be crafted at a machining table.

Balancing
Combat training grants you about the same xp as actual combat.  This is balanced by making it a work type. Your colonists won't be doing any other work when training combat, plus it costs resources to create a dummy and training weapons.

Future Enhancements

Combat Training Weapon Racks
Colonists must smith or craft training weapons to avoid destroying combat dummies while training combat (which will happen when using regular weapons)  I'm going to add buildable training weapon racks containing training weapons.  Colonists will equip the training weapons before they start training and re-equip their previous weapon when finished.

Combat Training Room
After the training weapon racks are in place, a new room type will be added - Combat Training Room.  At least one combat dummy and one training weapon rack will be needed for the room to be designated as a combat training room.  The room will give a mood buff if it's impressive.

Iamkriil

Any one good at art? I need an image for the mod and a better icon for the practice combat command. Also, I'd like the combat dummies to be rotatable so would need a front, side and back view. Credits will be in the mod description. Thanks everyone!

Also let me know if you find any bugs.

Iamkriil

Updates:

Orders tab can now be used to designate combat training dummies.
Colonists no longer take friendly fire damage from other colonists training ranged skill.

Iamkriil

Updates:

Added training knives and training BB guns that won't do little to no damage to the combat dummies.
Training knives can be crafted at a smithy or crafting spot and BB guns need to be crafted at a machining table.

vandal

this is great! while i always played with the misc combat training mod and before that added shooting ranges i have never seen one that adds a room role. more mods should do this

Iamkriil

Latest feature: Automatically switch to training weapon, train combat, then switch back to previous weapon.

I finally got this working after nearly a week.  Colonists training combat will now look for a  training weapon starting in the room with the combat dummy and outward from there (not a global search, within 15 regions and 50 cells). They'll look for a weapon of the same skill that they have equipped (melee or ranged, melee if they have no weapon). They will then equip the training weapon and train until they hit saturated training for that skill for the day (4000 xp per day for combat skills).  After that, they will equip the weapon they had when they started training (which remains reserved during training). They will also take a break after 5000 ticks and if there is nothing else to do they'll continue.  This results in a weird switching to previous weapon and then back to the training weapon. Your colonist won't switch back to their previous weapon if you interrupt training (by drafting or prioritizing other work).

The mod only extends existing classes so should work with any mod that presents the original API of the core system.

I'm linking the source here because I haven't done a lot of testing and I figured the people on this forum would a more appropriate audience than putting it directly to steam.

https://github.com/Kriil/rimworld-combat-training

I want to have tags in the definition for users to modify the succeeded job condition.  Right now the colonist won't train if they have saturated either combat skill for the day, but I was thinking that users could set a threshold (i.e. train 6000xp or train to the next level, etc). Anyone know how to add custom tags to the XML defs?

Known issue:  A colonist with a burning passion for shooting finishes training real quick, but then slowly starts to LOSE xp in shooting.  *sigh* This will take forever to debug. Let me know if you have any ideas.




J.BEAR

so instead of a target dummy with HP
why not just have something like the "sleeping spot" that has no HP

or is there some limitation to gaining XP vs no-HP things?

Iamkriil

Quoteso instead of a target dummy with HP
why not just have something like the "sleeping spot" that has no HP

Derp...I didn't even think about that.  That would solve TONS of issues.  If it does work, at least I will have gained a lot of familiarity with the code base.

Thanks J.BEAR

Iamkriil

There is an attribute in ThingDef xml called useHitPoints, which when set to false makes the building indestructible.   This also makes it immune to Fire as one would expect.

Also, I forgot about the other issue I had with shooting up an indoor room.  Collateral Damage.  I turned off friendly fire when firing at a Combat Dummy, but the rest of the room gets demolished.  I even set one colonist to full time constructing and he couldn't even keep up with the damage.  The only way that changed was to switch to a less damaging weapon. So back to the need to switch weapons.

I was really excited by this idea.  Oh well, back to bug fixing.

Let me know if you have other ideas.

Iamkriil

QuoteKnown issue:  A colonist with a burning passion for shooting finishes training real quick, but then slowly starts to LOSE xp in shooting.  *sigh* This will take forever to debug. Let me know if you have any ideas.

Apparently this isn't a bug.  If your colonists have a skill higher than 10, it will slowly degrade over time.  The higher the skill, the faster the degradation.

Canute

Using the pawn's weapon for training isn't allways a good thing.
Since visitors use these too, it could be real dangerous if the visitor carry rocket launchers or even just frag grenades.

Ruisuki

true. i remember guests from hospitality using their grenade launchers on the training dummy from misc mod and starting a fire

Ruisuki

starting to see how vital bb rounds are since the walls behind my dummy target from haplos mod keep being destroyed by the targets. If a grenadier guest shows up he will absolutely burn down the wooden walls too damn

publicuser

There is no release version on github, just master version.