Skip to content

CSW - Add CSW ammo handling to wheeled vehicles#9085

Closed
killerswin2 wants to merge 33 commits intoacemod:masterfrom
killerswin2:CSW_FOR_VEHICLE_TURRETS
Closed

CSW - Add CSW ammo handling to wheeled vehicles#9085
killerswin2 wants to merge 33 commits intoacemod:masterfrom
killerswin2:CSW_FOR_VEHICLE_TURRETS

Conversation

@killerswin2
Copy link
Copy Markdown
Contributor

@killerswin2 killerswin2 commented Oct 27, 2022

When merged this pull request will:

  • Add ammo handling to the vehicle's interaction menu
  • Adds a few more ammo types that these vehicles require
  • This support was extended to SOG and RHS compats. I would do more but I don't own any other CDLCs
  • The new csw turrents all got custom load and unload times.
  • magazine locations were left on the vehicle, but they can be moved else were if someone has the time to find the correct name selections for about 75 objects (<- maybe someone who has a lot more free time then me)
  • stringTables where added, translations will be needed later
  • SOG got two more ui pictures, one for zpu and one for m40 ammo
  • RHS slap ammo was added to CSW but only the 400 count for crows weapon systems

Videos of use
https://youtu.be/biR3zFmbXpU

November 1st 2022 Update Video
https://youtu.be/mUeDi7owfO4

@killerswin2
Copy link
Copy Markdown
Contributor Author

ARMA3
rhsafrf
rhsgref
rhssaf
rhsusaf
sog
here are svgs of the inheritance that I used

@rautamiekka
Copy link
Copy Markdown
Contributor

All the cDLC's have a compatibility data mod in the Workshop for those who don't have the cDLC, the diff being it's only good for joining the multiplayer and checking the stuff out in Arsenal, if the descriptions can be trusted.

Comment thread addons/csw/CfgMagazineGroups.hpp Outdated
Comment thread optionals/compat_sog/stringtable.xml Outdated
killerswin2 and others added 2 commits October 27, 2022 19:17
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
@killerswin2
Copy link
Copy Markdown
Contributor Author

yeah I'm a bit iffy on compatibility data, the only one that I trust is the sog one.

@severgun
Copy link
Copy Markdown
Contributor

severgun commented Nov 1, 2022

Without code changes this is dirty implementation.

Reload should be only from turret seat. On some vehicles only turned out.
In your video at 1:03 SPG auto reloaded.
As I understand ammo not removed/unloaded from turret on spawn.
I think vehicle inventory can not be used for loading/unloading mags in this implementation. Will work only from/to backpack?

Also in theory some mags should be interchangeable between vehicle and player's weapon. For example M240.

@killerswin2
Copy link
Copy Markdown
Contributor Author

killerswin2 commented Nov 2, 2022

I think vehicle inventory can not be used for loading/unloading mags in this implementation. Will work only from/to backpack?

bd396d1 Added support for getting ammo out of the vehicle, but originally this work already if you had ammo in the vehicle because CWS uses nearestSupplies for searching. [PR here] (#8776)

Also in theory some mags should be interchangeable between vehicle and player's weapon. For example M240.

m240 is defined that way.

class rhs_mag_762x51_M240_200 {
There is actually multiple of those in the magazinegroups.

Reload should be only from turret seat. On some vehicles only turned out.

I disagree on that idea. If the weapon is out in the open and I can see it and physically touch it then why should I not be able to operate it like a regular static weapon. The difference is that one weapon is attached to wheel while the other is not.

In your video at 1:03 SPG auto reloaded

Turrets auto reload when empty or unload. I believe that is a base game feature.

Comment thread addons/csw/functions/fnc_reload_canLoadMagazine.sqf Outdated
@Drofseh
Copy link
Copy Markdown
Contributor

Drofseh commented Jun 20, 2023

imo I don't like the mix of the vanilla system of storing extra ammo. Spawning a vehicle with 3 extra mags, but only being able to unload them and never reload feels really weird to me. I think it'd be better to have a onInit handler that removes all the compatible default ammo and switch them to CSW mags in the inventory whenever the system is enabled.

Moving the magazines to inventory may break loadouts for existing missions.

@BrettMayson
Copy link
Copy Markdown
Member

BrettMayson commented Jun 20, 2023

Moving the magazines to inventory may break loadouts for existing missions.

Was there not a way to go over the cargo space limit?

@killerswin2
Copy link
Copy Markdown
Contributor Author

killerswin2 commented Jun 20, 2023

yeah, I know addItemCargoGlobal will do that

@Drofseh
Copy link
Copy Markdown
Contributor

Drofseh commented Jun 20, 2023

Moving the magazines to inventory may break loadouts for existing missions.

Was there not a way to go over the cargo space limit?

addItemCargoGlobal will do it as killerswin2 says, but that's still problematic as a full inventory prevents players from putting things into the inventory during gameplay.

For example, if the vehicle has a toolkit and is overfilled with CSW ammo, I take the toolkit to repair the vehicle, now I cannot put the toolkit back in the vehicle.

@BrettMayson
Copy link
Copy Markdown
Member

setMaxLoad to compensate for the additional items?

Still preferable to the current mix of vanilla and inventory

@Drofseh
Copy link
Copy Markdown
Contributor

Drofseh commented Jun 21, 2023

setMaxLoad to compensate for the additional items?

Still preferable to the current mix of vanilla and inventory

That could work, get normal inventory capacity, get mass of all vehicle magazines, setMaxLoad to the total, add the vehicle magazines

@killerswin2
Copy link
Copy Markdown
Contributor Author

Alright, implemented. It's a option. If players don't want it they can have it turned off.

Copy link
Copy Markdown
Member

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good compat work.

Comment thread addons/csw/functions/fnc_staticWeaponVehicleInit.sqf Outdated
Comment thread addons/csw/functions/fnc_staticWeaponVehicleInit.sqf Outdated
Comment thread addons/csw/stringtable.xml Outdated
Comment thread addons/csw/stringtable.xml Outdated
Comment thread addons/csw/stringtable.xml Outdated
Comment thread addons/csw/stringtable.xml Outdated
Comment thread addons/csw/initSettings.sqf Outdated
Comment thread optionals/compat_rhs_usf3/stringtable.xml Outdated
@killerswin2 killerswin2 requested a review from LinkIsGrim June 23, 2023 18:50
Comment thread addons/csw/XEH_postInit.sqf Outdated
change bracket placement

Co-authored-by: BrettMayson <brett@mayson.io>
@killerswin2 killerswin2 requested a review from BrettMayson June 23, 2023 20:05
@LinkIsGrim LinkIsGrim added the kind/feature Release Notes: **ADDED:** label Jun 26, 2023
@LinkIsGrim
Copy link
Copy Markdown
Member

Linking a belt from a vehicle inventory deletes the magazine and breaks the link condition.

Comment thread addons/csw/functions/fnc_getCarryMagazine.sqf Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs handling for AI reload (GetIn and Fired events). Also we might want at least one magazine to remain loaded? And take GVAR(ammoHandling) into account. Refactoring and then just using FUNC(staticWeaponInit_handleExtraMags) might be a good idea for all that.

@killerswin2
Copy link
Copy Markdown
Contributor Author

killerswin2 commented Jun 29, 2023

I don't have any time to do this pr for the next three weeks.

@killerswin2 killerswin2 reopened this Jun 29, 2023
@killerswin2
Copy link
Copy Markdown
Contributor Author

someone else, will have to implement changes and bring this up to standards

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
@LinkIsGrim
Copy link
Copy Markdown
Member

We'll get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Release Notes: **ADDED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants