From Savage Game Design Wiki
Revision as of 12:47, 16 September 2019 by vn>Unknown user
Jump to navigation
Jump to search
Description
/*
Author: Wyqer, veteran29
Date: 2019-08-10
Description:
Creates tracks marker on unit position.
Parameter(s):
_unit - Unit leaving tracks [OBJECT, defaults to objNull]
Returns:
Created marker [STRING]
*/
params [
["_unit", objNull, [objNull]]
];
private _marker = createMarker [format ["vn_tracks_%1", time], _unit];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [VN_MS_TRACKS_A, VN_MS_TRACKS_B];
// base direction on velocity,
// this makes handling of the units going backwards or sideways easier
private _travelDir = (velocity _unit select 0) atan2 (velocity _unit select 1);
// atan2 is -180-180, normalise to 0-360
_travelDir = ((_travelDir % 360) + 360) % 360;
_marker setMarkerDir _travelDir;
// hide marker if not debug
#ifndef VN_DEBUG
_marker setMarkerAlpha 0;
#endif
_marker
(Placeholder description extracted from the function header by LM_exportFunctionsToWiki.sqf)
Syntax
- Syntax
- [] call vn_ms_fnc_tracker_tracksCreate;
- Return value
- Nothing
Examples
- Example 1
-