-
Notifications
You must be signed in to change notification settings - Fork 259
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
External Ammo Autoloader/Container #2436
Conversation
Implemented: edits in base CE to better accommodate verb-less ammo users. Basis behaviours for ammo container Turret auto rearm from container when depleted Todo: Pawns reload container Optional autopatcher for linkables Eliminate "is AmmoContainer" hardcoded checks
ammo replacement now drops replaced ammo on ground instead of devouring it. No more compfacilities, no more need to autopatch slightly optimized code in building turret gun CE
pawns now will reload ammo containers ammo containers now reload reload-one-at-once turrets as intended
and proper setReloading
now takes in account of comppower, compmannable etc. now it does not reload forbidden turrets Now active reloading only reloads empty or not firing turrets
plus learning helper placeholder
also fixed ammo detonation
Move External Ammo Container From My Own Fork To Here
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-4678012055.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6144163869.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6144167574.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6144205566.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6145226657.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6238404151.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6411790416.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6414549977.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6414552984.zip |
rename ammo container to auto loader no idea why I name it that way in the first place
additional rename for textures
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6415597089.zip |
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.
Works in testing for me. We can probably get rid of the example in the future, but it's useful enough to have as a template for the time being.
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6432106862.zip |
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6473162591.zip |
Additions
-A brand new thingclass of Building_AmmoContainerCE, inherited from Building.
-Building_AmmoContainerCE requires a CompAmmoUser, ticker type of normal and drawer type of MapMeshAndRealTime.
-When placed adjacent to a turret, it will replenish the turret's ammo when being called to do so (via a gizmo, or when turret calls for TryOrderReload())
-Reloading will only occur if the turret's current ammo is the same as the ammo container's ammo, or the ammo container's shouldReplaceAmmo property is true and both buildings has the same ammoset. And only when turret is not full, or ammo container is not empty.
-(again, shouldReplaceAmmo is setted via a gizmo, I'm considering making it turret's property instead of ammo container's)
-Reloading will take (currently, subject to changes) as much time as it is normally reloaded, affected by ReloadSpeed stat, a progress bar will be rendered when the container is reloaded.
-Ammo containers drop ammo when destroyed or an unload gizmo is pressed.
-When an ammo container is destroyed violently, the resulting dropped ammo will take some damage and (hopefully) cook off. Haven't tested yet.
-CompFacility is yeeted, no more patching required.
-Pawns will reload containers as if they're turrets.
-Reload-One-At-Once turrets now get reload one at once-d
-Possibility of different graphic when empty, half full, or full (above 75%), via a mod extension
Changes
-Several additions and changes to make ammoUser works without an actual gun. CE doesn't like giving ammouser to sth not a weapon, but coding a new one will require reinventing too many wheels.
-Mostly additional null checks.
-Some "is Building_AmmoContainerCE" checks are added to make some function work normally for ammo container, I'll try to replace them with less hardcoded checks if possible.
Todo List
-Code clean up, probably
-Multi player support? IDK how to do it, needs enlightment.
-Learning helper, or tutor, or conceptdef.
-Chinese translation for associated strings
Reasoning
Preperation for VE deserter's ammo boxes.
I wanted it for my pack hound missile launcher
Alternatives
Nope lol.
Testing
Check tests you have performed: