Page MenuHomeFeedback Tracker

[Feature Request] New scripting command family: createTrack, setTrackParams, getTrackParams, enableTracks and forceTracks
New, NormalPublic

Description

I know this is a wee bit out there but throwing this into the pile anyway:

The game creates foot prints and vehicle prints when soldiers/vehicles traverse terrain.
For soldiers the footprints are a type of #mark and for ground vehicles #track.
Seems to be so that these marks/tracks are created only if there is a player within some hard-coded distance from the traversing object, and when they are created they are deleted after some hard-coded time.
#track and #mark objects can not be created with createVehicle.

Sometimes you might want to take advantage of the fact that the tracks exist in the game but the above described limitations cause all scripted solutions to not too satisfactory results. This BIF thread details the problems with current scripted solutions:
https://forums.bohemia.net/forums/topic/204710-solved-how-to-create-footprints/

The gist is that if you want for example permanent foot prints for tracking purposes you can do it but it's limited by the fact that tracks/marks are not created if player is too far away. Footprint objects can be created with createSimpleObject but they always appear black instead of having the "chameleon" effect of fitting the surface they're created on.
Vehicle tracks you can't even create at all. Seems that the ground vehicle track is the same for all vehicles, just resized by the engine based on something(?)

So, a request for a new dedicated command set:

_imprint = createTrack [<type>, <pos>, <dir>, <params>];
  • <type>: either #mark or #track
  • <pos>: positionATL(?), maybe only take x and y into account and always create at ground level
  • <dir>: azimuth (up vector would automatically be surface normal)
  • <params>: These would differ according to the type:
    • type #mark: [<model>, <color>, <max age>]
      • <model>: model. String, for vanilla game model "footstep_l.p3d" or "footstep_r.p3d" that would suffice but for mod/CDLC content a path to model would be required.
      • <color>: Optional. Would override the game's default coloring-by-surface functionality, RGBA
      • <max age>: Optional. In seconds, -1 (default) would mean permanent
    • type #track: [<width>, <length>, <texture>, <color>, <max age>]
      • <width> and <length>: Would define the size of the track (based on the assumption that these are resized by the engine based on some criteria)
      • <texture>: Optional. Path to texture file used for the track, if not given (empty "") default ground vehicle track used.
      • <color>: Optional. Would override the default coloring-by-surface functionality, RGBA. Default game functionality if empty []
      • <max age>: Optional. Time in seconds before deletion, -1 (default) would mean permanent

then for modifying the given track params later

_imprint setTrackParams <params>
  • the params would of course be the same as above, depending on the type of the track.

For getting those set params

_params = getTrackParams _imprint;
  • Would return the given track's params array in format of [<type>, <params]
<vehicle> enableTracks <bool> or <vehicle> enableTracks [<tracks (bool)>, <bend clutter (bool)>, <bend time>]
<vehicle> forceTracks <bool> or <vehicle> forceTracks [<tracks (bool)>, <bend clutter (bool)>]
  • enableTracks: true and given vehicle would leave tracks on the ground (default game behaviour) or false for leaving no tracks. Additional syntax for also controlling if the given vehicle should have the ability to bend clutter as it travels through them (like soldier crawling), and how long the clutter should stay bent (in seconds), -1 would be the default time
  • forceTracks: true would force given vehicle to leave tracks even if no player near (regardles of tracksEnabled state), false would be default game behaviour. Additional syntax same as with above enableTracks; additional boolean for forcing the vehicle to bend clutter as it travels through them even if no player near. The bent clutter would stay bent permanently.
  • getters for these would be useful of course, so enabledTracks <veh> and forcedTracks <veh>, would either return bool or an array depending on the syntax used to enable/force tracks
//pseudo code:
_woundedNme enableTracks [false, true]; //no default tracks made, bend clutter

private _i = 0;
private _blood = [];

//while target moves create footprints that get red if steps in own blood
while {alive _woundedNme && {!(_woundedNme getVariable ["thisCaptured", false])}} do {
    private  _tmpPos = getPosWorld _woundedNme;

    if (random 100 <= 50) then {
        private _foo = createSimpleObject ["BloodSplatter_01_Small_New_F", AGLToASL (_woundedNme getPos [random 0.5, random 360]));
        _foo setDir (getDir _woundedNme);
        _blood pushBack (getPos _foo);
    };

    if (_tmpPos distance _lastPos >1) then {
        _footStep = createTrack [
            "#mark",
            _woundedNme modelToWorldVisual ([[0,0.2,0],[0.2,0,0]] select (_i %2)),
            getDir _woundedNme,
            [
                "footstep_" + (["l", "r"] select (_i %2)),
                if (1 - (((_woundedNme distance (_blood # (count _blood - 1)) / 10) max 0) > 0.2) then {
                    [0.541176, 0.027451, 0.027451, 1 - ((_woundedNme distance (_blood # (count _blood - 1)) / 10) max 0]
                } else {
                    []
                },
                -1
            ]
        ];
 
	_i = _i + 1;
	_lastPos = _tmpPos;
    };
    sleep (1/((vectorMagnitude velocity _woundedNme) max 1));
};

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Engine

Event Timeline

h- created this task.Aug 6 2020, 5:26 PM
DrSova added a subscriber: DrSova.Sep 4 2020, 3:14 PM