Page 1 of 1

[Mod] Hungry [0.1 alpha] [hungry]

PostPosted: Fri Apr 19, 2013 13:11
by BlockMen
[h]Update:[/h]
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

PostPosted: Fri Apr 19, 2013 13:35
by Evergreen
Does this work with the latest unstable Ubuntu .deb packages?

PostPosted: Fri Apr 19, 2013 13:41
by BlockMen
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 ;)

PostPosted: Fri Apr 19, 2013 14:31
by 4aiman
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.

PostPosted: Fri Apr 19, 2013 15:51
by rubenwardy
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.

PostPosted: Fri Apr 19, 2013 18:03
by Evergreen
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.

PostPosted: Sat Apr 20, 2013 06:46
by Matsetes
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?

PostPosted: Sat Apr 20, 2013 15:46
by BlockMen
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)

PostPosted: Sat Apr 20, 2013 15:50
by PilzAdam
Better override minetest.item_eat(). Although this could cause problems, since you need to depend on that your mod gets loaded first.

PostPosted: Sat Jun 22, 2013 19:02
by BlockMen
A more developed version is included in Better HUD mod