[Mod] Hungry [0.1 alpha] [hungry]

Post Reply
User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

[Mod] Hungry [0.1 alpha] [hungry]

by BlockMen » Post

Update:

A more developed version is included in Better HUD mod



-----------------
Hi everyone,

this simple mod is mainly for testing the new LUA HUD.


Every 4 seconds the player gets healed when you have eaten enough (9+ apples in bar).
If you have just 1/2 apple left every 4 seconds the player gets hurt, but just until 1/2 heart left.

You can eat (currently just) apples to fill up the hunger bar. 1 apples gives 2 apples in bar.

Because this is just a TEST-mod the player "takes" every 15 seconds 1/2 apple from the bar. You can change that in init.lua by setting loose_hunger = #every full number#. (in seconds)


Depends:
default

Just works with last git or builds that include LUA HUD!
- PilzAdam's build (666aae3-luahud)
- sfan5's build (c45c530)

Download:
Version 0.1: Hungry test version

License:
WTFPL

Screenshot:
Image
Last edited by BlockMen on Sat Jun 22, 2013 18:56, edited 1 time in total.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Does this work with the latest unstable Ubuntu .deb packages?
Back from the dead!

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

Evergreen wrote:Does this work with the latest unstable Ubuntu .deb packages?
I have no idea. You could try out and let others know the result ;)

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Evergreen wrote:Does this work with the latest unstable Ubuntu .deb packages?
Definitely NO. Ubuntu have Minetest v0.3 in it's repos.

BlockMen, could you possibly make your HUD "stretch-able"? And could you possibly make it start in a centre of a screen? (that will require health bar end in the middle of a screen).
I'm asking, cause I did that in C and want to know whether it's possible to make this in Lua atm.

User avatar
rubenwardy
Moderator
Posts: 6977
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

4aiman wrote:
Evergreen wrote:Does this work with the latest unstable Ubuntu .deb packages?
Definitely NO. Ubuntu have Minetest v0.3 in it's repos.

BlockMen, could you possibly make your HUD "stretch-able"? And could you possibly make it start in a centre of a screen? (that will require health bar end in the middle of a screen).
I'm asking, cause I did that in C and want to know whether it's possible to make this in Lua atm.
Notice Ubuntu.deb, not Ubuntu software store. There are ubuntu.debs supplied on the download pages that are latestist.
I still recommend compiling it your self.

@BlockMen: It should be
"lose_hunger" - taking away
not
"loose_hunger" - not tight.
Last edited by rubenwardy on Fri Apr 19, 2013 15:57, edited 1 time in total.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

4aiman wrote:
Evergreen wrote:Does this work with the latest unstable Ubuntu .deb packages?
Definitely NO. Ubuntu have Minetest v0.3 in it's repos.

BlockMen, could you possibly make your HUD "stretch-able"? And could you possibly make it start in a centre of a screen? (that will require health bar end in the middle of a screen).
I'm asking, cause I did that in C and want to know whether it's possible to make this in Lua atm.
Yes, the ubuntu repositories are out of date. How ever, they supply the latest builds in the minetest download page for ubuntu.
Back from the dead!

Matsetes
Member
Posts: 70
Joined: Tue Sep 11, 2012 23:36

by Matsetes » Post

Why not add food in food and farming mod for that?
And 4 seconds isn't too low? You have to eat an apple every 16 seconds?
Last edited by Matsetes on Sat Apr 20, 2013 06:47, edited 1 time in total.

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

4aiman wrote:BlockMen, could you possibly make your HUD "stretch-able"? And could you possibly make it start in a centre of a screen? (that will require health bar end in the middle of a screen).
I'm asking, cause I did that in C and want to know whether it's possible to make this in Lua atm.
IIRC it is not possible to strech the HUD atm. So it is not always in right position.

rubenwardy wrote:@BlockMen: It should be
"lose_hunger" - taking away
not
"loose_hunger" - not tight.
i was not thinking much about it. its an alpha version to show the new posibilitys of the new HUD api

Matsetes wrote:Why not add food in food and farming mod for that?
And 4 seconds isn't too low? You have to eat an apple every 16 seconds?
BlockMen wrote:Hi everyone,
this simple mod is mainly for testing the new LUA HUD.
...

So if continue developing, i will make an api, that every mod can register its "foods" for this.

Currently you have to eat apple when you want get healted or to prevent get damage(because of being hungry). if you have enough eaten every 4sec. you get healed by 1/2 heart (if necessary)

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Better override minetest.item_eat(). Although this could cause problems, since you need to depend on that your mod gets loaded first.

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

A more developed version is included in Better HUD mod

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests