Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
BlacKnightBK

How to remove arsenal action

Recommended Posts

Hello guys,

I have created the arsenal script with the help of many of you, especially Serena :) Been trying to play around with it for a while by trying to remove the arsenal. I only want the player to be able to open the arsenal once, however, i have no idea how to remove it.

 

Thanks

Share this post


Link to post
Share on other sites
13 minutes ago, harmdhast said:

Hello,

If you are using an addAction you may do something like this.

 

Obj addAction ["MyAction", {

    //  Code for Arsenal opening;

    removeAction (_this select 2);

}];

 

https://community.bistudio.com/wiki/addAction

https://community.bistudio.com/wiki/removeAction

 

:)

 

The thing is this is not how the arsenal action gets created, therefore I do not have an action ID to remove it.

Share this post


Link to post
Share on other sites

Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it?

Share this post


Link to post
Share on other sites
18 minutes ago, serena said:

Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it?

 

I am so ver sorry, I am such an idiot, trying to do my homework as well as this so when I ask a question I am brain dead.


[ armorer, _contents, false, true ] call BIS_fnc_addVirtualBackpackCargo;

if i can open my custom arsenal using an action key would be great, plz let me know, thanks

Share this post


Link to post
Share on other sites
30 minutes ago, serena said:

Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it?

 

I am so ver sorry, I am such an idiot, trying to do my homework as well as this so when I ask a question I am brain dead.


[ armorer, _contents, false, true ] call BIS_fnc_addVirtualBackpackCargo;

if i can open my custom arsenal using an action key would be great, plz let me know, thanks

Share this post


Link to post
Share on other sites

 In that case, your question might sound like this: how do I remove Arsenal action added by BIS_fnc_addVirtualBackpackCargo function. It is important, because the right question contains half the answer.

RemoveArsenalActionFromGivenObject = {
	{if (_this actionParams _x select 0 == "Arsenal") exitWith {_this removeAction _x}} forEach actionIDs _this;
};


// Test:
[player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo;
player call RemoveArsenalActionFromGivenObject;
  • Like 1

Share this post


Link to post
Share on other sites
54 minutes ago, serena said:

 In that case, your question might sound like this: how do I remove Arsenal action added by BIS_fnc_addVirtualBackpackCargo function. It is important, because the right question contains half the answer.


RemoveArsenalActionFromGivenObject = {
	{if (_this actionParams _x select 0 == "Arsenal") exitWith {_this removeAction _x}} forEach actionIDs _this;
};


// Test:
[player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo;
player call RemoveArsenalActionFromGivenObject;
 

You are amazing, is there anything you can't do?? And I am sorry. In future, I will put much thought into my question before I ask by providing all the information

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, BlacKnightBK said:

Hello guys,

I have created the arsenal script with the help of many of you, especially Serena :) Been trying to play around with it for a while by trying to remove the arsenal. I only want the player to be able to open the arsenal once, however, i have no idea how to remove it.

 

Thanks

 

https://community.bistudio.com/wiki/BIS_fnc_removeVirtualBackpackCargo maybe?

Share this post


Link to post
Share on other sites

It is the opposite of 

BIS_fnc_addVirtualBackpackCargo;

You

  • add it
  • use it
  • remove it

 

 

Share this post


Link to post
Share on other sites
11 minutes ago, BlacKnightBK said:

That removes items from the virtual arsenal, I wanted to remove the action completely. Thanks but Serena already helped me with that and problem solved.

This function deletes action as well

[player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo;

[player, "B_AssaultPack_mcamo_Ammo", false] call BIS_fnc_removeVirtualBackpackCargo;

 

 

Share this post


Link to post
Share on other sites
1 hour ago, killzone_kid said:

You

  • add it
  • use it
  • remove it

 

Description says:

Returns: ARRAY of ARRAYs - all virtual items within the object's space in format [<items>,<weapons>,<magazines>,<backpacks>]
[player, ["B_AssaultPack_mcamo_Ammo"], false, true] call BIS_fnc_addVirtualBackpackCargo;

//Result:
["B_AssaultPack_mcamo_Ammo"]

//Expected:
[[], [], [], ["B_AssaultPack_mcamo_Ammo"]]

Something went wrong?

Share this post


Link to post
Share on other sites

Wait a sec, isn't there a control like "bisArsenalCamera" I know for sure that's not correct. But I believe at one point in time Larrow was able to add the arsenal without calling bis_fnc_removeVirtualEtc . 

Share this post


Link to post
Share on other sites

×