Jump to content
C.Ritter

[SOLVED] Need help with Blindfold/Overlay for covered head

Recommended Posts

Hey,

I have just successfully imported my first headgear! 🎉

Besides that, I'd like to add some effect so when you're in the first person that it's somewhat dark (you can't see anything or very little).

I have tried to look it up but without luck, as I have no idea what it would be called nor am I very good at figuring out codings. If someone who knows could help me out and potentially be patient with a noob like me would be much appreciated 😄

Spoiler

class CfgPatches
{
    class Bagged_Head
    {
        units[]={};
        weapons[]={};
        requiredVersion=0.1;
        requiredAddons[]={"CR_Headwear"};
    };
};
class CfgGlasses
{
    class None;
    class CR_Headwear: None
    {
        author="C.Ritter";
        _generalMacro="Bagged_Head";
        displayName="Headbag";
        model="\A_Variety_of_Police_Retextures\Models\CR_Headwear\Bagged_Head\CR_Bag.p3d";
        picture="\A_Variety_of_Police_Retextures\Models\CR_Headwear\Bagged_Head\UI\CR_Bag_UI.paa";
    };
};

 

The effect would be a little bit like how ACE changes the Blindfolds from Contact DLC

https://imgur.com/sfDtVJ8

Share this post


Link to post
Share on other sites

I am just dropping this here since it was fixed back in 2021 and there have been no replies since, so in case some people wish for a similar answer.

When you equip the headgear using the overlay, you will have it on both in 1st and 3rd person while the headgear is equipped.

 

config.cpp

Quote

class CfgPatches

{

    class CR_Bagged_Head

    {

        units[] = {};

        weapons[] = {};

        requiredVersion = 0.1;

        requiredAddons[] = {"CR_Glasses"};

    };

};

 

class CfgGlasses

{

    class None;

    class CR_Glasses: None

    {

        author = "C.Ritter";

        displayName = "Headbag";

        model = "\A_Variety_of_Police_Retextures\CR_Models\CR_Glasses\CR_Bagged_Head\CR_Bag.p3d";

        picture = "\A_Variety_of_Police_Retextures\CR_Models\CR_Glasses\CR_Bagged_Head\ui\CR_Bag_UI.paa";

    };

};

 

class CfgFunctions

{

    class CR

    {

        tag = "CR";

        project="CR";

        class CR_Headgear_Effects

        {

            file = "\A_Variety_of_Police_Retextures\CR_Models\CR_Glasses\CR_Bagged_Head\script"; // file path to the sqf file.

            class Headgear_Effects {

                postInit = 1;

            };

        };

    };

};

 

fn_Headgear_Effects.sqf

Quote

if is3den exitWith {};

if (!isserver) exitWith {};

waitUntil { time > 0; };

 

fnc_blindfold = {

    params["_state"];

 

    switch (_state) do {

 

        case "show": {

            ("blindfold" call BIS_fnc_rscLayer) cutRsc ["RscTitleDisplayEmpty", "PLAIN", -1, false];

            with uiNamespace do {

                _display = uiNamespace getVariable "RscTitleDisplayEmpty";

                _ctrlGrp = _display ctrlCreate ["RscControlsGroup", -1];

                _ctrlGrp ctrlSetPosition [safezoneX, safezoneY, safezoneW, safezoneH];

                _ctrlGrp ctrlCommit 0;

                _ctrlFlag = _display ctrlCreate ["RscPicture", -1, _ctrlGrp];

                _ctrlFlag ctrlSetPosition [0, 0, safezoneW , safeZoneH];

                _ctrlFlag ctrlSetText "A_Variety_of_Police_Retextures\CR_Models\CR_Glasses\CR_Bagged_Head\data\Overlay\CR_Bag_Overlay_CA.paa"; // file path to your overlay.

                _ctrlFlag ctrlCommit 0;

            };

        };

 

        case "hide": {

            "blindfold" cutRsc ["RscTitleDisplayEmpty", "PLAIN"];

        };

 

    };    

};



 

fnc_blindfoldCheck = {

 

    while { alive player} do {

        if (goggles player isEqualTo "CR_Glasses") then { // Your CfgGlasses class name, see config.cpp.

            ["show"] call fnc_blindfold;

        } else {

            ["hide"] call fnc_blindfold;

        };

        sleep 1;

    };

 

};

 

[] spawn fnc_blindfoldCheck;

 

player addEventHandler ["respawn",{[] spawn fnc_blindfoldCheck}];

 

There may be other solutions or ways of attaining this result but this is the one we felt worked best for us.

You should not run into any issues if you just change the ones with comments on them.

 

How it looks in Eden Editor https://imgur.com/a/Nb4517R (Bag on the head)

https://imgur.com/a/uUkFgOA (1st Person Overlay)

https://imgur.com/a/r65QzKE (3rd Person Overlay)

 

It is a little difficult to see but that was also the point when i created the overlay.

Share this post


Link to post
Share on other sites

You could also just make a new headgear/glasses/whatever item with a small black sphere (black on the inside, like my soul) within the Pilot LOD that would enclose the head/eyes. Though you would still be able to see in 3rd person...

  • Like 1

Share this post


Link to post
Share on other sites

Yeah, that is true, it was merely for the overlay both in 1st and third person for my sake. But blocking off Pilot LOD could also work if one just wants it blocked in 1st person only.

  • 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

×