Skip to content

Instantly share code, notes, and snippets.

Preface

The goal of this reference page is to give a detailed description of how the surface and clutter tecnologies work, as well as a start to finish guide on the implementation of clutter.

A common notation used below is Root >> Deeper >> EvenDeeper, which is used as shorthand to express nested classes, like so

class Root
{
	class Deeper
	{
colourBlindModes = [
"Normal",
"Protanopia",
"Protanomaly",
"Deuteranopia",
"Deuteranomaly",
"Tritanopia",
"Tritanomaly",
"Achromatopsia",
"Achromatomaly"
_configs = configProperties [configFile >> "CfgSurfaces", "isClass _x", true];
_output = [];
_output pushBack "//impact";
{
_output pushBackUnique getText (_x >> "impact");
} forEach _configs;
_output pushBack (toString [10] + "//soundEnviron");
{
GetVehicleIcon = {
params ["_unit"];
if !(isNull objectParent _unit) exitWith {
private _crewInfo = ((fullCrew (vehicle _unit)) select {_x select 0 isEqualTo _unit}) select 0;
_crewInfo params ["", "_role", "_index", "_turretPath", "_isTurret"];
if (_role == "cargo") exitWith {
"a3\ui_f\data\igui\cfg\commandbar\imagecargo_ca.paa"
};
if (_role == "driver") exitWith {
if (vehicle _unit isKindOf "Air") then {
surfaceIcons = addMissionEventHandler ["Draw3D", {
_spacing = 0.5;
_size = 10;
_worldPos = screenToWorld getMousePosition;
_worldPos = [round (_worldPos select 0), round (_worldPos select 1), 0];
for "_i" from (_size * -1) to _size step _spacing do {
for "_j" from (_size * -1) to _size step _spacing do {
_pos = [(_worldPos select 0) + _i, (_worldPos select 1) + _j, 0];
_pos set [2, getTerrainHeightASL _pos];
_pos = ASLToAGL _pos;
//+ icons on all the sound memory points
memPoints = ["sound_air_condition_1","sound_air_condition_2","sound_air_condition_3","sound_air_condition_4","sound_air_condition_5","sound_clothes_1","sound_clothes_2","sound_electric_box_1","sound_electric_box_2","sound_electric_box_3","sound_electric_box_4","sound_electric_box_5","sound_gutter_1","sound_gutter_2","sound_gutter_3","sound_gutter_4","sound_gutter_5","sound_gutter_6","sound_gutter_7","sound_gutter_8","sound_head","sound_metal_stairs_1","sound_metal_stairs_2","sound_metal_stairs_3","sound_metal_stairs_solid_1","sound_metal_stairs_solid_2","sound_metal_stairs_solid_3","sound_metal_tension_1","sound_metal_tension_10","sound_metal_tension_11","sound_metal_tension_2","sound_metal_tension_3","sound_metal_tension_4","sound_metal_tension_5","sound_metal_tension_6","sound_metal_tension_7","sound_metal_tension_8","sound_metal_tension_9","sound_net_fence_1","sound_rain_metalPlate_large_1","sound_rain_metalPlate_large_2","sound_rain_metalPlate_medium_1","sound_rain
//
// dumpConfig.sqf
// Copyright (c) 2010 Denis Usenko, DenVdmj@gmail.com
// MIT-style license
//
// Modified to write to file using MapBuilder MBFile_IO extension.
/*
======================================================================================
//For use in Eden Editor UI to copy mapSize to clipboard, only needs to be executed once to save the function to variable
getMapSize = {
params ["_object"];
_bbr = boundingBoxReal _object;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_maxWidth = abs ((_p2 select 0) - (_p1 select 0));
_maxLength = abs ((_p2 select 1) - (_p1 select 1));
_mapSize = _maxWidth max _maxLength;
_mapSize = (round (_mapSize * 100)) / 100;
//For use in Eden Editor UI to copy mapSize and icon to clipboard, only needs to be executed once to save the function to variable
getMapSizeAndIcon = {
params ["_object"];
_bbr = boundingBoxReal _object;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_maxWidth = abs ((_p2 select 0) - (_p1 select 0));
_maxLength = abs ((_p2 select 1) - (_p1 select 1));
_mapSize = _maxWidth max _maxLength;
_mapSize = (round (_mapSize * 100)) / 100;
//returns all available textures from the TextureSources of the vehicle you are looking at
//getting the type of the vehicle, going to be used for looking at the config
_vehicleType = typeOf cursorTarget;
//returning an array of the TextSources configs
_textureSets = "true" configClasses (configFile >> "CfgVehicles" >> _vehicleType >> "TextureSources");
//creating an empty array to be used later to store the available textures
_availableTextures = [];