Jump to content

Recommended Posts

Hi guys.  I figured out how to make footprints permanent (will post solution on another thread).  But I would like to only make them permanent on certain surfaces, and will use the SurfaceType command to control when footprints will be made permanent.

 

Is there a list of all Arma 3 SurfaceTypes somewhere?  It will save me from having to walk every where (and on different maps) to record the various surface types.

Share this post


Link to post
Share on other sites

I don't think they're listed in config mate.

 

You can use something like this to find them on a per map basis (in init.sqf/debug console or similar):

fnc_getSurfaceTypes = {
    params ["_upper","_step"];
    private _types = [];
    for "_xValue" from 0 to _upper step _step do {
        for "_yValue" from 0 to _upper step _step do {
            _types pushBackUnique (surfaceType [_xValue,_yValue])
        };
    };
    _types
};
{
    diag_log _x
} forEach ([10000,100] call fnc_getSurfaceTypes);

 

Obv, change the _upper value and _step to suit your map :)

  • Like 2

Share this post


Link to post
Share on other sites

Hey, as I needed them once, I looked up some of my code and found those:

Spoiler

"#GdtDead",
"#GdtGrassTall",
"#GdtGrassShort",
"#GdtRedDirt",
"#GdtMud",
"#GdtRedDirt",
"#GdtSoil",
"#GdtThorn",
"#GdtBeach",
"#GdtGrassGreen",
"#GdtGrassDry",
"#GdtMarsh",
"#GdtDirt",
"#GdtGrassWild"

 

 

 

Later I realized that there is basically an unlimited amount of surfeces, as modders can create their own. So you will find different surfacetypes on nearly every map. 

Might be wise to define where the footprints are not shown and include everything else. :-/

  • Like 1

Share this post


Link to post
Share on other sites

@crewt Thanks man.  I found those also just by skipping around the map.  And there's some more with "Stratis" in the name, etc. 

27 minutes ago, crewt said:

Might be wise to define where the footprints are not shown and include everything else. :-/

Good advice.  There are different types on different maps.  I think I plan to use this as the list of surfaces to NOT show prints.

"GdtAsphalt","#GdtStratisForestPine","#GdtStratisConcrete","#GdtStratisRocky","#GdtRocks"

Instead of exact name matches, I may exclude if these substrings are found in the name:  "Asphalt","Rock","Concrete".  That should get better matches on name variants found on different maps.

 

It won't be perfect, but if someone wants to dial it in for a specific map, they can edit the list of names in the script.

Share this post


Link to post
Share on other sites

You could predefine a list in a Global Var and, add names,  I imagine something like:

Spoiler

TheArr = ["GdtAsphalt","#GdtStratisForestPine","#GdtStratisConcrete","#GdtStratisRocky","#GdtRocks"];

if !(surfaceType _unit in  TheArr) then {
	private _a = ["City", "Asphalt", "Road", "Street", "concrete", "rock"] apply {toLower _x};
	for "_i" from 0 to count _a -1 do {
		_idx = (toLower (surfaceType _unit)) find (_a select _i);
		if (_idx != -1) then {
			TheArr pushBackUnique (surfaceType _unit);
		};
	};
};

 

 

Not sure what method you use, most likely a onFrameHandler? You could integrate this easily.

I haven't tested this in any way, so...  might be a typo in there somewhere.

 

 

Ha! better Idea. Save it in the Namespace, so you can take the list with you from mission to mission! Was a shitty piece of code anywhere, would have run every time when you could leave a footprint.

Just a secound...

 

Edited by crewt
Better Idea

Share this post


Link to post
Share on other sites

This would be better, if this works with you

TheArr = profileNamespace getVariable ["XX_TheArr", ["GdtAsphalt","#GdtStratisForestPine","#GdtStratisConcrete","#GdtStratisRocky","#GdtRocks"]];
BadArr = profileNamespace getVariable ["XX_BadArr", []];
if (surfaceType _unit in BadArr ) then {
	// Make stuff
} else {
	if (surfaceType in TheArr) then{
		private _a = ["City", "Asphalt", "Road", "Street", "concrete", "rock"] apply {toLower _x};
		for "_i" from 0 to count _a -1 do {
			_idx = (toLower (surfaceType _unit)) find (_a select _i);
			if (_idx != -1) then {
				TheArr pushBackUnique (surfaceType _unit);
				profileNamespace setVariable ["XX_TheArr", TheArr, false];
			} else { 
				BadArr  pushBackUnique (surfaceType _unit)
				profileNamespace setVariable ["XX_BadArr", BadArr, false];
				// Make stuff -> Would be nice if this would be a fnc
			};
		};
	};
};

Global Var isn't a must, depends on your preferences. and where this stuff runs. 

  • Like 1

Share this post


Link to post
Share on other sites

@crewt: Beautiful!  Clever to build up the bad array as new ones encountered (more efficient).  Thanks for making my life easier! 

 

And I didn't know about the very useful pushBackUnique variant of the pushBack command, so thanks for that too!

  • 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

×