Gmod Hunger Mod + Customizable HUD - Script
Gmod Hunger Mod + Customizable HUD is a complete Hunger and Food System for your Gmod server, a customizable hunger bar will indicate the hunger level to the players in the style you want and at the position you set, with the gameplay conditions you fully edit and decide. Many variations are provided to match your ideas. The food examples will allow you to add your own food templates with the nutritional values you choose.
❮
❯
Description of Gmod Hunger Mod + Customizable HUD
Summary:- π Gmod Hunger Mod + Customizable HUD presentation
- π¦ Contents
- π Max Hunger Level Upgrade System
- π¨ Hunger bar editing options in the HUD
- πΉοΈ Commands
- πΎ Backup and persistence
- π Spawnable food models in Gmod Hunger Mod + Customizable HUD
- π The API of the Hunger System: The functions associated with the Player Class for developers and object creation
- βοΈ Compatibility
π Gmod Hunger Mod + Customizable HUD presentation
Gmod Hunger Mod + Customizable HUD is not only a HUD customization addon. It brings to your server the notion of hunger, you will tell me that there is already a Food Mod in the DarkRP but not everyone wants to have the DarkRP installed on his server, I designed this script so that it can work without any other gamemode or addon but it is still compatible with the existing Foodmod.
So if you want to start on a sound basis and a system that does not spam the SQL module of GMod at each update of the variable (progress of hunger), Gmod Hunger Mod + Customizable HUD is designed to make backups of the user at the time of his disconnection. This backup system will allow the user not to constantly disconnect to not eat and recharge his hunger.
About the food models:
Sample foods are included if you want to add more food templates specific to your server world.
I will create free compatible food packages on the Gmod workshop on Steam.
Lots of choices for all tastes or if you suddenly change your mind about the hunger property, you can make the hunger fatal or just binding for the user, for example by making them lose stamina, or health points but not kill them.
Disable hunger with a single button, by rank, job, or totally if needed.
Regarding the HUD, as in my editable HUD collection the hunger bar is fully customizable, from icons, to style, shape and position. Styles will always be added in the course of free updates.
π¦ Contents
1. A SQL backup system for users and for backups.
2. A module for managing the hunger system according to the ranks: superadmin, admin, moderator, vip, user, etc.
3. An adjustable hunger bar in the HUD.
4. A module to manage the hunger system according to the DARKRP JOBS: mayer, citizen, vip, etc.
5. A customization system of the hunger bar in the HUD.
6. A large number of customizable HUD styles.
7. An entity of upgrade of the max hunger.
8. Examples of food for the creation of your own entity.
9. Gameplay customization options.
10. Various foods available on the workshop.
11. Simple and light HUD mod = Possibility to not display the hunger bar but a hunger icon only when the hunger is there,
12. And a technical support.
π Max Hunger Level Upgrade System
With Gmod Hunger Mod + Customizable HUD, you will be able to decide if the max hunger evolve with the level of the player, provided you have a leveling system installed on your server garry's mod, if you find a homemade one in the store / Section Gmod addons
It will be possible to choose the upgrade possibilities of the max hunger either by finding a key item (preferably rare to make it valuable), or according to the level of your users. The progress of your users is saved, hunger points to avoid your players disconnecting and reconnecting to recharge their hunger.
π¨ Customization options for the hunger bar in the HUD.
The Hunger System HUD is made for you to express your creativity, as in my editable HUD collection the hunger bar is fully customizable, from icons, to style, shape and position. Without going through file updates or workshop. Just don't forget to click on the "save" button to apply the modification that you will observe in real time.
List of customizable variables in the HUD:
1. X Y position
2. Length and width
3. The background color of the bar
4. The color of the progress bars
5. The color of the text
6. The color of the icon
7. The font of the text
8. Replace default icons with your own by simple image link.
9. 19 HUD styles, circle, horizontal bar, hearts, Zelda style, Minecraft style, textual, etc.
10. Changes applicable without rebooting your server.
πΉοΈ Commands
To access the interface the command chat : !hunger
The console command : norda_hud_hunger_system or hunger
πΎ Backup and persistence
Like most of my player stats management scripts, the player's evolution is saved at the moment of the disconnection for optimization reasons, it's a choice that is yours from the configuration file.
π Spawnable food models in Gmod Hunger Mod + Customizable HUD
The addon includes a spawn menu of spawnable foods, the foods already present, named food_example_1 and food_example_2 serve as an example to provide a basis to help you create your own, you can then store them in containers or a merchant.
An item called max hunger upgrade, will increase the max capacity of the hunger bar. It is up to you to decide whether or not to use it on your server.
π The API of the Hunger System: Functions added to FindMetaTable("Player") for development
1. The Glua functions on the Client and Server side:
player:Hunger() = Allows you to know the hunger points of the user.
player:GetMaxHunger() = Returns the user's max hunger points.
2. Server side Glua functions :
The following functions allow:
player:addHunger(number) = Allows to give or remove hunger. For example. 10 = Adds 10 hunger to the hunger it already has. -10 Removes 10. He can't go below Zero.
player:setHunger(number) = Set the player's hunger.
Manage max hunger via function items:
player:addMaxHunger(number) = Allows to increase or decrease the max hunger. If you want to create entities that upgrade or downgrade max hunger points.
player:setMaxHunger(number) = Allows you to set the max hunger points of the player. By default the max hunger is capped at 200. This limit can be changed.
βοΈ Compatibility
Compatible avec tout les gamemodes et sans aucun gamemode si vous souhaitez builder un projet sur une base vide.
Path: garrysmod/addons/norda_hud_hunger_mod
- The AddWorkshop function is automatically added to the script server file and can be deactivated from the configuration file. : resource.AddWorkshop( 2717709425 )
- To add gmod workshop resources to your collection : Gmod Hunger Mod + Customizable HUD [Content Only] | Gmod Workshop
The console command: norda_hud_hunger_system or hunger
Or the F3 button. Disable from the configuration file.
From the shortcut button of my administration system.
Here will be displayed the list of players in the database, you can see and modify the hunger and max hunger, even of users not logged in.
ON: The player will have his hunger altered.
OFF : The hunger player is turned off. Useful when you want to temporarily disable hunger. To not spend your time feeding everyone during the explanations of an event. Or during construction periods.
ON : The hunger bar wears out normally, but physical actions like sprinting and jumping alter it.
OFF: The hunger bar wears out normally.
ON : When the hunger bar is at zero, then the stamina bar will start to burn out.
OFF: Disable the interaction of the Gmod Hunger Mod addon with stamina.
ON: When the hunger bar is at zero, then the life point bar will start to burn out.
OFF: Disable the interaction of the Gmod Hunger Mod addon with life points.
ON : When the hunger bar is at zero, then the player dies.
OFF : Disabled
ON : The player will not be able to die of hunger, he will see his stamina decrease and his health too. Even if the health reaches 0 the player will stay alive.
OFF: Module disabled.
OFF: The player will regain his hunger level. Before death.
1. X Y position
2. Length and width
3. The background color of the bar
4. The color of the progress bars
5. The color of the text
6. The color of the icon
7. The font of the text
8. Replace default icons with your own by simple image link.
9. 19 HUD styles, circle, horizontal bar, hearts, Zelda style, Minecraft style, textual, etc.
10. Changes applicable without rebooting your server.
Several food examples can be found in the configuration file: norda_hud_hunger_mod_config.lua in the variable: Food_List
If we take the provided example, the index food_example_1 is the class name of the object:
local Food_List={
food_example_1={
Name="Example 1",
Model="models/food/burger.mdl",
UseSound="nord_hud_sounds/action_eat.mp3",
Life=5,Armor=0,Stamina=0,Food=50,Drink=0,Mana=0,
},
food_example_2={
Name="Example 2",
Model="models/food/hotdog.mdl",
UseSound="nord_hud_sounds/action_eat.mp3",
Life=5,Armor=0,Stamina=0,Food=25,Drink=0,Mana=0,
},
}
As for the food image in the spawnmenu you can simply create it in the material folder: vgui/entities/Entity_Class_Name.png