Jump to content
Sign in to follow this  
amphib

Laser Designator Mission

Recommended Posts

I'm having some problems making a mission that requires the use of a laser designator.

The main idea:

I'm making a mission where the players will create an observation post and wait for an enemy leader to arrive in his car. There will be some traffic in the target zone, so the players will have to manually identify the actual target (the leader). When identified, the target location should be laser marked and a missile (or artillery shell) should be called and hit the designated target a few seconds later. I'm thinking something like the movie "Clear and present danger".

My problem is that i only want to call in a single blast at the laser designated target. Not an entire barrage and no visible aircraft etc, just a large explosion at the laser designated position, and only available to be called once. The mission is also being created as a "clean" mission, requiring only A2 and OA, so preferrably no mods at all (well, CBA is acceptable, but nothing else).

Does anyone have a script available for something like that? Either for the complete action or just for getting the position of the laser designator's target?

Share this post


Link to post
Share on other sites

init.sqf

// Add the action to the player. The action will only be available if the player's current weapon is a laser designator and he's looking through it. . .
_id = player addAction ["Request Projectile","projectile.sqf",nil,1,false,true,"","(currentWeapon _target == 'Laserdesignator') && {cameraView == 'GUNNER'}"];

projectile.sqf

if ( !isNull (laserTarget (_this select 1)) && {!isNull cursorTarget} ) then { // If the (_this select 1) has the laser turned on and is looking at an actual object then . . .
(_this select 1) removeAction (_this select 2); // Remove the action
(_this select 1) sideChat "Requesting long range support . . .";
sleep 3;
[side (_this select 1),"HQ"] sideChat "Round incoming on the target. . .";
sleep 5;
_projectile = createVehicle ["BOMB_CLASSNAME", getPosATL (laserTarget (_this select 1)) , [], 0, "FLY"]; // Create the bomb at the laser target
[side (_this select 1),"HQ"] sideChat "Splash. . .";

} else { // Else display a message . . .

if ( !isNull (laserTarget (_this select 1)) ) then {// if the laser is turned on then . . .
	hint "You have the laser turned on, but no valid target.";
} else { // else . . .
	hint "You don't have the laser turned on.";
};
};

---------- Post added at 18:14 ---------- Previous post was at 17:56 ----------

Which could also be shortened if you want to do it in a different style. Here, the action will not appear at all if the laser isn't turned on and you aren't looking at a valid object.

init.sqf

_id = player addAction ["Request Projectile","projectile.sqf",nil,1,false,true,"","!isNull (laserTarget _target) && {!isNull cursorTarget}"];

projectile.sqf

(_this select 1) removeAction (_this select 2); // Remove the action
player sideChat "Requesting long range support . . .";
sleep 3;
[side (_this select 1),"HQ"] sideChat "Round incoming on the target. . .";
sleep 5;
_projectile = createVehicle ["BOMB_CLASSNAME", getPosATL (laserTarget (_this select 1)) , [], 0, "FLY"]; // Create the bomb at the laser target
[side (_this select 1),"HQ"] sideChat "Splash. . .";

Edited by Iceman77

Share this post


Link to post
Share on other sites

Works like a charm, thank you very much!

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
Sign in to follow this  

×