Jump to content
Freghar

[ACE] Chestpack - yet another backpack-on-belly mod

Recommended Posts

xPphyq0.jpg


Loosely inspired by FSF SacVentral and Zade's Backpack on Chest, this "mini mod" has a simple goal - to put your backpack on your belly, freeing the backpack slot for something more immediate, like a parachute.

Features
These are some of the features I missed in all other implementations and the reason why I wrote yet another such mod from scratch:
  • preserving ammo counts in magazines during chest/back switch, no magazine-refill cheating
  • preserving attachments/magazines of weapons in backpack during chest/back switch
  • full Multiplayer compatibility, incl. Join-in-Progress (spawning new unit or taking control over existing one), Respawn, even TeamSwitch should work
  • works with Zeus-controlled AI units
To put a backpack on the chest, ACE-self-interact, Equipment, "Backpack on Chest". To do it the other way, "Chestpack on Back". If you have both a backpack and a chestpack, you can swap them using "Swap Chest/Back packs". While carrying a chestpack, the soldier is forced to walk (balancing reasons).

Limitations
The ammo/weapon preservation is possible due to the use of get/setUnitLoadout, as I found no way to store this metadata into an actual backpack (attached to chest or on the ground). The backpack you see on the chest is just a visual model, not a backpack you can access. This is also why I can't create ACE interaction on backpack objects to place them on the chest directly or an interaction to drop a chestpack on the ground.
If you want to pick up / drop / access a chestpack, you need to do it manually from the backpack slot.

To access the chestpack of a dead or unconscious (ACE medical) unit, you need to ACE-interact with it and move the pack onto the unit's back, then you can access it like a regular backpack on the ground / via ACE unconscious inventory.

I also wanted to add the chestpack actions when swimming, but I was unable to figure out why exceptions[]={"isNotSwimming"} doesn't work on/inside ACE_Equipment - if you have a clue, I'm all ears.

Vanilla Arma 3 compatibility
There's none, but the actual logic uses vanilla functionality available even to just missions, so feel free to rip it out and create Action menu actions via addAction for your mod/mission. Just see the code, it's very simple.

Download
chestpack_v1_0.zip (2.3KB)
This mod obviously depends on ACE_interact_menu from ACE3, so it's good to have it.

Released under CC BY 4.0,
https://creativecommons.org/licenses/by/4.0/

Enjoy!
(And sorry for the slight visual glitches, I adjusted the chestpack position as best as I could, visually.)
  • Like 3

Share this post


Link to post
Share on other sites

 

I also wanted to add the chestpack actions when swimming, but I was unable to figure out why exceptions[]={"isNotSwimming"} doesn't work on/inside ACE_Equipment - if you have a clue, I'm all ears.

 

My guess is that you added "isNotSwimming" correctly to your action, but didn't add it to the parent action, "ACE_Equipment". The "ACE_Equipment" parent action is disabled while swimming by default, so your child action isn't shown.

 

https://github.com/acemod/ACE3/blob/master/addons/interaction/CfgVehicles.hpp#L293-L296

 

Solution:

 

            class ACE_Equipment {
                exceptions[] += {"isNotSwimming"};


                class My_Custom_Action { ... };
            };

Share this post


Link to post
Share on other sites

My guess is that you added "isNotSwimming" correctly to your action, but didn't add it to the parent action, "ACE_Equipment". The "ACE_Equipment" parent action is disabled while swimming by default, so your child action isn't shown.

That was my initial guess too, it's why I wrote "on/inside ACE_Equipment", but it didn't seem to work. At that point, I saw no ACE code setting any attributes on ACE_Equipment, so I just assumed (still testing without requiredAddons[] as it seemed unnecessary) that I can just set (`=`) the exceptions[] for ACE_Equipment, but it didn't work and the next logical (debugging) step would be to depend on all ACE modules that define ACE_Equipment (to override it), which was too many.

However I missed interaction/CfgVehicles.hpp and the fact that there are attributes being set in ACE code, which explains the whole thing. Thanks for pointing it out, along with the `+=` tip, I didn't know Arma config classes supported that.

Share this post


Link to post
Share on other sites

However I missed interaction/CfgVehicles.hpp and the fact that there are attributes being set in ACE code, which explains the whole thing. Thanks for pointing it out, along with the `+=` tip, I didn't know Arma config classes supported that.

 

Keep in mind that += is broken for inherited classes. "class ACE_Equipment" is never inherited in that way so it's fine there.

I'd link the issue on the feedback tracker were I explained the behaviour in full detail ...

 

Oh and I'm sorry for this cumbersome system. It's basically from AGM, where I didn't know any better. I'd do it in a way simpler way today.

Share this post


Link to post
Share on other sites

Could this be created as a PR for adding to Ace3 as a standard?

Share this post


Link to post
Share on other sites

Could this be created as a PR for adding to Ace3 as a standard?

It would need quite some work to get it into that state + it's likely not worth yet another .pbo for its rather limited use case.

Share this post


Link to post
Share on other sites

Code for start with the main backpack on front ?

There's currently no nice function for that, so you'd have to do what the ACE action does,

if (isServer) then { [this, (this call Chestpack_fnc_removeBackpack)] call Chestpack_fnc_setChestpack }
(assuming it even works from an init line // untested).

Share this post


Link to post
Share on other sites

Are you just attaching the backpack to the character or did you actually create an additional gear slot?

Share this post


Link to post
Share on other sites

Hey Freghar,

 

I know this is not part of your mod, but it has inspired a question from me. Any chance you could do something similar with a primary weapon? I've been looking for a mod that lets you sling a weapon either on your back, (potentially where launchers go or just lowered against the vest). You seem to have handled things like Ammo counts well. I just wondered if it's possible to have a weapon with potentially rail, scope and silencer attachments visible on the player model.

  • Like 1

Share this post


Link to post
Share on other sites

Hey Freghar,

 

I know this is not part of your mod, but it has inspired a question from me. Any chance you could do something similar with a primary weapon? I've been looking for a mod that lets you sling a weapon either on your back, (potentially where launchers go or just lowered against the vest). You seem to have handled things like Ammo counts well.

It would be doable, but with the same limitation - you cannot (via script) place a pre-configured weapon into any container (or on ground). On the player side, one could use either get/setUnitLoadout (like I did) or primaryWeaponItems/addPrimaryWeaponItem to the same effect. The main problem is visually attaching anything to the player as you would need to constantly rotate/tilt it according to the stance which I don't think can be done efficiently as there's no "stance changed" EH, at least AFAIK, AnimStateChanged could potentially work, but even if it does, it's a LOT of animation states to create the alignment for..

An easier solution (I imagine) would be to make weapons fit the launcher slot, https://forums.bistudio.com/topic/158768-rifle-in-launcher-slot-possible/ .

 

I just wondered if it's possible to have a weapon with potentially rail, scope and silencer attachments visible on the player model.

Not to my knowledge, no. Unless the attachments are part of the base weapon class or the weapon was dropped manually by the player. (Or unless using the launcher slot.)

Share this post


Link to post
Share on other sites

how can I make this to enable to run when using this mod?

Remove the forceWalk commands in fn_setChestpack.sqf and fn_removeChestpack.sqf.

Share this post


Link to post
Share on other sites

I have encountered a visual problem with this addon. With some custom backpacks, inhouse retexture addon in the case i tested, the chestpack appears with the default Arma 3 texture from the model the backpack is based on. Can this be fixed? I tried a get/set texture for the backpack but for some reason it broke the script.

Share this post


Link to post
Share on other sites

I have encountered a visual problem with this addon. With some custom backpacks, inhouse retexture addon in the case i tested, the chestpack appears with the default Arma 3 texture from the model the backpack is based on. Can this be fixed? I tried a get/set texture for the backpack but for some reason it broke the script.

That's because I recreate the backpack on the chest as a Simple Object - if I did create a full "vehicle", its inventory would still be accessible (and incorrect/reset). I guess it could be perhaps possible to getObjectTextures from the original backpack and setObjectTextureGlobal on the new object, haven't tried it yet, no idea how it could "break the script". Alternatively, somehow disabling inventory interaction with a newly spawned vehicle could also work.

Share this post


Link to post
Share on other sites

I like the idea here. Going to check it out as part of a mission I am working on. Thanks for the opportunity to use it.

Share this post


Link to post
Share on other sites

Hi Freghar

 

We have been using FSF for ages but unfortunately since its no longer being maintained alot of errors has crept in.

So with great relieve we have stumbled upon your mod.

Was wondering if it is available on Steamworkshop, since that is now our goto repository? 

 

Thanks.
C

Share this post


Link to post
Share on other sites

Is there a reason the ACE team shouldn't implement this directly into their mod, rather than having this as separate?

Share this post


Link to post
Share on other sites

Hi! Good Mod !

 

But he don't work : after landing i can't run just walk, can you repair ?

 

Thx !! Sorry for language i'm speak little english.

Share this post


Link to post
Share on other sites

Hi! Good Mod !

 

But he don't work : after landing i can't run just walk, can you repair ?

 

Thx !! Sorry for language i'm speak little english.

you need to drop the chute and place your backpack, back onto your back, then you should be fine ;)

  • Like 1

Share this post


Link to post
Share on other sites

Is there a reason the ACE team shouldn't implement this directly into their mod, rather than having this as separate?

 

It looks like ACE is finally realizing that grabbing all this content and not spending the time to verify that it works together is catching up with them and they are moving towards a more modular concept rather than a big lump of stuff. At least that is what it appears to me being on the outside looking in.

  • Like 1

Share this post


Link to post
Share on other sites

Thx SpartanSix , I saw that after...

 

But we have a problem in my team, on dedicated server,  the @ChestPack doesn't work because it is not signed.

 

We try to create "key", "signature", but don't work.

 

Can you signed this mods (create keys) please ?

 

French with Google translate ...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×