Jump to content
Whisperdrive

Sharing intel with all playable units via addAction

Recommended Posts

I am looking for ways to share intel recovered from enemy bodies. My current method is via a "search body" addAction which when selected will call a diary.sqf file. Right now, I am using the following in the init on a searchable unit in the editor:

G1 addAction ["Search Body","diary2.sqf",[],1,false,true,"","!alive _target"];

Diary2.sqf:

if (!hasInterface) exitWith {};
waitUntil {!isNull player};

player createDiaryRecord ["Diary",["Cache location",

"Test Title<br/><br/>

Test Text.....blah...blah...."]];

The problem however, is that I am not certain this intel will be shared between all my players on a MP server. When I tested it with Zeus controlled units, only the units that did the searching had access to the recovered intel, the other did not. Can anyone confirm if this method is MP compatible for sharing interact-able intel -or- any recommendations as to how I could search for intel on an enemy body and have that recovered intel be shared with current players in the mission?
 

Share this post


Link to post
Share on other sites

Correct that would not share the info with all players.

Swap...

"diary2.sqf"

for...

"'diary2.sqf' remoteExec [ 'BIS_fnc_execVM', 0, true ]"

This will run the script( diary2.sqf ) on all clients( 0 ) and for any JIP( true ).

You may also want to think about removing the action from all clients as well, so that the info cannot be collected again.

  • Like 1

Share this post


Link to post
Share on other sites

@Larrow
Thanks for the reply. Just to confirm, should the addAction read as:

G1 addAction ["Search Body","'diary2.sqf' remoteExec [ 'BIS_fnc_execVM', 0, true ]";
Quote

You may also want to think about removing the action from all clients as well, so that the info cannot be collected again.


From the addAction, I thought I could use the hideOnUse parameter set to false, so all things considered if I write it as:

G1 addAction ["Search Body","'diary2.sqf' remoteExec [ 'BIS_fnc_execVM', 0, true ]",[],1,false,true,"","!alive _target"];

would this likely work to prevent other players from using the addaction again?

Thanks again for the help!



 

Share this post


Link to post
Share on other sites
_action_id = G1 addAction ["Search Body","[ _this, 'diary2.sqf' ] remoteExec [ 'BIS_fnc_execVM', 0, true ]",[],1,false,true,"","!alive _target"];

//store addAction id on object
g1 setVariable[ "actionID", _action_id ];
params[ "_target" ];

player createDiaryRecord ["Diary",["Cache location",

"Test Title<br/><br/>

Test Text.....blah...blah...."]];

//if g1 still exists
if !( isNull _target ) then {                                  
    //get addAction id from object
    _action_id = _target getVariable[ "actionID", -1 ];
    //if we have a valid id
    if ( _action_id > -1 ) then {
        //remove search action
        _target removeAction _action_id;
    };
};

 

  • Like 2

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

×