Home   Help Search Login Register  

Author Topic: Airstrikes  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline GreenTerror

  • Members
  • *
Airstrikes
« on: 21 Jun 2008, 01:55:03 »
I am terrible at scripts, just started with them a month or two ago but I was reading MR Murrays guide and tried to use mando_bombs and this is what I cranked out. I guess I'll post it here, even though its has to do with mando bombs, because Its thrown together with other stuff. I'm not getting any error message at the top of the screen, but no plane spawns. I have gamelogics planespawn and pilotspawn set up in the editor. Its probably a completely non-functional script so could someone just point me in the right direction? Thanks a lot.

bombsaway.sqs

; Predefined airstrike script
; create the guy and plane
_PlaneG = createGroup WEST;
_plane = createVehicle ["AV8B", getpos planespawn,[], 0, "FLY"];
_plane setpos [(getPos _plane select 0),(getPos _plane select 1),900] ;
_pilot = "SoldierWPilot" createUnit [getPos pilotspawn, _PlaneG, "P1=this"];
_Plane setVelocity [100,0,0] ;
~0.4
P1 moveinDriver _plane;
P1 setDamage 0;
P1 action ["gear_up", vehicle P1] ;
_plane flyinHeight 150;
_plane setSpeedMode "full";


;mando bombs (R_H is just a test target)
_scr = [P1, R_H, false, [2, 0, -2],150]execVM"mando_bombs\mando_bombs.sqf";


;check to see if bomb run complete
#missioninprogress

if (scriptDone _scr) then goto "flyway";

~5

goto "missioninprogress"

;head toward deletion area
#flyaway

_plane flyInHeight 300;
P1 doMove getPos despawn;

#CHECK

~5

? (_plane distance despawn) < 1000 : goto "END";

goto "CHECK"

;delete `em
#END
deletevehicle _plane;
deleteGroup _PlaneG
deletevehicle P1;
exit

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Airstrikes
« Reply #1 on: 21 Jun 2008, 02:02:06 »

   Parameters:
      Plane: plane that will perform the attack (you may use any plane type).
      Target: object or coordinates.     
      Radio: true/false, if true, planet's pilot will radio attack status (radio messages are not broadcasted).
      Bomb position: relative to the launcher in model coordinates. Second bomb will be spawed inverting the first element.
                     For example [2, 0, -2] will spawn first bomb 2m to the right of the plane and 2m below.
      Altitude over target: the flying altitude of the plane, between 100 and 300
      Bomb class: optional, if provided, the class of a bomb type ammo or the special type "SADARM". "Bo_GBU12_LGB" is used by default.


_scr = [P1, R_H, false, [2, 0, -2],150]execVM"mando_bombs\mando_bombs.sqf";
P1 is a pilot, not a plane.

So

_scr = [_plane, R_H, false, [2, 0, -2],150]execVM"mando_bombs\mando_bombs.sqf";

Offline GreenTerror

  • Members
  • *
Re: Airstrikes [Solved]
« Reply #2 on: 21 Jun 2008, 02:37:53 »
That got it, thanks. It's funny that that mistake made the plane not even spawn. but it works now. Thanks again. Solved