Jump to content
Tankbuster

create an alternative to tactical ping

Recommended Posts

I'm fed up with troubleshooting this. It's invaluable when it works and frustrating when, for no apparent reason, it doesn't. I suspect some problems are caused by 3rd party launchers and who knows what else.

 

So I want to craft a scripted alternative. I've done some brainstorming but written no code yet and wanted to get more input before pressing on.

 

For the player sending the TP, they should be using a rangefinder in optics mode and the laser be turned on. Pressing a key then activates the TP system.

It resolves where the player is looking and if they aren't looking into the sky, it works out where on the terrain they are looking (by getting their laserTarget object).

 

It then renders an icon both on their game UI and their map at that position. Players that are in their squad have an icon drawn on their map if they have one and on their UI if they have tactical glasses.

 

I'm expecting to use screentoWorld and its family of commands. It must be MP compatible, TP makes the most sense there.

 

Any thoughts?

Share this post


Link to post
Share on other sites

The tactical ping seems to me OK if you allow some HUD settings in difficulties.

See this page showHUD

 

Anyway, I did something similar in my mods: marker on map where player is looking at in gunner view (optic/laser designator, turret).

It's easy with MEH "map" but you can trigger it pressing a key as well and draw3D an helper like Sign_Arrow_Large_F  (See also drawIcon3D)

I'm using lineIntersectsSurfaces and positionCameraToWorld.... for positioning.

 

 

 

 

Share this post


Link to post
Share on other sites

All my shownhud returns are true - my theory is that it's more related to server difficulty.

 

Yes, positioncameratoworld and lineintersects are going to do the heavy lifting, I'm sure. I'd want it to work on both map and world GUI, so a TP on the map will also render on the world GUI, and vice versa. Not sure if that's practical yet.. still working through it in my mind.

Share this post


Link to post
Share on other sites

Whats wrong with using the point mechanic from ACE? Not a huge fan of tactical ping either.

Share this post


Link to post
Share on other sites

I don't use ACE.

Anyway, I've created a scripted alternative which I'm going to test with my players soon.

  • Like 2

Share this post


Link to post
Share on other sites

Hey Tank, would you be comfortable to share the script. I'm at my ends trying to troubleshoot tactical ping, which just stopped working 😞

 

Share this post


Link to post
Share on other sites

Yes, no problem. Give me a day or so.

Share this post


Link to post
Share on other sites
		if ( ((lifeState player) in ["HEALTHY", "INJURED"]) and ((( (str currentWeapon player) find "Laserdesignator" ) > -1) or (((UAVControl (getConnectedUAV player)) #1) isEqualTo "GUNNER") ) and (cameraView isEqualTo "GUNNER")) then
		{
			authtacping = screenToWorld [0.5,0.5];// << [x,y,0] unless resized
			publicVariable "authtacping";
			nul = remoteExec ["tky_fnc_showauthtacping", 0,false];
		};
		if ( ((lifeState player) in ["HEALTHY", "INJURED"]) and (visibleMap)) then
		{
			authtacping = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld getMousePosition;// << [x,y]
			authtacping pushBack 0;
			publicVariable "authtacping";
			nul = remoteExec ["tky_fnc_showauthtacping", 0 ,false];
		};
/*
	Code written by Tankbuster
*/
#include "..\..\..\includes.sqf"
__tky_starts
scriptName "fn_showauthtacping";
private ["_atpmapip","_atpuiid"];
private _st =  serverTime;
private _ctrl = findDisplay 12 displayCtrl 51;
if ((goggles player in ["G_Goggles_VR", "G_Combat_Goggles_tna_F", "G_Combat", "G_Balaclava_TI_G_tna_F","G_Balaclava_TI_G_blk_F","G_Tactical_Clear", "G_Tactical_Black"]) and ((lifeState player) in ["HEALTHY", "INJURED"])) then
{// player has received a ping, has the required gear and is alive      
    // draw ping icon on map
    _atpmapip = _ctrl ctrlAddEventHandler ["Draw", 
    {
        _this select 0 drawIcon [
            "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca", // Custom images can also be used: getMissionPath "\myFolder\myIcon.paa"
            [0.73,0.24,0.11,1],
            authtacping,
            64,
            64,
            0,
            "Ping",
            2,
            0.03,
            "TahomaB",
            "center"
        ];
    }];
    // draw ping icon on game ui
    _atpuiid = addMissionEventHandler ["draw3D", 
    {
        drawIcon3D 
        [
            "\a3\Ui_f\data\IGUI\Cfg\TacticalPing\TacticalPingDefault_ca",
            [0.73,0.24,0.11,1],
            authtacping,
            1.5,
            1.5,
            0,
            "Ping",
            true,
            0.03,
            "TahomaB",
            "center",
            true,
            0,
            -0.06
        ];
    }];
    playsound ["TacticalPing4",false];
    sleep 30;
    removeMissionEventHandler ["draw3D", _atpuiid];
    _ctrl ctrlRemoveEventHandler ["Draw", _atpmapip]; 
};

Note this is ripped straight out of my mission. You'll need to remove code that is specific to it.

 

  • Like 2

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

×