diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index 602ee41d33..ac0b82147c 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -98,4 +98,4 @@ class CfgVehicles { MACRO_ADDITEM(ACE_SpraypaintGreen,5); }; }; -}; \ No newline at end of file +}; diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index fdb2cd08b0..81758f8bdb 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: Position ASL * 1: Vector dir and up - * 2: Colour of the tag (valid colours are black, red, green and blue) + * 2: Colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * 3: Object it should be tied too * * Return Value: @@ -19,15 +19,21 @@ #include "script_component.hpp" -params ["_tagPosASL", "_vectorDirAndUp", "_color", "_object"]; -TRACE_4("createTag:", _tagPosASL, _vectorDirAndUp, _color, _object); +params ["_tagPosASL", "_vectorDirAndUp", "_colorTexture", "_object"]; +TRACE_4("createTag:",_tagPosASL,_vectorDirAndUp,_colorTexture,_object); -if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { - ACE_LOGERROR_1("%1 is not a valid tag colour.", _color); +private _customTexture = [true, false] select (_colorTexture find ".paa" == -1); + +if (!_customTexture && {!((toLower _colorTexture) in ["black", "red", "green", "blue"])}) exitWith { + ACE_LOGERROR_1("%1 is not a valid tag colour.",_colorTexture); }; private _tag = "UserTexture1m_F" createVehicle [0,0,0]; -_tag setObjectTextureGlobal [0, '\z\ace\addons\tagging\UI\tags\' + _color + '\' + str (floor (random 3)) + '.paa']; +if (!_customTexture) then { + _tag setObjectTextureGlobal [0, "\z\ace\addons\tagging\UI\tags\" + _colorTexture + "\" + str (floor (random 3)) + ".paa"]; +} else { + _tag setObjectTextureGlobal [0, _colorTexture]; +}; _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; diff --git a/addons/tagging/functions/fnc_tagDirection.sqf b/addons/tagging/functions/fnc_tagDirection.sqf index 2c03d97fd0..9dbb65f68e 100644 --- a/addons/tagging/functions/fnc_tagDirection.sqf +++ b/addons/tagging/functions/fnc_tagDirection.sqf @@ -6,7 +6,7 @@ * 0: Unit * 1: Start position ASL * 2: End position ASL - * 3: The colour of the tag (valid colours are black, red, green and blue) + * 3: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * Sucess @@ -19,7 +19,7 @@ #include "script_component.hpp" -params ["_unit", "_startPosASL", "_endPosASL", "_color"]; +params ["_unit", "_startPosASL", "_endPosASL", "_colorTexture"]; // Check for intersections below the unit private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, _unit, objNull, true, 1, "GEOM", "FIRE"]; @@ -102,6 +102,6 @@ _unit playActionNow "PutDown"; // Tell the server to create the tag and handle its destruction ["createTag", _this] call EFUNC(common,serverEvent); -}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _color, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); +}, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _colorTexture, _object, _unit], 0.6] call EFUNC(common,waitAndExecute); true diff --git a/addons/tagging/functions/fnc_tagGround.sqf b/addons/tagging/functions/fnc_tagGround.sqf index fa8d1795bf..dee9261e1e 100644 --- a/addons/tagging/functions/fnc_tagGround.sqf +++ b/addons/tagging/functions/fnc_tagGround.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue) + * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * None @@ -17,9 +17,9 @@ #include "script_component.hpp" -params ["_unit", "_color"]; +params ["_unit", "_colorTexture"]; private _startPosASL = getPosASL _unit; private _endPosASL = _startPosASL vectorAdd [0, 0, -2] vectorAdd eyeDirection _unit; -[_unit, _startPosASL, _endPosASL, _color] call FUNC(tagDirection); +[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection); diff --git a/addons/tagging/functions/fnc_tagWall.sqf b/addons/tagging/functions/fnc_tagWall.sqf index 9b6485f4e8..85b24f7b92 100644 --- a/addons/tagging/functions/fnc_tagWall.sqf +++ b/addons/tagging/functions/fnc_tagWall.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Unit - * 1: The colour of the tag (valid colours are black, red, green and blue) + * 1: The colour of the tag (valid colours are black, red, green and blue or full path to custom texture) * * Return Value: * None @@ -17,11 +17,11 @@ #include "script_component.hpp" -params ["_unit", "_color"]; +params ["_unit", "_colorTexture"]; private _startPosASL = eyePos _unit; private _cameraPosASL = AGLToASL positionCameraToWorld [0, 0, 0]; private _cameraDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff _cameraPosASL; private _endPosASL = _startPosASL vectorAdd (_cameraDir vectorMultiply 2.5); -[_unit, _startPosASL, _endPosASL, _color] call FUNC(tagDirection); +[_unit, _startPosASL, _endPosASL, _colorTexture] call FUNC(tagDirection);