-
Notifications
You must be signed in to change notification settings - Fork 320
Fix Turret Reload Bug #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Turret Reload Bug #1
Conversation
N7Huntsman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the following error when manually order a pawn to reload (through the UI gizmo) a manned turret they are operating when there is none of that kind of ammo available. https://pastebin.com/ntAAG07F
I get this error when the turret runs out of ammo and the pawn attempts to reload automatically and there is none of the kind of ammo they were using available. https://pastebin.com/E6vYB68U
|
The errors associated with manned turrets becoming "attached" to stacks of ammo no longer seems to be occurring, and operators are now swapping between ammo types as intended and will travel through doors to fetch ammo. Progress!
Out of curiosity, is there any intention to restore this functionality? And will colonists automatically drop ammo from their inventory and use it if it's the only available, or does the player have to do it manually? |
|
@MadaraUchiha Haven't run into any issues during testing, and the error messages are gone. I'd like to get some people with saves affected by the turret issue to load this version of CE to see what it does, but otherwise I'm happy to green-light this. Would it be feasible for colonists reloading turrets to check in the immediate vicinity (think a 3 or 4 tile radius) of the ammo stack they're grabbing if there's not enough there to completely reload the turret? Currently, if they're reloading a turret with FMJ that has an empty magazine and a capacity of 100 rounds, and there's a stack of 75 FMJ and a stack of 40 FMJ right next to each other, the colonist will just grab the stack of 75 and partially reload the turret. While there's no sense sending colonists across the map for the last 2 rounds to top off the magazine, would it be feasible to make them grab from another nearby stack to completely fill the turret magazine? If it'd be a big headache of new checks and jobs and such don't worry about it (since the "solution" is to just order your pawn to reload again), but it might be a nice QoL thing. |
@N7Huntsman I've considered that. What you're talking about is the difference between the vanilla's AtomicRefuel has the capability of reserving and collecting from multiple stacks to fill the requirement to 100%, but it will bail if it can't reach 100%, which is not what we want (or do we?). i.e. if the turret wants 100 rounds, and the player only has 75 in range, nobody would reload. What I think we want is a combination of the two, try to reserve as much as possible up to the limit, but if you don't find enough ammo to fill it all the way, go through with it anyway. The AtomicRefuel toils are significantly more complex than the regular Refuel which I've drawn from, and involve labels and Tynan-implemented goto. I gave it a try at first, and I couldn't get it to work properly, and had trouble debugging what went wrong with it. I do intent to try again, because it's much better UX, but I figured releasing a fix to a game breaking bug has priority over something that can always be added after the fact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved once again.
bf63532 to
c751c96
Compare
A partial reload is definitely better than not reloading.
Yeah, resolving the issue is certainly the priority. I was just curious if it was something that was on your radar--if we want to just stick to the board as a QoL change for later, that's perfectly fine. |
|
Encountered an error while testing mortars: https://pastebin.com/KmgwfBWS Occurred while trying to swap a loaded HE shell out for an Incendiary shell while in the midst of firing at an assigned target. After that error, I was no longer able to reload the mortar with HE or Incendiary shells. I was, however, able to load and fire EMP shells. When I tried to swap from EMP back to Incendiary, it threw the same error, and now I could no longer load any of the three kinds of ammo. |
- Introduce CELogger class to log extra stuff in dev mode. -- It is recommended to use this class instead of RimWorld's own Log class. - Introduce the JobGiverUtils_Reload class -- Holds interesting job creation and ammo lookup logic. - Various small refactors
- Small refactors in CompAmmoUser and JobDriver_ReloadTurret.
- Mechanoids now reload turrets with the JobGiver_DefenderReloadTurret thinknode, patched into the Defend DutyDef. - Turrets now only order reloads directly for manned pawns (i.e. mortars)
- Ask for number of rounds missing to full, or the number of rounds in the found stack. Whichever is smaller.
Will now toss a more meaningful error when MakeReloadJob is called without checking for CanReload first.
c751c96 to
e8e9455
Compare
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VWE Fire Extinguisher Ammo Recipes adjustments
Morgante ww2 italian weapons
Finalize Italian weapon stats
…tch-1 Remove the Middle Layer
simple Warhammer Dryad patch fix
…nger-apparel-fixed Minor Patches and Fixes
…BlasterRetexture Charge blaster turret retexture
RH2 Patches Update - April 2024

Additions
N/A
Changes
Refactors turret reload mechanics
Breaking Changes:
Reloading turrets directly from inventory is not possible anymore. Players need to make the pawn drop from inventory first.
This behavior is consistent with vanilla refueling.
References
CombatExtendedRWMod#1212
Reasoning
Removing the GenClosestAmmo class as suggested by maintainers on CombatExtendedRWMod#1209.
Alternatives
N/A
Testing
Check tests you have performed: