Jump to content
gmangnall

synchronizeObjectsAdd

Recommended Posts

I am trying to use the synchronizeObjectsAdd command to add a high command subordinate group and cannot get it to work. I have used the command with adding support units - but it seems there is a bug there to. With the support units if you add artillery at the start - and then try to add another support e.g. CAS. the CAS does not become available until you call in the artillery - so it seems that the support module re-initialises. I suspect that same is happening with high command i.e. the command IS working - but as it does not re-initialise then I cannot see the subordinate units. Anyone got any ideas?

Share this post


Link to post
Share on other sites

The High Command module doesn't monitor for changes in synchronizations.  Some modules do I suspect, but it's one that doesn't.

 

You could reinitialize by running its "hc.sqf" script again, but then it creates a new instance of the "hc_local.sqf" running on each connected machine.  Each would end up with multiple instances of the same script running.  You'd want to terminate each one's old instance for the new instance, or better yet not have a new instance run if their old instance still works proper following HC reinit.

 

The HC module initializes by an eventhandler rather than function.  The eventhandler execVM's the HC script.

What I've done in the past (A2) was copied the HC module scripts to mission folder, and changed the scripts in mission folder to suit the need.  Then placed a regular Game Logic on map and have it run revised HC eventhandler code, running the mission scripts instead of the core scripts.  Basically the game logic acts as a surrogate HC, to run the scripts from mission folder instead of core.  In that way I could get HC's Radio Waypoints and F5 "assign missions" menu to work in Warfare.

Just tested, and this method does still work with A3, syncing HC Subordinate modules to the Game Logic.

 

If you should choose that route, look for where the BIS_fnc_MP call is made to execVM hc_local.sqf on each machine.

- Not running a new instance on clients:  You'd want to control the call, only having it occur on first initialization, not on subsequent ones.

- Or, running a new instance on clients:  You'd have to work out a way to terminate the old instance on clients.  Somehow find a way to capture and store each script handle, and issue them a terminate command when the new instance is going to run.

 

But running a game logic as surrogate with mission scripts, you'll have much freedom to make the different HC scripts work as you intend.

Share this post


Link to post
Share on other sites

No need to sync a new subordinate module to the HC. Just add the group to MARTA and add HC group to highcommander unit. Something like...

[ player, "MARTA_REVEAL", [_group], false, true ] call BIS_fnc_variableSpaceAdd;
player hcSetGroup [ _group ];

 

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

×