Home   Help Search Login Register  

Author Topic: Mando Bombs and Mando Air Support (ACCEPTED)  (Read 93213 times)

0 Members and 2 Guests are viewing this topic.

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #150 on: 15 Jul 2008, 13:55:20 »
Hey Mandoble, i wonder if you could help me (again)  :)

I'm using the airsupport console in some of my missions, I'm also using Norrin's revive script.  For example I have one player in the team as the JTAC (FAC) lets say the unit is named S2. On mission start the console works fine, but once the player has died and revived he cannot access the console.  I could have the action added back to the player by adding it to the revive system somewhere, but i want to ask this question first.

I'm just wondering if there is a small script that i could run that would detect when the player gets killed, then add the action back to the unit when they respawn?

Any help would be appreciated.

Regards

Andy.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #151 on: 15 Jul 2008, 13:59:49 »
Something like this :blink: :blink: :blink: ???
Code: [Select]
while {true} do
{
   waitUntil {alive player};
   player addAction blah blah blah ;
   waitUntil {!alive player};
};

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #152 on: 15 Jul 2008, 14:13:28 »
Dont I feel stupid  :D

Cheers mate, much appreciated.

EDIT1: Another quick question Mandoble, I have mando missile active in a mission using the air console, is there a variable that I can use to disable the attack helicopters from using mando missiles?
« Last Edit: 15 Jul 2008, 16:36:12 by Shadow.D. ^BOB^ »

Offline monty67t

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #153 on: 15 Jul 2008, 17:20:41 »
Mando, the script you provided to detect when a player has the laser designator and gives them access to the air support console worked perfectly. Thanks so much for the help, you are a true asset to the community.

EDIT: Mando, could you please explain to me how to make the recon camera have night vision? Your help is greatly appreciated.
« Last Edit: 15 Jul 2008, 18:09:10 by monty67t »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #154 on: 15 Jul 2008, 20:28:33 »
is there a variable that I can use to disable the attack helicopters from using mando missiles?

Nope, you need to modify the script:
Open mando_airsupportdlg.sqf and look for CALL_CAS_CA:, then pagedown twice and you will find:
Code: [Select]
               if (!isNil "mando_missile_init") then
               {
                  _plane SetVehicleInit "res = [This] execVM ""mando_missiles\units\mando_onlymandoones.sqf""";
                  [_plane, 800, 1, 5, false, 0]execVM"mando_missiles\units\mando_missileecm.sqf";
                  processInitCommands;

                  [_plane, 0, ["LandVehicle", "Ship"], 2, 500, 2500, 4, [5, 2, -4], 50, 0, mando_support_enemy_sides, false, false, true, true]exec"mando_missiles\units\attackers\mando_basicag_unit.sqs";
                  Sleep 0.5;
               };
Just coment the mando_basicag_unit.sqs line.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #155 on: 17 Jul 2008, 23:42:44 »
EDIT: Mando, could you please explain to me how to make the recon camera have night vision? Your help is greatly appreciated.

What he said.  :D

Thanx for the replies, as always.

Luke
Pesky Human!!
Wort Wort Wort.

Offline bwoodhouse

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #156 on: 18 Jul 2008, 18:26:41 »
Mando,

First of all, thank you for all your hard work on a magnificent script.  It is purely spectacular.

I am using your script suite and have a need to add a function.  I would like to add an abort button to the Air Support Console that would cause the plane to bypass your mando_bombs script and follow egress instructions.

I have added the "abort" button to your airsupportdlg.h file, and have it performing functions via the "case "CALL_ABORT"" function in your airsupportdlg doing simple things, like to display: MSG: Mission Aborted. 

What I am struggling with is getting this to pass a vairable to Mando_Bombs that tells the plane to not drop the bomb and proceed with egress insturctions.

I am fairly new, but can decifer most of your script with enough time.  Any help you may be able to provide will be awesome.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #157 on: 18 Jul 2008, 18:37:28 »
Look at the bomb run sequence:
Code: [Select]
               _scr = [_plane, _targetpos, false, mando_airsupport_bomb_pos, _extrah + mando_airsupport_bomb_alt+(_this select 0)*10,mando_airsupport_bomb_type]execVM"mando_bombs\mando_bombs.sqf";
           
               while {!scriptDone _scr} do
               {
                  Sleep 0.5;
                  (mando_support_display displayCtrl (23905 + (_this select 0))) ctrlSetText format["Plane %1: %2", (_this select 0)+1, (_plane getVariable "mando_airsupport_state")];
                  (mando_support_display displayCtrl 23909) ctrlEnable false;
                  (mando_support_display displayCtrl 23910) ctrlEnable false;
                  (mando_support_display displayCtrl 23912) ctrlSetText "Bomb run mission in progress";
               };
               _plane doMove _spawnpos;
The plane will egress when the script is done (_src is the handler). You may use terminate command to terminate an sqf script at will. You will need to put something inside the <while {!scriptDone _scr} do> loop to check for abort condition, and, if present, then terminate the mando_bombs.sqf being executed (terminate _scr).

With the Close Air Support more than one attack might be executed (by default each plane will execute two), so you need to keep the value of the global used to abort set to true until all the attacks are aborded, or just exit the loop that looks for targets also if abort condition is met.

Just curious, why would you want to abort a bomb run? friendly fire?

Offline bwoodhouse

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #158 on: 18 Jul 2008, 18:43:44 »
This is great, I will play with it and see what I can do.  The main reason for the abort is friendly fire in MP missions.

What I have right now is;
Code: [Select]
               _scr = [_plane, _targetpos, false, mando_airsupport_bomb_pos, _extrah + mando_airsupport_bomb_alt+(_this select 0)*10,mando_airsupport_bomb_type]execVM"mando_bombs\mando_bombs.sqf";
          
               while {!scriptDone _scr} do
               {
                  Sleep 0.5;
                  (mando_support_display displayCtrl (23905 + (_this select 0))) ctrlSetText format["Plane %1: %2", (_this select 0)+1, (_plane getVariable "mando_airsupport_state")];
                  (mando_support_display displayCtrl 23909) ctrlEnable false;
                  (mando_support_display displayCtrl 23910) ctrlEnable false;
                  (mando_support_display displayCtrl 23912) ctrlSetText "Bomb run mission in progress";
                  if (_abort == 1) then
                      {(terminate _scr)
                      };
};
               _plane doMove _spawnpos;


and then under my button I have

Code: [Select]
case "CALL_ABORT"':
{
              _abort = 1;
              (mando_support_display displayCtrl 23942) ctrlSetTest "MSG: Mission Aborted";
};

Im sure that you can see that this is not working for me, but I dont know why.  It seems as if when I press the abort button, it is not passing that variable to the previous code. 

Thanks for any help you can give in advance. 
« Last Edit: 18 Jul 2008, 19:06:07 by bwoodhouse »

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #159 on: 18 Jul 2008, 19:11:45 »
I'm back again Mandoble  :D

Just a quick question, can i predefine the destination for the evac chopper in the editor?

Although its pretty clear in my mission that people need to return to base, its better safe than sorry.

Thx for all your help.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #160 on: 18 Jul 2008, 19:36:41 »
bwoodhouse, your _abort variable is local, which means it will not works you need to use a global, for example named bwoodhouse_abort. Also you need to set this variable to 0 or to false somwhere, else the next bomb run mission would be aborted too.


Shadow.D. , the destination is defined by the position of mk_mandoevac_WEST, mk_mandoevac_EAST, etc marker for each side. If the marker doesnt exist, the script creates it at [0,0,0]. You may change it by some default coords per side, just look for:
Code: [Select]
      _marker_name = format["mk_mandoevac_%1", side player];
      if (getMarkerColor format["mk_mandoevac_%1", side player] == "") then
      {
         createMarkerLocal [format["mk_mandoevac_%1", side player], [0,0,0]];
         format["mk_mandoevac_%1", side player] setMarkerTypeLocal "End";
         format["mk_mandoevac_%1", side player] setMarkerColorLocal "ColorGreen";
         format["mk_mandoevac_%1", side player] setMarkerSizeLocal [0.35, 0.35];
         format["mk_mandoevac_%1", side player] setMarkerTextLocal "Evac dest";
      };
and change the [0,0,0] by your predefined pos. Note that this marker is local, you may create it even before calling any mando bombs script and place it in the predefined position but the players would be always able to change its position from the console. If you want to avoid this look for:
Code: [Select]
   case "onMapClick":
   {
      if (((_this select 1) select 1) == 0) then
      {
         if ((_this select 1) select 4) then
         {
            _marker_name = format["mk_mandoevac_%1", side player];
            if (getMarkerColor _marker_name == "") then

And remove what is inside the          if ((_this select 1) select 4) then which places the evac marked there where the used clicked over the map.

Offline bwoodhouse

  • Members
  • *
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #161 on: 18 Jul 2008, 20:26:03 »
Mandoble,
I got it to work perfect, thank you for the help.

I have two new questions for you.  First of all, with the evac script, I would like the helicopter to hover above the evac lz until I tell it to land (so that I can get an LZ brief sent to the pilot then have it land). 

Second,
I've been playing around with entering a 8 digit map grid instead of clicking on the map.  I created a button diaglog and using <_grid = ctrltext _control#> I am able to capture the user input but it is a string and not a number.  I also used <_tgt_grid = toArray (_grid)> which converts _grid to a workable array.  Do you know how to convert the user typed map grid into [x,y] grid coord that the game will understand?

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #162 on: 18 Jul 2008, 20:39:32 »
EDIT: Mando, could you please explain to me how to make the recon camera have night vision? Your help is greatly appreciated.

How would one go about that?

Thanx for the replies, as always.

Luke
Pesky Human!!
Wort Wort Wort.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #163 on: 18 Jul 2008, 20:42:05 »
bwoodhouse, look for:
Code: [Select]
            [_group, 1] setWaypointStatements ["true", "if (!(surfaceIsWater getPos (vehicle this))) then{(vehicle this) flyinHeight 0;(vehicle this) land ""LAND""}else{(vehicle this) flyinHeight 3}"];
            [_group, 1] showWaypoint "NEVER";
            [_group, 1] setWaypointSpeed "FULL";
            [_group, 1] setWaypointType "MOVE";
            _wp = _group addWaypoint [_targetpos, 0];
            [_group, 2] setWaypointStatements ["count crew (vehicle this) > 1", "(vehicle this) flyinHeight 100"];
            [_group, 2] setWaypointTimeout [25, 25, 25];
            [_group, 2] showWaypoint "NEVER";
            [_group, 2] setWaypointSpeed "FULL";
            [_group, 2] setWaypointType "MOVE";
this is where the initial WPs and actions of the evac chopper are set. The first waypoint:
Code: [Select]
            [_group, 1] setWaypointStatements ["true", "if (!(surfaceIsWater getPos (vehicle this))) then{(vehicle this) flyinHeight 0;(vehicle this) land ""LAND""}else{(vehicle this) flyinHeight 3}"];
Has the condition set to "true", you may change this so that it proceed with the landing only when some global is set to true.

About your second question, AFAIK there is not command to convert grid coords to map coords, there are a set of functions and scripts available in the ED that do the opposite, you may use them and apply reverse engineering.



Luke, I think you already asked for that yesterday, isnt it? If I found a way I'll post it.

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: Mando Bombs and Mando Air Support (ACCEPTED)
« Reply #164 on: 18 Jul 2008, 20:44:41 »
My apologies,

Felt like a week ago. :D

BTW, tried the regenerating planes, nothing happened.

How would you go about scripting it?

Thanx for the replies, as always.

Luke
Pesky Human!!
Wort Wort Wort.