Welcome to Altis Life RPG

Register now to gain access to all of our features.
Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.


Note that you can now sign-in with your Steam account.


This message will be removed once you have signed in.

  • Announcements

    • AltisLifeRpg

      Opening Announcement   09/13/2016

      Opening Announcement We are happy to announce the official reopening of the community assistance forum Altis Life RPG (open source public property). Before going any further, let's go over the current situation. As you are already aware, the forum and the database of Altisliferpg.com had been hacked a few weeks ago. This unfortunate situation has touched many communities of Arma 3. The various databases were erased, and since they were under the responsibility of the previous administration, no backup was able to recover the lost data. This means that all the tedious work must be redone. This regrettable situation has led Tonic to transfer the responsibility of its administration to a new and neutral party. This party has as sole goal to reunite every community, as diverse as they are, together to perpetuate the development of our beloved mod AltisLifeRPG.  First of all, I think it is important to clarify our intentions. Foremost, we want to reassure you that we are not proclaiming being the owners of the previous versions of Altis Life (open source public property) in collaboration with BoGuu based on Tonic' codes. As you know, Boguu has been a major player in the most recent versions. Please note that this platform is and will always remain open to future developers such as Boguu that would like to elevate Altis Life RPG to the next level. By doing so, we take our role as an official reference platform very seriously in the eyes of the vast community of Altis Life RPG. We are ready to face this responsibility. We are aware that the content added by users could be provided by external sources or from the original website. If you see a tutorial that you've created on our platform where you are not credited as the author, please mention it immediately to the administration and we will promptly fix the situation. Please note that seeing the overwhelming amount of content added by the community, we will not proactively search other community assistance websites to validate if proper credits were given to the various authors. Instead, it will be the author's responsibility to be proactive in contacting the administration. Since the majority of the content found on other websites came originally from Altisliferpg.com, we encourage members joining us to share any content deemed pertinent coming from other platforms without forgetting to credit the authors.       Finally, to clarify the rumors circulating: - The forum was not scammed. It was transferred directly from Bryan 'Tonic' Boardwine to our administration. A domain cannot be scammed. - The forum was transferred as an independent entity which has as a sole mission to perpetuate the forum and not let it die out.       Altisliferpg.com Regards, the Administration.       Feel free to join us on Discord in the Altis Life RPG Community section of the forum.   And of course if you have any question, feel free to message us here.
    • Rozo

      Donations   09/18/2016

      Hello,
        We've added a donation block on the right side. All of those donation goes directly to the developer of Altis Life mod ( currently BoGuu ). None of that money is used to maintain the forum. In the future we might add a donation button to support the forum, but for now we want to encourage the developer because they went through a lot. To discuss this topic - Here
    • Shakir Darwish

      IS YOUR SERVER BROKEN SINCE 1.64 UPDATE?   09/22/2016

      If your server is broken since 1.64 go check this link thanks. https://github.com/AsYetUntitled/Framework/issues/104
    • Rozo

      Sad Day   01/04/2017

      Good evening community of Altis Life RPG, Today was a sad day. We learned the hard way that one of the helper was using his status and visibility on the forum to do things i wouldn't imagine.  We were warned about this user in the beginning, we talked about his behavior and he said that they were things of the past. We were fooled.
      Unfortunately, he fooled other community members by selling stolen content and impersonating his role as a developer in another community. Here's a remember of one of the rules on our forum, No selling scripts, snippets, or services.   So if anyone come across someone who's selling his services, scripts or whatever, Report them. Especially if it's coming from an Helper, Mod, Admin. No one in the staff should ask for money, we already mention this when we reopened the forum and that rule is here to stay.

      We can't be sorry enough for what happen here, for any harm it as caused among other communities, for money that shouldn't been spent and we truly hope this doesn't happen again.

      As for the user in question, he is now banned from our forum and discord and we wish to never cross his path again.
        If there's anything we can do hit us on Discord or send a message to an admin.
      Thanks, Rozo.
David

[Tutorial] HUD 4.X/5.X (Progress Bars)

29 posts in this topic

G'day lads,

Here's another HUD I have made in my spare time :P 

Mine.PNG.47e32d756fb9ffeec0a847c41546c981.PNG

Or Without Values:

Mine2.PNG.abee44b062a3a04ebecdc9156d3ac4dc.PNG

Inspiration:

pv48H0Q.png.7cd09da8946fe0499e991cf141ae6dd9.png

https://goo.gl/S5iorn

 

-----=DISCLAIMER=-----

I made this at a resolution of 3840x2160 (16:9)

If it doesn't work at lower resolution I'm sorry.

However, I don't see why it wouldn't work at lower resolutions as long as they are within the aspect ration of (16:9).

------------------------------

-=Tutorial=-

description.ext:

Under

Class RscTitles {};

Add:

#include "dialog\HUD.hpp"

Find:

#include "hud_stats.hpp"

And Comment it out like so:

//#include "hud_stats.hpp"

Just to be safe inside masterhandler.hpp which is inside the dialog folder 

Find:

#include "hud_stats.hpp"

And Comment it out like so:

//#include "hud_stats.hpp"

Dialog File:

Create a file called HUD.hpp inside the dialog folder

Inside the file you just created paste this:

#define ST_VERTICAL       0x01
#define ST_HORIZONTAL     0
/*
#
#	Author: David
#
#	Release: V2.1
#
#	Community: Altisliferpg.com
#
#	Do Not Re-Upload Anywhere Else
#
*/
  
      class playerHUD {
        idd = -1;
        duration = 10e10;
        movingEnable = 0;
        enableSimulation = 1;
        fadein = 0;
        fadeout = 0;
        name = "playerHUD";
        onLoad = "uiNamespace setVariable ['playerHUD',_this select 0]";
        class controls
        {
            /*
            Life_RscProgress_HUDHealth,
            Life_RscProgress_HUDFood,
            Life_RscProgress_HUDWater,
            Life_RscProgress_HUDStamina
            */
            class Life_RscProgress_HUDHealth_Background: Life_RscText
            {
                idc = 9991;
                style = 0x01;
                colorBackground[] = {0,0,0,0.6};
                x = 0.958906 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };

            class Life_RscProgress_HUDFood_Background: Life_RscText
            {
                idc = 9992;
                style = 0x01;
                colorBackground[] = {0,0,0,0.6};
                x = 0.922813 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };

            class Life_RscProgress_HUDWater_Background: Life_RscText
            {
                idc = 9993;
                style = 0x01;
                colorBackground[] = {0,0,0,0.6};
                x = 0.886719 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };

            class Life_RscProgress_HUDStamina_Background: Life_RscText
            {
                idc = 9994;
                style = 0x01;
                colorBackground[] = {0,0,0,0.6};
                x = 0.850625 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };

        /* Progress Bars */
            class LIFE_RscProgress_HUDCommon: Life_RscProgress {
                colorFrame[] = {0, 0, 0, 0.8};
                y = 0.972223 * safezoneH + safezoneY;
                w = 0.0462964 * safezoneW;
                h = 0.0222222 * safezoneH;
            };

            class Life_RscProgress_HUDHealth: LIFE_RscProgress_HUDCommon
            {
                idc = 1100;
                style = 0x01;
                colorBar[] = {1,0.557,0.118,0.75};
                x = 0.958906 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };
            class Life_RscProgress_HUDFood: LIFE_RscProgress_HUDCommon
            {
                idc = 1101;
                style = 0x01;
                colorBar[] = {0.459,0.918,0,0.75};
                x = 0.922813 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };
            class Life_RscProgress_HUDWater: LIFE_RscProgress_HUDCommon
            {
                idc = 1102;
                style = 0x01;
                colorBar[] = {0.118,0.557,1,0.75};
                x = 0.886719 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };
            class Life_RscProgress_HUDStamina: LIFE_RscProgress_HUDCommon
            {
                idc = 1103;
                style = 0x01;
                colorBar[] = {1,0.118,0.118,0.75};
                x = 0.850625 * safezoneW + safezoneX;
                y = 0.819 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.154 * safezoneH;
            };
            class img4: life_RscPicture
            {
                idc = 1200;
                text = "textures\healthhud.paa";
                x = 0.855781 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.0154688 * safezoneW;
                h = 0.033 * safezoneH;
            };
            class img3: life_RscPicture
            {
                idc = 1201;
                text = "textures\thirsthud.paa";
                x = 0.891875 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.0154688 * safezoneW;
                h = 0.033 * safezoneH;
            };
            class img2: life_RscPicture
            {
                idc = 1202;
                text = "textures\foodhud.paa";
                x = 0.927969 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.0154688 * safezoneW;
                h = 0.033 * safezoneH;
            };
            class img1: life_RscPicture
            {
                idc = 1203;
                text = "textures\staminahud.paa";
                x = 0.964063 * safezoneW + safezoneX;
                y = 0.929 * safezoneH + safezoneY;
                w = 0.0154688 * safezoneW;
                h = 0.033 * safezoneH;
            };
            class text4: Life_RscStructuredText
            {
                idc = 1104;
                text = "";
                shadow = 0;
                x = 0.850625 * safezoneW + safezoneX;
                y = 0.863 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.022 * safezoneH;
                class Attributes
                {
                    color = "#FFFFFF";
                    align = "center";
                    valign = "middle";
                    underline = false;
                };
            };
            class text3: Life_RscStructuredText
            {
                idc = 1105;
                text = "";
                shadow = 0;
                x = 0.886719 * safezoneW + safezoneX;
                y = 0.863 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.022 * safezoneH;
                class Attributes
                {
                    color = "#FFFFFF";
                    align = "center";
                    valign = "middle";
                    underline = false;
                };
            };
            class text2: Life_RscStructuredText
            {
                idc = 1106;
                text = "";
                shadow = 0;
                x = 0.922813 * safezoneW + safezoneX;
                y = 0.863 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.022 * safezoneH;
                class Attributes
                {
                    color = "#FFFFFF";
                    align = "center";
                    valign = "middle";
                    underline = false;
                };
            };
            class text1: Life_RscStructuredText
            {
                idc = 1107;
                text = "";
                shadow = 0;
                x = 0.958906 * safezoneW + safezoneX;
                y = 0.863 * safezoneH + safezoneY;
                w = 0.0257812 * safezoneW;
                h = 0.022 * safezoneH;
                class Attributes
                {
                    color = "#FFFFFF";
                    align = "center";
                    valign = "middle";
                    underline = false;
                };
            };
        };
    };

core/functions/fn_hudSetup.sqf File:

Replace everything inside the file with:

#include "..\..\script_macros.hpp"
/*
    File: fn_hudSetup.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Setups the hud for the player?
    
    #
    #	Edited: David
    #
*/
  
disableSerialization;

cutRsc ["playerHUD", "PLAIN", 2, false];
[] call life_fnc_hudUpdate;

[] spawn
{
  //Define variables into private scope
    private["_dam", "_stam"];

  //Setup for statement 
    for "_i" from 0 to 1 step 0 do {
      
      //Define Variables
      _stam = getFatigue player;
      _dam = damage player;
	
      //Check if values have updated
      if((getFatigue player) != _stam) then {
        //If condition is met, or not met in this case; call hudupdate
        [] call life_fnc_hudUpdate;
      };
      
	  //Check if values have updated
      if((damage player) != _dam) then {
        //If condition is met, or not met in this case; call hudupdate
        [] call life_fnc_hudUpdate;
      };
    };
};

core/functions/fn_hudUpdate.sqf File:

Replace everything inside the file with:

#include "..\..\script_macros.hpp"
/*
    File: fn_hudUpdate.sqf
    Author: Daniel Stuart

    Description:
    Updates the HUD when it needs to.
    
    #
    #	Edited: David
    #
*/

    if (isNull LIFEdisplay) then {[] call life_fnc_hudSetup;};
    LIFEctrl(1101) progressSetPosition (life_hunger / 100);
    LIFEctrl(1103) progressSetPosition (1 - (damage player));
    LIFEctrl(1102) progressSetPosition (life_thirst / 100);
    LIFEctrl(1100) progressSetPosition (1 - (getFatigue player));

    //Text
    LIFEctrl(1107) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (getFatigue player)) * 100))];
    LIFEctrl(1105) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_thirst / 100) * 100)];
    LIFEctrl(1106) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_hunger / 100) * 100)];
    LIFEctrl(1104) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (damage player)) * 100))];

If you don't want the values displayed like in the photo above then use this instead:

#include "..\..\script_macros.hpp"
/*
    File: fn_hudUpdate.sqf
    Author: Daniel Stuart

    Description:
    Updates the HUD when it needs to.
    
    #
    #	Edited: David
    #
*/

    if (isNull LIFEdisplay) then {[] call life_fnc_hudSetup;};
    LIFEctrl(1101) progressSetPosition (life_hunger / 100);
    LIFEctrl(1103) progressSetPosition (1 - (damage player));
    LIFEctrl(1102) progressSetPosition (life_thirst / 100);
    LIFEctrl(1100) progressSetPosition (1 - (getFatigue player));

    //Text
	/*
    LIFEctrl(1107) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (getFatigue player)) * 100))];
    LIFEctrl(1105) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_thirst / 100) * 100)];
    LIFEctrl(1106) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_hunger / 100) * 100)];
    LIFEctrl(1104) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (damage player)) * 100))];
	*/

Textures/Icons:

Inside your textures folder add the contents of assets.zip

 

If it doesn't work for you please post the issue below. However, it would be much appreciated if you had a go at fixing it yourself and providing me with the fix in the comments. This is so others can see what has gone wrong and more importantly how to fix it.

Cheers, Happy Coding! :P 

assets.zip

Edited by David
90% of the time, it will work everytime
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I did exactly what you got instructed in this hud and the only problem I'm having is the bars don't show the amount of hunger and such. I uploaded a picture to show. 

hud.jpg

  • Confused 2

Share this post


Link to post
Share on other sites
1 hour ago, dwaynelm said:

I did exactly what you got instructed in this hud and the only problem I'm having is the bars don't show the amount of hunger and such. I uploaded a picture to show. 

hud.jpg

I am also having this issue, @David could you please take a look?

  • Like 1

Share this post


Link to post
Share on other sites

The issue is he hasnt go script_macros at the top of hudupdate 
Edit: Also you dont want to call the setup from the update. it will restart the loop.

 

Edit 2: 

Working fn_hudUpdate.sqf
 

#include "..\..\script_macros.hpp"
/*
    File: fn_hudUpdate.sqf
    Author: Daniel Stuart

    Description:
    Updates the HUD when it needs to.
#
#	Edited: David
#
*/

while{true}do {
    if (isNull (uiNamespace getVariable ['playerHUD',displayNull])) then {cutRsc ["playerHUD", "PLAIN", 2, false];};
    LIFEctrl(1101) progressSetPosition (life_hunger / 100);
    LIFEctrl(1103) progressSetPosition (1 - (damage player));
    LIFEctrl(1102) progressSetPosition (life_thirst / 100);
    LIFEctrl(1100) progressSetPosition (1 - (getFatigue player));

    //Text
    LIFEctrl(1107) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (getFatigue player)) * 100))];
    LIFEctrl(1105) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_thirst / 100) * 100)];
    LIFEctrl(1106) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_hunger / 100) * 100)];
    LIFEctrl(1104) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (damage player)) * 100))];
};

Working fn_hudSetup.sqf
 

#include "..\..\script_macros.hpp"
/*
    File: fn_hudSetup.sqf
    Author: Daniel Stuart

    Description:
    Sets up the HUD.
#
#	Edited: David
#
*/
disableSerialization;

if (isNull (uiNamespace getVariable ['playerHUD',displayNull])) then {cutRsc ["playerHUD", "PLAIN", 2, false];};
[]call life_fnc_hudUpdate;

[] spawn
{
    sleep 1;
    []call life_fnc_hudUpdate;
};

 

Edited by ItsLega

Share this post


Link to post
Share on other sites
26 minutes ago, ItsLega said:

The issue is he hasnt go script_macros at the top of hudupdate 
Edit: Also you dont want to call the setup from the update. it will restart the loop.

 

Edit 2: 

Working fn_hudUpdate.sqf
 


#include "..\..\script_macros.hpp"
/*
    File: fn_hudUpdate.sqf
    Author: Daniel Stuart

    Description:
    Updates the HUD when it needs to.
#
#	Edited: David
#
*/

while{true}do {
    if (isNull (uiNamespace getVariable ['playerHUD',displayNull])) then {cutRsc ["playerHUD", "PLAIN", 2, false];};
    LIFEctrl(1101) progressSetPosition (life_hunger / 100);
    LIFEctrl(1103) progressSetPosition (1 - (damage player));
    LIFEctrl(1102) progressSetPosition (life_thirst / 100);
    LIFEctrl(1100) progressSetPosition (1 - (getFatigue player));

    //Text
    LIFEctrl(1107) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (getFatigue player)) * 100))];
    LIFEctrl(1105) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_thirst / 100) * 100)];
    LIFEctrl(1106) ctrlSetStructuredText parseText format["<t>%1</t>", round((life_hunger / 100) * 100)];
    LIFEctrl(1104) ctrlSetStructuredText parseText format["<t>%1</t>", round(((1 - (damage player)) * 100))];
};

Working fn_hudSetup.sqf
 


#include "..\..\script_macros.hpp"
/*
    File: fn_hudSetup.sqf
    Author: Daniel Stuart

    Description:
    Sets up the HUD.
#
#	Edited: David
#
*/
disableSerialization;

if (isNull (uiNamespace getVariable ['playerHUD',displayNull])) then {cutRsc ["playerHUD", "PLAIN", 2, false];};
[]call life_fnc_hudUpdate;

[] spawn
{
    sleep 1;
    []call life_fnc_hudUpdate;
};

 

 Thank you I will update the tutorial now

Share this post


Link to post
Share on other sites

It works but now it keeps spamming chat that you'll receive your next paycheck in 5 minutes and will not stop unless you abort and come back in but once you receive it again it goes on forever.

Edited by dwaynelm

Share this post


Link to post
Share on other sites
7 minutes ago, dwaynelm said:

It works but now it keeps spamming chat that you'll receive your next paycheck in 5 minutes and will not stop unless you abort and come back in but once you receive it again it goes on forever.

I'm looking into it now, i'm guessing it's the while loop :P 

Edited by David

Share this post


Link to post
Share on other sites
2 hours ago, dwaynelm said:

It works but now it keeps spamming chat that you'll receive your next paycheck in 5 minutes and will not stop unless you abort and come back in but once you receive it again it goes on forever.

It's FIXED and TESTED, I should have known better than to put a while loop in my code :P just update your:

fn_hudSetup.sqf

and you should be good to go.

Share this post


Link to post
Share on other sites

Another thing, how would I remove fatigue? It's disabled on my master config? I tried removing it from the code but It didn't stop it? Your code is enabling fatigue somehow?

Thanks.

Share this post


Link to post
Share on other sites

I updated my fn_hudSetup.sqf as in your main post and I log in no problem until i receive my first paycheck then it starts spamming "you'll receive your next paycheck in 5 minutes" still, should i revert it back to it's original? I like the look of it and it works great but I need to figure out something so players can chat.

Share this post


Link to post
Share on other sites
9 hours ago, PartyGamePlayz | LightGamingRP said:

5E2B970703FB990BC01CE7474A2760EC2577B5F9 

I get this error.

After i followed all the steps.

Description.ext:

Find:

#include "hud_stats.hpp"

And Comment it out like so:

//#include "hud_stats.hpp"

 

Share this post


Link to post
Share on other sites
On 12.8.2017 at 5:25 PM, dwaynelm said:

I updated my fn_hudSetup.sqf as in your main post and I log in no problem until i receive my first paycheck then it starts spamming "you'll receive your next paycheck in 5 minutes" still, should i revert it back to it's original? I like the look of it and it works great but I need to figure out something so players can chat.

 

On 12.8.2017 at 8:59 AM, dwaynelm said:

It works but now it keeps spamming chat that you'll receive your next paycheck in 5 minutes and will not stop unless you abort and come back in but once you receive it again it goes on forever.

Same.

Share this post


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

 

Same.

 

5 hours ago, Nathan Junior said:

 

Me too, the same....

I've tested it on both 4.4R4 and 5.0. It works for me, no paycheck spam. So if it is my script I don't know how it's messing with it.

Share this post


Link to post
Share on other sites
1 hour ago, David said:

 

I've tested it on both 4.4R4 and 5.0. It works for me, no paycheck spam. So if it is my script I don't know how it's messing with it.

Can you tell me where are exactly located the fn_hudSetup & fn_hudUpdate files ? 

For me, it's  mpmissions/Altis_Life.Altis/core/functions.

Thanks.

Share this post


Link to post
Share on other sites
8 minutes ago, Nathan Junior said:

Can you tell me where are exactly located the fn_hudSetup & fn_hudUpdate files ? 

For me, it's  mpmissions/Altis_Life.Altis/core/functions.

Thanks.

That's the place: core/functions

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now