[1.1] RunAndGun

Started by Roolo, October 14, 2017, 02:36:40 PM

Previous topic - Next topic

Enemy pawns should be able to shoot while they are fleeing

Yes please! I would do the same if I were fleeing with a gun in my hands.
31 (73.8%)
No, let me have my revenge!
11 (26.2%)

Total Members Voted: 42

Roolo




Description
Your colonists can never be a true Rambo if they cannot gun while they are running. Therefore, this mod adds a mode that, when enabled, allows drafted colonists and AI pawns to shoot while moving at the cost of an accuracy and movement penalty. These penalties can be modified in the mod settings of this mod.

Some things to take into account:

  • NPC pawns are also capable of Running and Gunning. This can be disabled in the mod settings if that is too intimidating for you.
  • Fire at will should be enabled. Firing manually will cause the pawn to stop running.
  • Run&Gun mode can only be enabled when the pawn is drafted, and is carrying a ranged weapon in its hands.
  • The movement penalty is only applied at the moment the pawn is actually shooting or cooling down after shooting. So don't bother disabling Run&Gun every time you just want your pawn to walk somewhere. 
  • The accuracy penalty is only applied when pawns with RunAndGun enabled are actually moving, so don't bother disabling RunAndGun every time a pawn stands still while shooting.
  • The movement penalty depends on the heavyness of a weapon. A weapon can either be heavy or light. Light weapons get a lower movement penalty compared to heavy ones. What is considered a heavy/light weapon can be configured in the mod settings.
  • Enemy pawns will also run and gun while fleeing. However, the chance that they do this can be configured in the mod settings.


Download

All Releases (B19, B18 and A17):
Steam Workshop (B19)

Dependencies
This mod depends on Hugslib, so make sure that mod loads before this mod does.

Compatibility with saves and other mods
- Is compatible with existing saves.
- Some non-default races are unable to RunAndGun, however, a fix for this will be released soon.
- Besides that, no known compatibility issues with other mods. Please let me know if you find any.

Known issues
  • Letting a pawn stop moving when a burst fire is not finished yet, will let the pawn continue shooting without any delay. This will be fixed in the next release.
  • Besides that, all issues communicated to me are solved as far as I know. This does not necessarily mean no issues exist.  Please let me know if you find any issues. I wan't them gone as bad as you.
Upcoming Features
I would like to implement the following features but do not promise anything. (ordered by priority)

  • Let the AI make use of RunAndGun, can be turned off in the mod options
  • Option in the mod settings that can toggle if enemy pawns can fire while they are fleeing
  • Make the movement penalty dependent on the gun that is being used (suggested by steam user: Not Birthday Boy (Alfons)).
  • Allowing melee weapons to be used while running

Demonstrations
Small preview
Mod showcase (by BArkY)

Permissions
Feel free to add this mod to modpacks or to use the code or icons for other projects. Do however not release exact copies of my project, or exact copies with minor adjustments without my consent.








WalkingProblem

Wow! This is awesome.

Does the AI use this run & shoot ability too?

ChJees

Well, first bug report i guess :P.

Cause: Attempted to move Blazko using Achtung. Also other mods to note which COULD interfere: Friendly Fire and Simple Sidearms.

Screenshot when the error occured.

Exception in Tick (pawn=Blazko, job=Goto A=(136, 0, 179), CurToil=0): System.NullReferenceException: Object reference not set to an instance of an object
  at RunAndGun.Harmony.JobDriver_SetupToils.checkForAutoAttack (Verse.AI.JobDriver_Goto __instance) [0x00000] in <filename unknown>:0
  at RunAndGun.Harmony.JobDriver_SetupToils+<>c__DisplayClass0_0.<Postfix>b__0 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.DriverTick () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=Goto, curDriver=Verse.AI.JobDriver_Goto

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

Related to mods i got.
Loading game from file LMX Merc Corps3 with mods MOD-E-master, Core, 818773962, 839005762, 1136216344, 733113011, 972897322, 1120946454, 918312251, 881864390, 1153387243, 940371232, 725956940, 1136219877, 856434414, 1129661188, 882804155, 1158380775, 912267364, 1153388192, 1159723337, 817996020, 735106432, 945803165, 761421485, 944063011, 972057888, 1157085076, 920546527, 1158568885, 1102480398, 731111514, 1055485938, 1136958577, 1141721293, 942690136, 927155256, 1106719215, 1098354593, 1089876213, 1106068552, 817986239, 730936602, 929270780, 926675929, 786055494, 735241897, 836308268, 731287727, 1076757664, 909429482, 725949967, 725952322, 730528968, 1137698168, 1088742286, 1134165362, 1135183184, 725947920, 849231601, 736139206, 736207111, 728381322, 826153738, 1105837573, 1131990764, 767212104, 935982361, and 1168979753

Roolo

#3
Quote from: Walking Problem on October 14, 2017, 02:55:58 PM
Wow! This is awesome.

Does the AI use this run & shoot ability too?

Thanks. It's not implemented for the AI yet, but I'll definitely try to do that in the future.

Roolo

#4
Quote from: ChJees on October 14, 2017, 03:05:07 PM
Well, first bug report i guess :P.

Cause: Attempted to move Blazko using Achtung. Also other mods to note which COULD interfere: Friendly Fire and Simple Sidearms.

Screenshot when the error occured.

Exception in Tick (pawn=Blazko, job=Goto A=(136, 0, 179), CurToil=0): System.NullReferenceException: Object reference not set to an instance of an object
  at RunAndGun.Harmony.JobDriver_SetupToils.checkForAutoAttack (Verse.AI.JobDriver_Goto __instance) [0x00000] in <filename unknown>:0
  at RunAndGun.Harmony.JobDriver_SetupToils+<>c__DisplayClass0_0.<Postfix>b__0 () [0x00000] in <filename unknown>:0
  at Verse.AI.JobDriver.DriverTick () [0x00000] in <filename unknown>:0  lastJobGiver=, curJob.def=Goto, curDriver=Verse.AI.JobDriver_Goto

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

Related to mods i got.
Loading game from file LMX Merc Corps3 with mods MOD-E-master, Core, 818773962, 839005762, 1136216344, 733113011, 972897322, 1120946454, 918312251, 881864390, 1153387243, 940371232, 725956940, 1136219877, 856434414, 1129661188, 882804155, 1158380775, 912267364, 1153388192, 1159723337, 817996020, 735106432, 945803165, 761421485, 944063011, 972057888, 1157085076, 920546527, 1158568885, 1102480398, 731111514, 1055485938, 1136958577, 1141721293, 942690136, 927155256, 1106719215, 1098354593, 1089876213, 1106068552, 817986239, 730936602, 929270780, 926675929, 786055494, 735241897, 836308268, 731287727, 1076757664, 909429482, 725949967, 725952322, 730528968, 1137698168, 1088742286, 1134165362, 1135183184, 725947920, 849231601, 736139206, 736207111, 728381322, 826153738, 1105837573, 1131990764, 767212104, 935982361, and 1168979753


Thanks for the bug report! Very helpful. Might be a compatibility issue. I'll look into it.

Dragoon

Quote from: faltonico
I truly can't understand that sense of balancing a LOT of modders have, pouring more resources on something doesn't make it more difficult, but more annoying. It is not engaging, even if i'm swimming in silver at late game ┬┐why to bother?, why all the effort to get there?.

DiamondBorne

Another revolutionary mod incoming. Me likey. ^_^

Roolo

Thanks everyone :). I fixed a major bug involving turrets not working. I updated the git and steam code. I'll look into compatibility issues later. Please let me know if there are any other issues.

Kori


Ceanox

My god, MY already powerful Marjot, Can be even more powerful While dodging the bullets!

This mod is great, No errors at all.

Roolo

Run&Gun is updated to v1.2. Beware, the AI is now also capable of Running and Gunning!

Crow_T

Really cool, it's amazing the things people come up with :) I assume when grabbing this from github I should download the Master zip file?
(regarding dead man's apparel)
"I think, at the very least, the buff should go away for jackets so long as you're wearing the former owner's skin as a shirt."
-Condaddy20

Roolo

Quote from: Crow_T on October 15, 2017, 03:23:22 PM
Really cool, it's amazing the things people come up with :) I assume when grabbing this from github I should download the Master zip file?

Yes, you assumed well :). Just download the zip from the master branch, unpack it, and place it in the Rimworld mod folder.

PreDiabetic

is it possible to arrange files on Github? Seperate masterfile and releases?

Roolo

Quote from: damngrl on October 16, 2017, 06:15:18 AM
is it possible to arrange files on Github? Seperate masterfile and releases?

You mean like this? https://github.com/rheirman/RunAndGun/releases/

I can do that from now on. Doing it for earlier releases is a bit of a pain though.