Jump to content
Thorimus

Script to spawn datalinked laser

Recommended Posts

I have been trying for some time to make a script that creates a datalinked laser on a marker placed by a player, for use with the new Mk41 VLS. I have had no sucess and was wondering if any of the script wizards here have any ideas. My attempts consisted mainly of spawning a drone and using doTarget to get it to point at the helipad, and the fire command to fire its laser. doTarget didn't work at all and I couldn't find the "muzzle" value for the fire command.

The script is intended to be used as zeus on a dedicated multiplayer server where I have no access to creating .sqf files, only running pieces of script in-game.

 

Share this post


Link to post
Share on other sites

Found this in the dev branch feedback thread:

west reportRemoteTarget [TARGET, 3600];
TARGET confirmSensorTarget [west, true];
VLS fireAtTarget [TARGET, "weapon_vls_01"];

It seems to work, but I haven't tested it extensively.

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites
On 8/24/2018 at 4:20 PM, stanhope said:

Found this in the dev branch feedback thread:


west reportRemoteTarget [TARGET, 3600];
TARGET confirmSensorTarget [west, true];
VLS fireAtTarget [TARGET, "weapon_vls_01"];

It seems to work, but I haven't tested it extensively.

Thank you, that should work for making the laser datalinked. Any ideas on spawning the laser itself? E: or is the laser superfluous and would it be able to fire on any datalinked target like this?

Share this post


Link to post
Share on other sites

I tested it as well....and it seam to fire on target autonomously. Perhaps after I did change it to 

west reportRemoteTarget [laserTarget player, 8000]; 
laserTarget player confirmSensorTarget [west, true]; 
VLS fireAtTarget [laserTarget player, "weapon_vls_01"];

since I was looking for a way to give cruise support with a handheld laser designator to a infantry squad.

Problem is is keeping on firing until you have the laser on.

How do I make it fire just one missile?

 

here it is the hole script, which is been called by a radio trigger:

Spoiler


playSound3D ["A3\dubbing_f\modules\supports\artillery_request.ogg", player];

//Detecting if player has laser

_laser = laserTarget player;
if(isNull _laser) then
{
    _wPos = screenToWorld [0.5,0.5];
}
else
{
    _wPos = _laser;
};

_target = objNull;

if (isNull _laser) then
    {
    _nearObj = nearestObjects ["Car","Tank","Man","Building"];

    if(count _nearObj == 0) then
    {
        strikeAllowed = false;
        hint "Strike not allowed...USE LASER DESIGNATOR";
    }
    else
    {
        strikeAllowed = true;
        //Selecting random target
        _target = selectRandom _nearObj;
		playSound3D ["A3\dubbing_f\modules\supports\artillery_acknowledged.ogg", player];
    };
}
else
{
    strikeAllowed = true;
	playSound3D ["A3\dubbing_f\modules\supports\artillery_acknowledged.ogg", player];
	hint "CRUISE MISSILE INBOUND..KEEP LASER ON TARGET!!!!";
};
sleep 5;

if(strikeAllowed) then
{
_VLStarget = laserTarget player; 

west reportRemoteTarget [_VLStarget, 8000]; 
_VLStarget confirmSensorTarget [west, true]; 
VLS fireAtTarget [_VLStarget, "weapon_vls_01"];

};



 

 (VLS is the name of the turret)

I also try with 

[VLS, "weapon_vls_01"] call BIS_fnc_fire; // fires missiles

and

VLS doArtilleryFire [_VLStarget, "weapon_vls_01", 1];

or
VLS doWatch _VLStarget;
waitUntil {VLS aimedAtTarget [_VLStarget] > 0}; VLS fireAtTarget [_VLStarget];

with no luck....

Any suggestion?

Share this post


Link to post
Share on other sites

@stanhope Thanks, that works to fire on a helipad that has been named "TARGET". How do I get this pad to spawn on the position of a marker? using the getMarkerPos command like so:

TARGET = createVehicle ["Land_HelipadCivil_F" ,getMarkerPos "FireMission", [],0,"CAN_COLLIDE"];

just spawns the pad at 0,0,0. 

Share this post


Link to post
Share on other sites
19 minutes ago, Thorimus said:

@stanhope Thanks, that works to fire on a helipad that has been named "TARGET". How do I get this pad to spawn on the position of a marker? using the getMarkerPos command like so:


TARGET = createVehicle ["Land_HelipadCivil_F" ,getMarkerPos "FireMission", [],0,"CAN_COLLIDE"];

just spawns the pad at 0,0,0. 

I got it working with 

if(strikeAllowed) then
{
TARGET = createVehicle ["Land_HelipadEmpty_F" ,getPos laserTarget player, [],0,"CAN_COLLIDE"]; 

west reportRemoteTarget [TARGET, 3600]; 
TARGET confirmSensorTarget [west, true]; 
VLS fireAtTarget [TARGET, "weapon_vls_01"];

};

 

  • Thanks 1

Share this post


Link to post
Share on other sites
24 minutes ago, zagor64bz said:

I got it working with 


if(strikeAllowed) then
{
TARGET = createVehicle ["Land_HelipadEmpty_F" ,getPos laserTarget player, [],0,"CAN_COLLIDE"]; 

west reportRemoteTarget [TARGET, 3600]; 
TARGET confirmSensorTarget [west, true]; 
VLS fireAtTarget [TARGET, "weapon_vls_01"];

};

 

Thanks, but that makes it fire on a player's laser. I need it to fire on a marker.

 

EDIT: New thread: 

 

Share this post


Link to post
Share on other sites
2 hours ago, Thorimus said:

Thanks, but that makes it fire on a player's laser. I need it to fire on a marker.

Sorry mate....

  • Haha 1

Share this post


Link to post
Share on other sites
On 8/24/2018 at 4:20 PM, stanhope said:

Found this in the dev branch feedback thread:


west reportRemoteTarget [TARGET, 3600];
TARGET confirmSensorTarget [west, true];
VLS fireAtTarget [TARGET, "weapon_vls_01"];

It seems to work, but I haven't tested it extensively.

I tried to put this into the Activation box of a trigger and it gave me a Boolean error. Did I do something wrong ?

Share this post


Link to post
Share on other sites

wrap it inside 0 = [] spawn {<code here>}

  • Like 1

Share this post


Link to post
Share on other sites

Or at least:

0 = VLS fireAtTarget [TARGET, "weapon_vls_01"];

The two other commands are returning nothing.

  • Like 1

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

×