Jump to content

Recommended Posts

Hi,

I'm working on a mission and all I have to do to finish it is to add some icons... but can't.

Let me explain.

I took the script of the BIS Bootcamp MP that allows you to show you text and icon on your 3D view to show you where are the locations for the training.
I added that to the FOB in the scenario, the text appear, some icons does as well... but only those inside the "ui_f_curator.pbo" with this path (exemple) :

_iconWeapon = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_1_ca.paa";

I've tried for exemple to add an icon for the planes :

_iconPlane          = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\plane_ca.paa"; (note that this icon is already in arma, not a custom one)

But it doesnt show up... I dont understand... is there anyone who knows how do use icons in the Draw3D ?
only those inside the "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\......paa"; show up...

here's both scripts :

 

thanks for your help !
 

Spoiler

 


 

// Defines

#define VARIABLE_INITIALIZED        "BIS_bootcamp_icons_initialized"

#define VARIABLE_ICONS          "BIS_bootcamp_icons_container"

#define VARIABLE_ICONS_SPECIAL      "BIS_bootcamp_icons_container_special"

#define VARIABLE_ICONS_SPECIAL_FLAG "BIS_bootcamp_icons_container_special_flag"

#define VARIABLE_DRAW_3D        "BIS_bootcamp_icons_draw3D"

#define VARIABLE_KEY_DOWN       "BIS_bootcamp_icons_key_down"

#define VARIABLE_KEY_UP         "BIS_bootcamp_icons_key_up"

#define VARIABLE_SHOW_SPECIAL_ICONS "BIS_bootcamp_icons_show_special"

#define KEY_SHOW_SPECIAL_ICONS      20

#define INDEX_ID            0

 

// Parameters

private ["_action", "_parameters"];

_action     = [_this, 0, "", [""]] call BIS_fnc_param;

_parameters     = [_this, 1, [], [[]]] call BIS_fnc_param;

 

switch (toLower _action) do {

    case (toLower "initialize") : {

        disableSerialization;

        

        // Do not allow multiple executions

        if (!isNil { missionNamespace getVariable VARIABLE_INITIALIZED }) then {

            ["terminate"] call BIS_fnc_icons;

        };

        

        // Add draw 3D event handler

        private "_draw3D";

        _draw3D = addMissionEventHandler ["draw3D", { ["draw3D"] call BIS_fnc_icons; }];

        

        // Main display

        private "_display";

        _display = findDisplay 46;

        

        // Make sure we have a valid display, otherwise delay the adding of the event handlers

        if (isNull _display) then {

            // Wait for display and then add event handlers

            [] spawn {

                waitUntil { !isNull (findDisplay 46); };

                ["displayAddEventHandlers", [findDisplay 46]] call BIS_fnc_icons;

            };

        } else {

            // Add event handlers

            ["displayAddEventHandlers", [_display]] call BIS_fnc_icons;

        };

        

        // Initialize variables

        missionNamespace setVariable [VARIABLE_INITIALIZED, true];

        missionNamespace setVariable [VARIABLE_ICONS, []];

        missionNamespace setVariable [VARIABLE_DRAW_3D, _draw3D];

        missionNamespace setVariable [VARIABLE_KEY_DOWN, -1];

        missionNamespace setVariable [VARIABLE_KEY_UP, -1];

    };

    

    case (toLower "terminate") : {

        disableSerialization;

        

        // Remove draw 3D event handler

        removeMissionEventHandler ["draw3D", missionNamespace getVariable VARIABLE_DRAW_3D];

        

        // Main display

        private "_display";

        _display = findDisplay 46;

        

        // Remove event handlers

        _display displayRemoveEventHandler ["KeyDown", missionNamespace getVariable VARIABLE_KEY_DOWN];

        _display displayRemoveEventHandler ["KeyUp", missionNamespace getVariable VARIABLE_KEY_UP];

        

        // Reset variables

        missionNamespace setVariable [VARIABLE_INITIALIZED, nil];

        missionNamespace setVariable [VARIABLE_ICONS, nil];

        missionNamespace setVariable [VARIABLE_DRAW_3D, nil];

        missionNamespace setVariable [VARIABLE_KEY_DOWN, nil];

        missionNamespace setVariable [VARIABLE_KEY_UP, nil];

    };

    

    case (toLower "displayAddEventHandlers") : {

        disableSerialization;

        

        // Parameters

        private ["_display"];

        _display = [_parameters, 0, displayNull, [displayNull]] call BIS_fnc_param;

        

        // Keyboard event handlers

        private ["_keyDown", "_keyUp"];

        _keyDown    = _display displayAddEventHandler ["KeyDown", { ["keyDown", _this] call BIS_fnc_icons; }];

        _keyUp      = _display displayAddEventHandler ["KeyUp", { ["keyUp", _this] call BIS_fnc_icons; }];

        

        // Store handlers

        missionNamespace setVariable [VARIABLE_KEY_DOWN, _keyDown];

        missionNamespace setVariable [VARIABLE_KEY_UP, _keyUp];

    };

    

    case (toLower "getIcons") : {

        // Return

        missionNamespace getVariable [VARIABLE_ICONS, []];

    };

    

    case (toLower "setIcons") : {

        // Store

        missionNamespace setVariable [VARIABLE_ICONS, _parameters];

    };

    

    case (toLower "addIcon") : {

        // Parameters

        private ["_id", "_position", "_observer", "_radius", "_isSpecial", "_intersect", "_rotate", "_rotationRate", "_params"];

        _id     = [_parameters, 0, "", [""]] call BIS_fnc_param;

        _position   = [_parameters, 1, objNull, [objNull, []]] call BIS_fnc_param;

        _observer   = [_parameters, 2, objNull, [objNull, []]] call BIS_fnc_param;

        _radius     = [_parameters, 3, 100, [0]] call BIS_fnc_param;

        _isSpecial  = [_parameters, 4, false, [true]] call BIS_fnc_param;

        _intersect  = [_parameters, 5, "nothing", [""]] call BIS_fnc_param;

        _rotate     = [_parameters, 6, false, [true]] call BIS_fnc_param;

        _rotationRate   = [_parameters, 7, 1, [0]] call BIS_fnc_param;

        _params     = [_parameters, 8, [], [[]]] call BIS_fnc_param;

        

        // Icon drawing properties

        private ["_texture", "_color", "_position", "_width", "_height", "_angle", "_text", "_shadow", "_textSize", "_font"];

        _texture    = [_params, 0, "", [""]] call BIS_fnc_param;

        _color      = [_params, 1, [1,1,1,1], [[]]] call BIS_fnc_param;

        //_position = [_params, 2, [0,0,0], [[]]] call BIS_fnc_param;

        _width      = [_params, 3, 1, [0]] call BIS_fnc_param;

        _height     = [_params, 4, 1, [0]] call BIS_fnc_param;

        _angle      = [_params, 5, 0, [0]] call BIS_fnc_param;

        _text       = [_params, 6, "", [""]] call BIS_fnc_param;

        _shadow     = [_params, 7, true, [true]] call BIS_fnc_param;

        _textSize   = [_params, 8, 0.05, [0]] call BIS_fnc_param;

        _font       = [_params, 9, "PuristaMedium", [""]] call BIS_fnc_param;

        

        // Get icons

        private "_icons";

        _icons = ["getIcons"] call BIS_fnc_icons;

        

        // Add

        _icons set [count _icons, [_id, _position, _observer, _radius, _isSpecial, _intersect, _rotate, _rotationRate, [_texture, _color, _position, _width, _height, _angle, _text, _shadow, _textSize, _font]]];

        

        // Store

        ["setIcons", _icons] call BIS_fnc_icons;

    };

    

    case (toLower "removeIcon") : {

        // Parameters

        private ["_id"];

        _id = [_parameters, 0, "", [""]] call BIS_fnc_param;

        

        // Get all the icons

        private "_icons";

        _icons = ["getIcons"] call BIS_fnc_icons;

        

        // The icon index within the container

        private "_index";

        _index = -1;

        

        // Go through list and see if we find matching id

        {

            if (_x select INDEX_ID == _id) exitWith {

                _index = _forEachIndex;

            };

        } forEach _icons;

        

        // Did we found a matching icon

        if (_index != -1) then {

            // Replace content within container

            _icons set [_index, "DeletePlease"];

            

            // Remove

            _icons = _icons - ["DeletePlease"];

            

            // Update container

            ["setIcons", _icons] call BIS_fnc_icons;

        };

    };

    

    case (toLower "draw3D") : {

        // Get all the icons

        private "_icons";

        _icons = ["getIcons"] call BIS_fnc_icons;

        

        // Go through all icons and send to draw

        {

            ["drawIcon", _x] call BIS_fnc_icons;

        } forEach _icons;

    };

    

    case (toLower "drawIcon") : {

        if (_parameters select 4) then {

            if (!isNil { missionNamespace getVariable VARIABLE_SHOW_SPECIAL_ICONS }) then {

                drawIcon3D (_parameters select 8);

            };

        } else {

            drawIcon3D (_parameters select 8);

        };

    };

    

    case (toLower "keyDown") : {

        // Parameters

        private ["_key"];

        _key = [_parameters, 1, -1, [0]] call BIS_fnc_param;

        

        if (_key == KEY_SHOW_SPECIAL_ICONS && isNil { missionNamespace getVariable VARIABLE_SHOW_SPECIAL_ICONS }) then {

            // Flag

            missionNamespace setVariable [VARIABLE_SHOW_SPECIAL_ICONS, true];

        };

        

        false;

    };

    

    case (toLower "keyUp") : {

        // Parameters

        private ["_key"];

        _key = [_parameters, 1, -1, [0]] call BIS_fnc_param;

        

        if (_key == KEY_SHOW_SPECIAL_ICONS && !isNil { missionNamespace getVariable VARIABLE_SHOW_SPECIAL_ICONS }) then {

            // Reset flag

            missionNamespace setVariable [VARIABLE_SHOW_SPECIAL_ICONS, nil];

        };

        

        false;

    };

    

    case default {

        ["Invalid action: %1", _action] call BIS_fnc_error;

    };

};


 

 

Spoiler

 

#define SHOW_ICONS true

 

// Icons

if (SHOW_ICONS) then {

    // Base icon image

    private ["_iconImage", "_iconHandgun", "_iconRifle", "_iconSniper", "_iconGrenade", "_iconLauncher", "_iconStatic", "_iconUniform", "_iconMagasin", "_iconRadio", "_iconBriefing", "_iconDelivery", "_iconRefuel", "_iconReload", "_iconRepair", "_iconDrive", "_iconFlag", "_iconMedical", "_iconRank", "_iconTimer", "_iconRunning", "_iconVehicle", "_iconTank", "_iconNaval", "_iconHelicopter", "_iconPlane", "_iconVehicleFiring"];

    _iconImage          = "A3\Ui_F_Curator\Data\CfgCurator\waypointCycle_ca.paa";

    _iconHandgun        = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_5_ca.paa";

    _iconRifle          = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_1_ca.paa";

    _iconSniper         = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_3_ca.paa";

    _iconGrenade        = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_6_ca.paa";

    _iconLauncher       = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_6_ca.paa";

    _iconExplosive      = "a3\ui_f_data\GUI\Rsc\RscDisplayArsenal\cargoPut_ca.paa";

    _iconStatic         = "a3\Ui_f\data\IGUI\Cfg\Actions\static_ca.paa";

    _iconUniform        = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeInventory\filter_7_ca.paa";

    _iconMagasin        = "a3\ui_f_data\GUI\Rsc\RscDisplayArsenal\cargoMag_ca.paa";

    _iconRadio          = "icons\SMALL\Radio.paa";

    _iconBriefing       = "icons\SMALL\Briefing.paa";

    _iconDelivery       = "a3\ui_f_data\IGUI\Cfg\Actions\loadVehicle_ca.paa";

    _iconRefuel         = "a3\ui_f_data\IGUI\Cfg\Actions\refuel_ca.paa";

    _iconReload         = "a3\ui_f_data\IGUI\Cfg\Actions\reload_ca.paa";

    _iconRepair         = "a3\ui_f_data\IGUI\Cfg\Actions\repair_ca.paa";

    _iconDrive          = "a3\ui_f_data\IGUI\Cfg\Actions\getindriver_ca.paa";

    _iconFlag           = "a3\ui_f_data\IGUI\Cfg\Actions\takeflag_ca.paa";

    _iconMedical        = "a3\ui_f_data\IGUI\Cfg\Actions\heal_ca.paa";

    _iconRank           = "icons\SMALL\Rank.paa";

    _iconTimer          = "a3\Ui_f\data\IGUI\Cfg\Actions\settimer_ca.paa";

    _iconRunning        = "a3\Ui_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa";

    _iconVehicle        = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\car_ca.paa";

    _iconTank           = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\tank_ca.paa";

    _iconNaval          = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\naval_ca.paa";

    _iconHelicopter     = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\helicopter_ca.paa";

    _iconPlane          = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\plane_ca.paa";

    _iconVehicleFiring  = "a3\UI_F_Curator\Data\RscCommon\RscAttributeBootcampStage\Icon_VehiclesFiringRange.paa";

 

    // Initialize

    ["initialize"] call BIS_fnc_icons;

 

    // Welcome signs

        // Course

        ["addIcon", ["InfantryObstacleCourse", Obstacle_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconRunning, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Obstacle_Infantry", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["VehicleObstacleCourse", Drive_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconDrive, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Obstacle_Vehicle", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["KartObstacleCourse", Kart_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconDrive, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Obstacle_Kart", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        // Park

        ["addIcon", ["VehiclePark", Vehicle_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconVehicle, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_armoredTransportVehicles", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["TankPark", Tank_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconTank, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_heavyArmored", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["NavalPark", Naval_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconNaval, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_seaport", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["HelicopterPark", Helicopter_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconHelicopter, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_heliport", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["PlanePark", Plane_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconPlane, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_airport", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        // Range

        ["addIcon", ["RifleRange", Rifle_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconRifle, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Rifle", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["Rifle2Range", Rifle2_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconRifle, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Rifle", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["SniperRange", Sniper_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconSniper, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Sniper", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        //["addIcon", ["LauncherRange", Launcher_WelcomeSign, player, 100, true, "nothing", nil, nil, [_iconLauncher, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Launcher", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["GrenadeRange", Grenade_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconGrenade, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Grenade", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["ExplosiveRange", Explosive_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconExplosive, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Explosive", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["VehicleRange", VehicleRange_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconVehicleFiring, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_Range_Vehicle", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        // Building

        ["addIcon", ["CanteenBuilding", Canteen_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconVehicleFiring, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_canteen", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["ShowerBuilding", Shower_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconVehicleFiring, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_showers", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["MedicalBuilding", Medical_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconMedical, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_medicalCenter", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["DeliveryBuilding", Delivery_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconDelivery, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_delivery", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["RefuelBuilding", Refuel_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconRefuel, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_fuel", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["ReloadBuilding", Reload_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconReload, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_ammoDepot", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["RepairBuilding", Repair_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconRepair, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_workshop", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        ["addIcon", ["OperationBuilding", Operation_WelcomeSign, player, 10, true, "nothing", nil, nil, [_iconFlag, [1,1,1,0.75], [0,0,0], 1, 1, 0, localize "STR_marker_toc", false, 0.040, "PuristaMedium"]]] call BIS_fnc_icons;

        

};

 

Share this post


Link to post
Share on other sites
10 hours ago, Touhou said:

_iconPlane          = "a3\ui_f_data\GUI\Rsc\RscDisplayGarage\plane_ca.paa";

 

The correct path would be 

\a3\ui_f\data\GUI\Rsc\RscDisplayGarage\plane_ca.paa

Leading backward slash doesn't matter for addons but normally without one it refers to the mission folder. 

  • Like 2

Share this post


Link to post
Share on other sites
17 hours ago, 7erra said:

The correct path would be 


\a3\ui_f\data\GUI\Rsc\RscDisplayGarage\plane_ca.paa

Leading backward slash doesn't matter for addons but normally without one it refers to the mission folder. 

Ok gonna try that latet ! thanks

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

×