Page MenuHomeFeedback Tracker

Broken behavior with scripted synchronized supports
New, WishlistPublic

Description

SynchronizeObjectsAdd & synchronizeObjectsRemove allow to manage supports within a script.
I tried several times to link the fact a player takes a kind of backpack to his ability for calling support.
Say if player has a "B_AssaultPack_Kerry" then he gets a mortar support.
If he drops this backpack, support is removed.
This works very well at the first time but, after you drop the backpack, there is no more way to recover the support when grabbing again the backpack.

NB: the loop take/drop works well. The problem isn't here. The syncs work well also. Just, support is not available.

Details

Legacy ID
1127596082
Severity
None
Resolution
Open
Reproducibility
Always
Category
Ground Support
Steps To Reproduce

In editor, place a player, name it;
place a backpack ("B_AssaultPack_Kerry" in this example);
place a mortar unit, name it;
place a module requester, name it (say request);
place a module provider artillery, name it (say arty);

synchronize request to player and arty to mortar, let unsynchronized arty and request as scriptable sync.

in init.sqf (or elsewhere), add this loop:
player spawn {
_unit = _this;
while {true} do {
sleep 2;

  waituntil {sleep 2; (backpack _unit == "B_AssaultPack_Kerry")};
    if !( request in synchronizedObjects arty) then {
     arty synchronizeObjectsAdd [request];
     hint "support added";
    };

   waituntil {sleep 2; (backpack _unit != "B_AssaultPack_Kerry")};
   request synchronizeObjectsRemove [arty];
    hint "support removed";
    };

};

The hints are toggling while taking/dropping this backpack but you can get the support only the first time you take the backpack.

Additional Information

Same problem in SP/MP missions than preview, with any type of support (virtual or not) any kind (CAS, artillery, drop...).

You can verify the syncs with a hint format ["%1", synchronizedObjects request] or arty. Syncs are all present with backpack and arty-request truly removed after dropping the backpack.
So, commands seem to work but support is no more in menu.

Event Timeline

PiepMGI edited Steps To Reproduce. (Show Details)Jan 1 2016, 8:40 AM
PiepMGI edited Additional Information. (Show Details)
PiepMGI set Category to Ground Support.
PiepMGI set Reproducibility to Always.
PiepMGI set Severity to None.
PiepMGI set Resolution to Open.
PiepMGI set Legacy ID to 1127596082.May 8 2016, 1:24 PM
PiepMGI added a subscriber: PiepMGI.

Hi, any news about this issue?

Ok, gents, I found a solution:
Glancing at FSM's artillery module, I catch the idea to refresh this variable: BIS_SUPP_refreshMainWindow;

Just added a line in my script and it works fine:

player spawn {
_unit = _this;
while {true} do {
sleep 2;

  waituntil {sleep 2; (backpack _unit == "B_AssaultPack_Kerry")};
    if !( request in synchronizedObjects arty) then {

     arty synchronizeObjectsAdd [request];

     call BIS_SUPP_refreshMainWindow; 
     hint "support added";
    };

   waituntil {sleep 2; (backpack _unit != "B_AssaultPack_Kerry")};
   request synchronizeObjectsRemove [arty];
    hint "support removed";
    };

}

Could you just make this possibility persistent in your FSM module?
Thanks