Jump to content

Recommended Posts

Hello everyone, I'm having trouble adding actions to an object. Locally everything goes well. the code below works well and the actions are displayed every 2 after the others. However once on the server, it displays the last action executed by the script ... please help?

if (TerminalArsenal) then {[hds_terminal] spawn fnc_EstUnArsenal};
if (TerminalDeSaute) then {[hds_terminal,"Insertion",7] remoteExecCall ["fnc_EstUnTerminalDeSaut",2]};
if (TerminalDeGroupeIA) then {[hds_terminal,"Groupe:R.O.S",1] remoteExecCall ["fnc_EstUnTerminalDeGroupeIA",2]};
if (TerminalDeGroupeIARHS) then {[hds_terminal,"Groupe:R.H.S",2] remoteExecCall ["fnc_EstUnTerminalDeGroupeIARHS",2]};
if (TerminalDeGroupeIAPERSO) then {[hds_terminal,"Groupe:H.D.S",3] remoteExecCall ["fnc_EstUnTerminalDeGroupePERSO",2]};
if (TerminalMission) then {[hds_terminal,"Mission|Suivante",4] remoteExecCall ["fnc_EstunTerminalMission",2]};
if (TerminalDeNeutralisation) then {[hds_terminal,"Basculer Civil|Militaire",5] remoteExecCall ["fnc_JoueursNeutre",2]};
if (TerminalDeSauvegarde) then {[hds_terminal,"Sauver|Equipement",6] remoteExecCall ["fnc_SauvegardeEquipements",2]};
if (TerminalDeDebugger) then {[hds_terminal,"Nettoyer|Mission",5] remoteExecCall ["fnc_EstUnDebugger",2]};

Below the code of one of my actions

 

params ["_UnObjet","_Message","_Ordre"];
_Message = format ["<t color='#353531'>H</t>|%1",_Message];
_Icone = "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa";

[_UnObjet,                                  //L'objet sur lequel l'action est attachée | The object on which the action is attached
_Message,                                   //Titre de l'action | Action title
_Icone,                                     //L'icone qui est affiché à l'écran | The icon that is displayed on the screen
_Icone,                                     //L'icone de progression | The icon displayed on the progress screen
"_this distance _target < 5",               //Contion pour que l'action soit affiché
"_this distance _target < 5",               //Condition pour que l'action progresse
{},                                         //Le code exécuté quand l'action commence
{},//Le code exécuté quand l'action est entrain de progressé
{ExecVM "atm_airdrop\atm_airdrop.sqf"},     //Le code exécuté dans l'action est terminée
{},                                         //Le code exécuté si l'action est intérrompu
[],                                         //Arguments passed to the scripts as _this select 3
1,                                          //Durée de l'action
_Ordre,                                     //Prioritée | Priority (ordre on the screen)
false,                                      //Supprimer quand l'action est terminé ? | if remove after down action
false                                       //Montrer dans l'etat d'inconscience ? | 
] remoteExec ["BIS_fnc_holdActionAdd",0,_UnObjet];   //-2 : Tous le monde sauf le serveur

In conclusion, this code is executed only by the server. however, the action is visible to all clients. Clients only see the last action that the server performs. locally all works properly. if the code is executed by the client, then yes it works, but each client will generate duplicates.

Share this post


Link to post
Share on other sites

As addAction, therei stwo different scopes:

- where the hold action is visible

- where the generated code fires.

 

The generated code is executed locally: EL (like for addAction).  That means on PC of the caller.

If you want to spawn something remoteExec on server. If you want to broadcast a hint remoteexec everywhere...

 

By the way, remoteExec the "BIS_fnc_holdActionAdd" itself is OK for spawned object (as example 2 in BIKI). If this object already exists from editor, you just have to use the function (as example 1 in BIKI). (damaging object and respawning it is something more difficult).

This way you'll avoid a tremendous file of remoteExec for nuts (and probably not performed as you like on heavy scenario).

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Hello,

Ok so if I understood correctly,
I have to do something like that?

 

params ["_UnObjet","_Message","_Ordre"];
_Message = format ["<t color='#353531'>H</t>|%1",_Message];
_Icone = "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa";

[_UnObjet,                                  //L'objet sur lequel l'action est attachée
_Message,                                 //Titre de l'action
_Icone,                                     //L'icone qui est affiché à l'écran
_Icone,                                     //L'icone de progression
"_this distance _target < 5",                         //Contion pour que l'action soit affiché
"_this distance _target < 5",                         //Condition pour que l'action progresse
{},                                         //Le code exécuté quand l'action commence
{},//Le code exécuté quand l'action est entrain de progressé
{ExecVM "atm_airdrop\atm_airdrop.sqf"},                                         //Le code exécuté dans l'action est terminée
{},                                         //Le code exécuté si l'action est intérrompu
[],                                         //Arguments passed to the scripts as _this select 3
1,                                          //Durée de l'action
_Ordre,                                          //Prioritée
false,                                       //Supprimer quand l'action est terminé ?
false                                       //Montrer dans l'attat d'inconscience ?
] spawn BIS_fnc_holdActionAdd;

I'm trying and I'm coming back to you

thz

Share this post


Link to post
Share on other sites

Mmm. ExecVM "atm_airdrop\atm_airdrop.sqf" should probably run on server:  "atm_airdrop\atm_airdrop.sqf" remoteExec ["execVM",2]

 

  • Confused 1

Share this post


Link to post
Share on other sites

Hello bro,

There, it does not work anymore in multiplayer
My problem is not a problem of execution of the addaction but a problem of display of the action in multi-players.

 

  if (TerminalArsenal) then {[hds_terminal] call fnc_EstUnArsenal};
  if (TerminalDeSaute) then {[hds_terminal,"Insertion",7] call fnc_EstUnTerminalDeSaut};
  if (TerminalDeGroupeIA) then {[hds_terminal,"Groupe:R.O.S",1] call fnc_EstUnTerminalDeGroupeIA};
  if (TerminalDeGroupeIARHS) then {[hds_terminal,"Groupe:R.H.S",2] call fnc_EstUnTerminalDeGroupeIARHS};
  if (TerminalDeGroupeIAPERSO) then {[hds_terminal,"Groupe:H.D.S",3] call fnc_EstUnTerminalDeGroupePERSO};
  if (TerminalMission) then {[hds_terminal,"Mission|Suivante",4] call fnc_EstunTerminalMission};
  if (TerminalDeNeutralisation) then {[hds_terminal,"Basculer Civil|Militaire",5] call fnc_JoueursNeutre};
  if (TerminalDeSauvegarde) then {[hds_terminal,"Sauver|Equipement",6] call fnc_SauvegardeEquipements};
  if (TerminalDeDebugger) then {[hds_terminal,"Nettoyer|Mission",5] call fnc_EstUnDebugger};

 

params ["_UnObjet","_Message","_Ordre"];
_Message = format ["<t color='#353531'>H</t>|%1",_Message];
_Icone = "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa";

[_UnObjet,                                  //L'objet sur lequel l'action est attachée
_Message,                                 //Titre de l'action
_Icone,                                     //L'icone qui est affiché à l'écran
_Icone,                                     //L'icone de progression
"_this distance _target < 5",                         //Contion pour que l'action soit affiché
"_this distance _target < 5",                         //Condition pour que l'action progresse
{},                                         //Le code exécuté quand l'action commence
{},//Le code exécuté quand l'action est entrain de progressé
{ExecVM "atm_airdrop\atm_airdrop.sqf"},                                         //Le code exécuté dans l'action est terminée
{},                                         //Le code exécuté si l'action est intérrompu
[],                                         //Arguments passed to the scripts as _this select 3
1,                                          //Durée de l'action
_Ordre,                                          //Prioritée
false,                                       //Supprimer quand l'action est terminé ?
false                                       //Montrer dans l'attat d'inconscience ?
] spawn BIS_fnc_holdActionAdd;

 

Share this post


Link to post
Share on other sites

Hello,

To explain my problem.I have a list of actions that appears on one and only one object. In test mode. all actions are present in the list.
But in multiplayer, there is only one action that appears.
As if all other actions were crashing each other.

Share this post


Link to post
Share on other sites

Hello,

One of my words made me cogitate
 

Quote

 

As addAction, therei stwo different scopes:

- where the hold action is visible

- where the generated code fires.

 

 

I managed to solve my problem with the following logic.
Code executed when connecting a client to the client's local.
I just add this behavior to my functions too. :don11:

 

  if (TerminalArsenal) then {[hds_terminal] remoteExecCall ["fnc_EstUnArsenal",player]};
  if (TerminalDeSaute) then {[hds_terminal,"Insertion"] remoteExecCall ["fnc_EstUnTerminalDeSaut",player]};
  if (TerminalDeGroupeIA) then {[hds_terminal,"Groupe:R.O.S"] remoteExecCall ["fnc_EstUnTerminalDeGroupeIA",player]};
  if (TerminalDeGroupeIARHS) then {[hds_terminal,"Groupe:R.H.S"] remoteExecCall ["fnc_EstUnTerminalDeGroupeIARHS",player]};
  if (TerminalDeGroupeIAPERSO) then {[hds_terminal,"Groupe:H.D.S"] remoteExecCall ["fnc_EstUnTerminalDeGroupePERSO",player]};
  if (TerminalMission) then {[hds_terminal,"Mission|Suivante"] remoteExecCall ["fnc_EstunTerminalMission",player]};
  if (TerminalDeNeutralisation) then {[hds_terminal,"Basculer Civil|Militaire"] remoteExecCall ["fnc_JoueursNeutre",player]};
  if (TerminalDeSauvegarde) then {[hds_terminal,"Sauver|Equipement"] remoteExecCall ["fnc_SauvegardeEquipements",player]};
  if (TerminalDeDebugger) then {[hds_terminal,"Nettoyer|Mission"] remoteExecCall ["fnc_EstUnDebugger",player]};
params ["_UnObjet","_Message","_Ordre"];
_Message = format ["<t color='#353531'>H</t>|%1",_Message];
_Icone = "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa";

[_UnObjet,                                 //L'objet sur lequel l'action est attachée
_Message,                                 //Titre de l'action
_Icone,                                     //L'icone qui est affiché à l'écran
_Icone,                                     //L'icone de progression
"_this distance _target < 6",                         //Contion pour que l'action soit affiché
"_this distance _target < 6",                         //Condition pour que l'action progresse
{},                                         //Le code exécuté quand l'action commence
{},     //Le code exécuté quand l'action est entrain de progressé
{
/* _LeGroupeOperation = [([getpos _caller,50,100,1,0,60,0] call BIS_fnc_findSafePos),CampsRenfortAllie,4] call BIS_fnc_spawnGroup;

[hdssoldat_01,[missionNamespace,"hdssoldat_01"]] call BIS_fnc_saveInventory;
[hdssoldat_02,[missionNamespace,"hdssoldat_02"]] call BIS_fnc_saveInventory;
[hdssoldat_03,[missionNamespace,"hdssoldat_03"]] call BIS_fnc_saveInventory;

{[_x,[missionNamespace,(selectrandom ["hdssoldat_01","hdssoldat_02","hdssoldat_03"])]] call BIS_fnc_loadInventory} foreach Units _LeGroupeOperation;

(Units _LeGroupeOperation) join (group _caller); */
_mafenetre = createDialog "hds_recrutement";
},                                         //Le code exécuté dans l'action est terminée
{},                                         //Le code exécuté si l'action est intérrompu
[],                                         //Arguments passed to the scripts as _this select 3
1,                                          //Durée de l'action
_Ordre,                                          //Prioritée
false,                                       //Supprimer quand l'action est terminé ?
false                                       //Montrer dans l'attat d'inconscience ?
] remoteexeccall ["BIS_fnc_holdActionAdd",player,_UnObjet];

thank you for helping me

  • Like 3

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

×