Jump to content
Sign in to follow this  
Leopard20

Create High Command modules via script

Recommended Posts

Hi.

How can I create high command modules via scripts? If I use this, the game will show an error:

"HighCommand" createVehicleLocal [0, 0, 0];

I think it's because the module needs to be created prior to running the mission and be synced to the player.

Does anyone know how to fix this?

Share this post


Link to post
Share on other sites

I think you can't. This feature seems to be initialized at start.

 

I just tried to place modules and add links by script: working but error message while no link at start.

  • Like 1

Share this post


Link to post
Share on other sites

try this;

 

if (count (allMissionObjects "HighCommand") == 0) then {

    _Group = createGroup (sideLogic);

    _Group_HC_C = _Group createUnit ["HighCommand", [0, 0, 0], [], 0, "NONE"];

    _Group_HC_S = _Group createUnit ["HighCommandSubordinate", [0, 0, 0], [], 0, "NONE"];

    player synchronizeObjectsAdd [_Group_HC_C];

    _Group_HC_C synchronizeObjectsAdd [_Group_HC_S];

};

  • Like 2

Share this post


Link to post
Share on other sites

Yes! don't forget to link something on _group_HC_S :

leader grp1 synchronizeObjectsAdd [_Group_HC_S]; // for example

  • Like 1

Share this post


Link to post
Share on other sites

Take it with a grain of salt as I can not test this, but from my struggle with HC I remember that this setup is not MP compatible. BIS HC is not very flexible and has to be created in the mission setup.

  • Like 1

Share this post


Link to post
Share on other sites

@pierremgi, @gizz46
I actually figured out something similar to gizz46's method a couple of minutes later after posting this thread. The number of errors has reduced of course (only one error at the beginning - before I got errors every time I switched to HC). I think it'll do for now! Thank you both for your input.

@mad_cheese
I should definitely test it in MP too. Thanks for the heads up!

Although when I saw the errors first I figured maybe I should use duda's High Command module that he uses in his AIC mod (with permission of course!). If you think it's better I could actually go through with it!
 

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
Sign in to follow this  

×