Jump to content
Sign in to follow this  
SpaydCBR

Any way to replace MenuInventory with Arsenal?

Recommended Posts

I want my players to pick their loadout before they spawn into the game to limit the number of restricted items there are in the world (e.g. There should be no more Rocket Launchers than there are AT soldiers) for balancing reasons. I've looked into MenuInventory, but it seems that I'd have to choose the loadouts for them and I don't want to do that. I was wondering if there's a way to replace it with the Virtual Arsenal, where when you're in the Respawn menu, you click on the right arrow to go to the change loadout screen (as you normally would for MenuInventory), but you're taken to the Virtual Arsenal instead, where you can build your loadout from a predefined set of items.

 

Would this be possible? I have no clue how to do this, as I have absolutely no idea how the respawn templates actually work (perhaps there are guides I can read). I'm also open to other suggestions on how to do this, but I think this way would be the ideal User Experience, since players would not be bothered by the Arsenal when they're respawning (and spawn with their last loadout) unless they want to change their loadouts.

Share this post


Link to post
Share on other sites
Guest

This is a good idea as the arsenal is heavily modifiable.

You can achieve it by whitelisting the launchers only for AT soldiers. You may also take a look at the wiki. All is explained there.

Share this post


Link to post
Share on other sites

End Game mission do that. It is in the Mark folder of the game.

 

You can open the addons in it and take a look how End Game did it.

Share this post


Link to post
Share on other sites
Guest

End Game mission do that. It is in the Mark folder of the game.

 

You can open the addons in it and take a look how End Game did it.

Ironic as fk from you.

Share this post


Link to post
Share on other sites

Ironic as fk from you.

Ironic ... why?

 

I am looking how to mod the arsenal and how to allow players to respawn with the gear you set them with arsenal. and the only original mission that have something similar is End Game. And the PBO's are in that folder.

Haven't managed to learn nothing from them... So if someone understand it just explain it to me.

Share this post


Link to post
Share on other sites
Guest

If I remember it. I will post some code of Arsenal whitelisting when I get back home.

Share this post


Link to post
Share on other sites
Guest

Okay here is the original Bohemia function for the Arsenal.

http://hastebin.com/azuwuguyay.coffee

 

For the whitelisting thing.

Doc https://community.bistudio.com/wiki/Arsenal

 

Sumary

If you create a crate named "MyAwesomeCrate"

["AmmoboxInit",[MyAwesomeCrate,[false,true]] spawn BIS_fnc_arsenal; // Add the action to the crate
[MyAwesomeCrate,["arifle_MX_F","arifle_MX_SW_F","arifle_MXC_F"],true] call BIS_fnc_addVirtualWeaponCargo; // Add some weapons
[MyAwesomeCrate,["arifle_MX_F"],true] call BIS_fnc_removeVirtualWeaponCargo; // Oups, we don't want the classic MX anymore

Share this post


Link to post
Share on other sites

Thanks for the responses guys, but I already have a working Arsenal with whitelisted items that's attached to an ammobox in the world. My problem is that an AT guy could simply 'drop' his launcher for a non AT guy to pick up, then the AT guy can get another one for himself thus bringing in more launchers than allowed into the world.

 

My question was how do I start the Virtual Arsenal BEFORE they respawn, like maybe in the respawn menu. Just like in Battlefield where you can only select your loadout before you spawn. The MenuInventory template let's you do this, but I don't like it. I was hoping there was a way I could replace it with the Virtual Arsenal where it's accessible from the respawn position menu.

Share this post


Link to post
Share on other sites
Guest

There are a few event handlers and other commands you can use to test if a non AT guy got an launcher.

Share this post


Link to post
Share on other sites

Well I don't really want to restrict a non-AT guy from picking up and using a launcher (that kind of limitation would be silly), I just want to limit how many launchers (or sniper rifles too) are allowed in the world, for balancing reasons.

Share this post


Link to post
Share on other sites

My question was how do I start the Virtual Arsenal BEFORE they respawn, like maybe in the respawn menu

 

Hi SpaydCBR, if you have Arsenal ammobox named "ammobox" with whitelisted items in place, why not launch Arsenal from onPlayerRespawn.sqf:

["Open",[nil, ammobox, player]] call BIS_fnc_Arsenal;

This way players get to choose their gear only upon respawn, so they cannot drop weapons to anyone unless of course they commit suicide and respawn yet again. You may have to add respawnOnStart in your description.ext to make this work the way you want to.

 

Just an idea,

Nikander

Share this post


Link to post
Share on other sites

Hmm, that actually did work Nikander. Thanks!

 

My only problem with it is that my OCD is annoyed that I have to see it every time I respawn haha. I was hoping it could be hidden like the MenuInventory so that I only see it when I WANT to change my loadout! Makes for a better user experience I think.

Share this post


Link to post
Share on other sites
Guest

You can make a custom dialog on respawn.

1. Keep my loadout

2. Open Arsenal

You can even make them automaticaly respawn with theur previous loadout everytime and add a user action to display the arsenal at the next death.

Share this post


Link to post
Share on other sites

My only problem with it is that my OCD is annoyed that I have to see it every time I respawn haha

 

Yes, have it accessible with the user action menu like harmdhast suggests. Put this in your onPlayerRespawn.sqf instead:

player addAction ["Arsenal", {["Open",[nil, ammobox, player]] call BIS_fnc_Arsenal; player removeAction (_this select 2)}];

Have fun !

 

Nikander

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
Sign in to follow this  

×