Jump to content

Recommended Posts

Hey, I was wondering if there was a way to do the following regarding artillery.

1. Disable the Artillery Computer on one or multiple artillery systems, but keep it on, on other vehicles.
2. Only allow artillery to fire on the mode: "Close" or "medium" if done via Artillery Computer (or any way really).

 

~PingWing

Share this post


Link to post
Share on other sites

Or simply, in init field of the artillery:

0 = this spawn {

  while {alive _this} do {

    waitUntil {sleep 0.5; gunner _this == player};

    enableEngineArtillery false;

    waitUntil {sleep 0.5; gunner _this != player};

    enableEngineArtillery true;

  };

};

NB: EHs are fine but more complicated for nuts, here, imho. getIn getout EH are not sufficient. You need also to check the moveToTurret action.

 

if you want to apply an EH, try instead:

inGameUISetEventHandler ["action", "if ((_this select 0) in [art1,art2,art3] && (_this select 3) == 'ArtilleryComputer') then {true}"];

This will disable the action (still visible in menu) for art1 art2 art3.

  • Like 1

Share this post


Link to post
Share on other sites

If you want to limit the artillery mode to the default one (example close for Scorcher):

 

0 = [] spawn {
    disableSerialization;
    private "_ctrl";
    while {true} do {
      waitUntil {_ctrl = ({ if !(isNull (_x displayCtrl 510)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 510; !isNull _ctrl};
      ctrlEnable [510, false];
      waitUntil {isNull _ctrl};

  };

};

This way, the artillery mode is greyed. Player can't choose a different setting than "close".

 

You can limit the choice to "close" or "medium" (the 2 first ranges) by:

0 = [] spawn {
    disableSerialization;
    private "_ctrl";
    while {true} do {
        waitUntil {_ctrl = ({ if !(isNull (_x displayCtrl 510)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 510; !isNull _ctrl};
        while {!isnull _ctrl} do {
          if (lbCurSel _ctrl > 1) then {_ctrl lbSetCurSel 0};
          sleep 0.2;
        };
    };

};

Any attempt to choose farther range will resume to close one.

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

pierremgi :D I use this script, the last one, it is very good I love it, but I would like to have Ai in my PvP mission, but you can request artillery of Ai and they shoot where you want, I would like to disable the possibility for players requesting artillery from the Ai group units

 

I know this script does this, but then the players can't use the artillery computer :( what do i do ?

enableEngineArtillery true;

 

Share this post


Link to post
Share on other sites

Can you tell, how did you acquire the control id 510? What is a workflow to find out what is what in UI?

On 12/26/2017 at 4:53 AM, pierremgi said:

If you want to limit the artillery mode to the default one (example close for Scorcher):

 

0 = [] spawn {
    disableSerialization;
    private "_ctrl";
    while {true} do {
      waitUntil {_ctrl = ({ if !(isNull (_x displayCtrl 510)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 510; !isNull _ctrl};
      ctrlEnable [510, false];
      waitUntil {isNull _ctrl};

  };

};

This way, the artillery mode is greyed. Player can't choose a different setting than "close".

 

You can limit the choice to "close" or "medium" (the 2 first ranges) by:

0 = [] spawn {
    disableSerialization;
    private "_ctrl";
    while {true} do {
        waitUntil {_ctrl = ({ if !(isNull (_x displayCtrl 510)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 510; !isNull _ctrl};
        while {!isnull _ctrl} do {
          if (lbCurSel _ctrl > 1) then {_ctrl lbSetCurSel 0};
          sleep 0.2;
        };
    };

};

Any attempt to choose farther range will resume to close one.

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

×