Jump to content

Recommended Posts

I have some boxes (Weapon's Cache) scattered across my map.

 

They can be "retrieved" by any BLUFOR player (BLUFOR player has to use the hold action), which removes the box, adds CuratorPoints to all BLUFOR Curators and removes the question mark from the map (where the box is located).

 

They can also be "destroyed" by any Independent unit (Independent player and AI has to use the hold action), which removes the box and removes the question mark from the map (stopping the BLUFOR Curators from gaining CuratorPoints).

I currently have this in the init of all the boxes scattered across the map.

Spoiler

[

    this,

    "retrieve weapons cache.",

    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",

    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",

    "_this distance _target < 4 && side _this == west && isPlayer _this",

    "_caller distance _target < 4 && side _this == west && isPlayer _this",

    {},

    {},

    { _this call {

        { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

        { _x addCuratorPoints 0.1 } foreach [ ZeusBLUFOR1_1_Curator, ZeusBLUFOR1_2_Curator, ZeusBLUFOR1_3_Curator, ZeusBLUFOR1_4_Curator ];

        deleteMarker "Zeus_M_Unknown1_1";

        }; 

    },

    {},

    [],

    4,

    0,

    true,

    false

] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

 

[

    this,

    "destroy weapons cache.",

    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",

    "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",

    "_this distance _target < 4 && side _this == independent",

    "_caller distance _target < 4 && side _this == independent",

    {},

    {},

    { _this call {

        { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

        deleteMarker "Zeus_M_Unknown1_1";

        }; 

    },

    {},

    [],

    4,

    0,

    true,

    false

] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

When used by any player, the trigger just removes the question mark from the map and nothing else. I think I need to use remoteExec for the deleteVehicle part and the addCuratorPoints, but I do not know how to use that function.
 

Please help!

Share this post


Link to post
Share on other sites

deletevehicle is global command why do you want to use remoteexec? it already can be executed from any client or server

Share this post


Link to post
Share on other sites
4 minutes ago, killzone_kid said:

deletevehicle is global command why do you want to use remoteexec? it already can be executed from any client or server

 

1 hour ago, rkemsley said:

When used by any player, the trigger just removes the question mark from the map and nothing else. I think I need to use remoteExec for the deleteVehicle part and the addCuratorPoints, but I do not know how to use that function.

When a player uses the BIS_fnc_holdActionAdd, the boxes are not removed and CuratorPoints are not added.

Share this post


Link to post
Share on other sites

Once again, deleteVehicle will delete whatever from any client, most likely you are looking at the wrong cause

  • Like 1

Share this post


Link to post
Share on other sites
 { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

Is the objects in a Eden Editor Layer called WeaponCache1_1?

@rkemsley

Share this post


Link to post
Share on other sites
Posted (edited)

.

Edited by sarogahtyp
deleted nonsense

Share this post


Link to post
Share on other sites
Posted (edited)
9 hours ago, mrcurry said:

 { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

Is the objects in a Eden Editor Layer called WeaponCache1_1?

@rkemsley

There are 3 objects which are not named, all grouped together in the Eden Editor Layer called WeaponCache1_1.

 

(Some of the boxes are located in buildings) I have a trigger that destroys the boxes if the building they are in is destroyed, which works fine. It only seems to be an issue with the BIS_fnc_holdActionAdd.

Edited by rkemsley
Wasn't clear about the name

Share this post


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

Once again, deleteVehicle will delete whatever from any client, most likely you are looking at the wrong cause

I can't see what the cause is, that's my issue!

Share this post


Link to post
Share on other sites

The name of the layer must be WeaponCache1_1  (not "WeaponCache1_1")

then

{ deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

works.... if applied on server (due to getMissionLayerEntities 

 

Share this post


Link to post
Share on other sites
2 minutes ago, pierremgi said:

The name of the layer must be WeaponCache1_1  (not "WeaponCache1_1")

then

{ deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

works.

Edited previous reply, wasn't clear on the name of the MissionLayerEntities.

Share this post


Link to post
Share on other sites

so check from where you are running this code (must be server only)

getMissionLayerEntities >>> SE means  >>>> https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality

 

EDITED: If you run it inside an holdActionAdd, you must remote exec it on server (I known you dislike that but it's same problematic as some curator commands 😁)

{{deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" #0)} remoteExec ["call",2];

 

  • Like 1

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

×