Jump to content

Delicious

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Delicious

  1. I saw a couple of posts about airstrikes so I decided I will share how I got them to work via radio (or any other trigger). The creation of this could be a bit more automatic via good scripting (instead of my Magpie stealing spree from all over the internet), and any suggestions on improving this are more than welcome. Anyway, let's start with an example of an A10 dropping LGBs on an Afghan wedding. 1. Make sure you create a Game Logic Module "Functions", and that it is synchronized to you, the player! 2. Create some locations, in this case three, from the units menu (Game Logic->Locations-> Location). Name one 'spawnaten', name another 'aten1' and the final one 'aten2'. Place the 'spawnaten' location where you would like to spawn your A10, place the 'aten1' location above the target (in this case, our ill-fated wedding), and finally, place the 'aten2' location above the area where you would like to dismiss your aircraft. 3. In the Initialization field for the 'spawnaten' location type this setPos [(getPos spawnaten select 0), (getPos spawnaten select 1), (getPos spawnaten select 2)+100] This is necessary to make sure the plane has some altitude when it has spawned, in this case 100. 4. We now need to spawn the A10 and get it to fly to where we want to, points aten1 and then aten2. Make a 'spawnaten.sqs' script in your mission directory and fill it in with: _tank = [position spawnaten, 0, "A10", side player] call BIS_fnc_spawnVehicle _a10 = creategroup WEST; _tank join grpNull _tank join _a10 _wp = _a10 addWaypoint [position aten1, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _a10 addWaypoint [position aten2, 0]; _wp setWaypointType "DISMISS"; _wp setWaypointSpeed "FULL"; [_a10,1] setWaypointStatements ["true", "bombsaway=1"]; This script tells the game to spawn an A10 and tells it to move to location 'aten1' and tells it to dismiss itself (via ejection) at location 'aten2'. This script has an A10 spawning, flying above our target zone, and then being dismissed out of view. But of course, to win hearts and minds we cannot simply pass the target, we must drop bombs! 5. Create a trigger above the target area. Make it sufficiently big so you know our aircraft will pass through it. Set the activation to anybody present. In this Condition field type: bombsaway==1 and in the On Act. field type [] exec "bombs.sqs"; bombdir = 90; This will execute a bombs.sqs script, and set the bomb direction to 90. Set this value to the direction the plane is flying towards. 0 is North, 90 is East, etc. Just preview the mission once you have your aircraft flying and with a little experimentation you will have a good direction for the bombs. As an example, if your aircraft is flying to the south over the target area, set the bomb direction to 180 [deg] so that the bombs dropping will not look stupid. 6. As you can see we are calling a script named bombs.sqs to do the dirty work. Here is an example of the bombs.sqs: _direction getDir tank _bomb1 = "Bo_GBU12_LGB" createVehicle (position boomarea1) _bomb1 setPos [(getPos boomarea1 select 0), (getPos boomarea1 select 1), (getPos boomarea1 select 2) +100] _bomb1 setDir bombdir ~1 _bomb2 = "Bo_GBU12_LGB" createVehicle (position boomarea2) _bomb2 setPos [(getPos boomarea2 select 0) , (getPos boomarea2 select 1), (getPos boomarea2 select 2) +100] _bomb2 setDir bombdir ~1 _bomb3 = "Bo_GBU12_LGB" createVehicle (position boomarea3) _bomb3 setPos [(getPos boomarea3 select 0), (getPos boomarea3 select 1), (getPos boomarea3 select 2) +100] _bomb3 setDir bombdir This drops three separate bombs on three separate locations, and spawns them in at 100 altitude. Another example: _bomb1 = "Bo_GBU12_LGB" createVehicle (position boomarea) _bomb1 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100] _bomb1 setDir bombdir ~1 _bomb2 = "Bo_GBU12_LGB" createVehicle (position boomarea) _bomb2 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100] _bomb2 setDir bombdir ~1 _bomb3 = "Bo_GBU12_LGB" createVehicle (position boomarea) _bomb3 setPos [(getPos boomarea select 0) +(random 100) - (random 100), (getPos boomarea select 1) +(random 100) - (random 100), (getPos boomarea select 2) +100] _bomb3 setDir bombdir In the first example, three bombs are dropped on three locations: 'boomarea1', 'boomarea2', and 'boomarea3'. In the second example, three bombs are dropped on one location: 'boomarea', but each bomb has a random spread. You can easily add more bombs to these scripts. 7. Depending on the script you are using you need to assign some extra locations to your maps, either 'boomarea' or 'boomarea1', 'boomarea2', and 'boomarea3'. Place the locations on or around our target (so around location 'aten1') 8. We're now ready to call in our airstrike. This can be done by creating a radio Alpha trigger for example. Create a trigger, set the activation to Radio Alpha, make sure Condition is set to "this", and set On Act. to: [] exec "spawnaten.sqs" 9. Call in the airstrike via Radio Alpha channel on the map. "POPOV21, we're going to jail!" This is far from perfect, but hey, at least it works. It's quite easily changable to different aircraft etc. I'm sure there are far better ways to do this, so please give any suggestions. Bonus cmissile.sqs: _bomb1 = "Chukar" createVehicle (position missilearea) _bomb1 setPos [(getPos missilearea select 0), (getPos missilearea select 1), (getPos missilearea select 2) +250] Set a location named "missilearea" on a house and place [] exec cmissile.sqs in a trigger On Act. field to drop cruise missiles from an alitude of 250 on it. Kaboom! But after the explosion, the Chukar missile is still there as a wreck. If anyone knows how to remove it, please tell me! Edit: Before I forget, it is important to place civilians in the target area for maximum winning of hearts and minds!
  2. Does anyone know how to create the clickable links in the briefing now? For example: in the briefing it says "Take the town of Stary Sobor" and the Stary Sobor part is clickable and centers on the correct map location. Cheers.
  3. You can create a trigger that runs task1 setTaskState "SUCCEEDED" in the on act. field when you have completed a certain condition, such as killing an officer or something.
  4. I agree, but this has a pretty airplane flying past :)
  5. Can anyone point out what's wrong with this? _tank = [position spawnaten, 0, "M1A1", side player] call BIS_fnc_spawnVehicle _tankgroup = creategroup USMC; // Or perhaps this should be WEST _tank join grpNull _tank join _tankgroup _wp = _tankgroup addWaypoint [position wp1, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _tankgroup addWaypoint [position wp2, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _tankgroup addWaypoint [position wp3, 0]; _wp setWaypointType "DISMISS"; _wp setWaypointSpeed "FULL"; This works just fine: _grp1 = [position spawnaten, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup _wp = _grp1 addWaypoint [position wp1, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp1 addWaypoint [position wp2, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; _wp = _grp1 addWaypoint [position wp3, 0]; _wp setWaypointType "DISMISS"; _wp setWaypointSpeed "FULL";
  6. You are always declaring west in the _grp line? Or this might be correct... Anyway, another question. If I have created a group using "BIS_fnc_spawnGroup" I can boss them around just fine and get them to go to waypoints. However, if I spawn a vehicle using "BIS_fnc_spawnVehicle" it will not go to assigned waypoints. I suspect this has to do with the fact it's not grouped or something. So I tried assigning my vehicle to a group, but that didn't work unfortunately. Anyone have any suggestions?
  7. Is it also possible to assign these groups tasks/waypoints? After for example spawning a tank [position spawntank, 0, "M1A1", side player] call BIS_fnc_spawnVehicle or spawning a group [position spawngroup, side player, (configFile >> "CfgGroups" >> "West" >> "USMC" >> "Infantry" >> "USMC_InfSquad")] call BIS_fnc_spawnGroup I would like to be able to get the tank or the group to move though assigned waypoints or to use "moveTo" to get them to move somewhere? The function probably assigns them names when they spawn but I wouldn't know where to find this... Anyway, thanks for the info in this thread :)
  8. Hello, I would like to have an aircraft fly over a specified area (and then be dismissed via waypoint) but I'm unsure how to go about this. I currently have a number of aircraft, each with a waypoint near them synchronized to a trigger, so that when I activate the trigger the aircraft flies past my position and then is dismissed at a later waypoint. Instead of synchronizing the trigger to the first waypoint however, I would prefer to only bring the aircraft into actual existence after the trigger has been activated. This prevents the aircraft hanging around the initial waypoint and getting into all sorts of trouble on their own :) Any help would be appreciated! :) Delicious
×