Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,759
Reply with quote  #1 
Download:
Spawn Plane move to waypoints attack

Quoted Tay

Quote:
Have the planes already on the map in some far corner already flying, then have a trigger to send them to the battle when ready.

Just incase they might be in the air for some time before they are called put this in the planes init box:-

nul = this spawn { waitUntil { if !(alive _this) exitWith {}; if (fuel _this < 0.25) then { _this setFuel 1 }; false } };


This will stop the plane running out of fuel before its called.

So place plane in editor in some far corner (or group of planes) have a move waypoint in same far corner, place another seek and destroy way point on the target. then create the trigger with what ever activation suits you, but it will need to be a switch type. then synchronize the trigger to the 1st move waypoint.
The plane will circle the 1st waypoint until the trigger conditions are met, then the plane will fly to the seek and destroy waypoint, and hopefully attack the target.

The above command comes from http://www.kylania.com/ex/ a bunch of very useful commands and scripts made for Arma, but most work with Ironfront too [smile]


airsupport.sqf
by Simon 1279

// Requires function module
//To run this script you have to place an invisible helipad somewhere on the map and name it: Planestart
//add a unit and in its init write: act1 = this addAction ["Call Air Support", "airsupport.sqf"];

player removeaction act1;
while {(count (waypoints _PlaneGroup)) > 1} do
{
 deleteWaypoint ((waypoints _PlaneGroup) select 1);
};

titleText ["Click on the map to set planes attack point","PLAIN DOWN"];

_mkruru = createMarker ["attack",getPos Planestart]; //Planestart is the name of an invisible helipad
_mkruru setMarkerColor "colorRed";
_mkruru setMarkerShape "icon";
_mkruru setMarkerSize [1,1];
_mkruru setMarkerDir random -10 +random 20;
_mkruru setMarkerType "destroy";
openMap [true, true];
mapclick = false;
onMapSingleClick {"attack" setMarkerPos _pos;
mapclick = true;
};
waituntil {mapclick};
onMapSingleClick "";
titleText ["","PLAIN DOWN"];

sleep 2;

_spawnPosX = _spawnPosition select 0;
_spawnPosY = _spawnPosition select 1;
_spawnPosZ = _spawnPosition select 2;

_planespawnpos1 = [_spawnPosX - 1000, _spawnPosY - 500, _spawnPosZ + 300];
_pilotspawnpos1 = [_spawnPosX - 1000, _spawnPosY - 500, _spawnPosZ + 300];
_planespawnpos2 = [_spawnPosX - 1100, _spawnPosY - 600, _spawnPosZ + 350];
_pilotspawnpos2 = [_spawnPosX - 1100, _spawnPosY - 600, _spawnPosZ + 350];


_PlaneGroup = creategroup WEST;
_plane1 = createVehicle ["LIB_FW190F8",_planespawnpos1,[], 0, "FLY"];           //plane class name goes here
_plane1 setPos [(getPos _plane1 select 0),(getPos _plane1 select 1),300] ;     
_plane2 = createVehicle ["LIB_FW190F8",_planespawnpos2,[], 0, "FLY"];              //plane class name goes here
_plane2 setPos [(getPos _plane2 select 0),(getPos _plane2 select 1),350] ;     
_plngrppLeader = "LIB_GER_pilot" createUnit [getMarkerPos "attack", _PlaneGroup, "plaleader=this"];    //pilot class name goes here
_p2 = "LIB_GER_pilot" createUnit [getMarkerPos "attack", _PlaneGroup, "pla2=this"];                    //pilot class name goes here

_plane1 setVelocity [100,0,0] ;
_plane2 setVelocity [100,0,0] ;

plaleader moveinDriver _plane1;
plaleader setDamage 0;
plaleader action ["gear_up", vehicle plaleader] ;

pla2 moveinDriver _plane2;
pla2 setDamage 0;
pla2 action ["gear_up", vehicle pla2] ;


_pos1 = getMarkerPos "attack";
_way1 = (_PlaneGroup) addWaypoint [_pos1, 0];
[_PlaneGroup, 0] setWaypointType "SAD";
[_PlaneGroup, 0] setWaypointBehaviour "COMBAT";
[_PlaneGroup, 0] setWaypointCombatMode "RED";
[_PlaneGroup, 0] setWaypointSpeed "FULL";
[_PlaneGroup, 0] setWaypointFormation "DIAMOND";
openMap [false, false];

_mkrend = createMarker ["attackend",getPos Planestart]; //Planestart is the name of an invisible helipad
_mkrend setMarkerColor "Default";
_mkrend setMarkerShape "icon";
_mkrend setMarkerSize [1,1];
_mkrend setMarkerDir random -10 +random 20;
_mkrend setMarkerType "Empty";

Sleep 200;

_Endpos = getMarkerPos "attackend";
_way2 = (_PlaneGroup) addWaypoint [_Endpos, 1];
[_PlaneGroup, 1] setWaypointType "MOVE";
[_PlaneGroup, 1] setWaypointBehaviour "CARELESS";
[_PlaneGroup, 1] setWaypointCombatMode "BLUE";
[_PlaneGroup, 1] setWaypointSpeed "FULL";
[_PlaneGroup, 1] setWaypointFormation "DIAMOND";

Sleep 120;

deleteVehicle _plane1; //this deletes planes
deleteVehicle _plane2; //this deletes planes

deleteGroup _PlaneGroup; //this deletes plane group
deleteVehicle plaleader; //this deletes plane pilot
deleteVehicle pla2; //this deletes plane pilot
deleteMarker "attack";
deleteMarker "attackend";

sleep 1;

act1 = player addAction ["Call Air Support", "airsupport.sqf"];



__________________
0
Gunter Severloh

Avatar / Picture

Admin
Registered:
Posts: 2,759
Reply with quote  #2 
Script is now hosted on the MR, comes with a readme.
Link added to the first post for download.

__________________
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.