[Mod] Hungry [0.1 alpha] [hungry]

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

[Mod] Hungry [0.1 alpha] [hungry]

by BlockMen » Fri Apr 19, 2013 13:11

[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
Last edited by BlockMen on Sat Jun 22, 2013 18:56, edited 1 time in total.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Fri Apr 19, 2013 13:35

Does this work with the latest unstable Ubuntu .deb packages?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Fri Apr 19, 2013 13:41

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 » Fri Apr 19, 2013 14:31

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
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Fri Apr 19, 2013 15:51

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.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Fri Apr 19, 2013 18:03

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.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Matsetes » Sat Apr 20, 2013 06:46

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
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat Apr 20, 2013 15:46

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

by PilzAdam » Sat Apr 20, 2013 15:50

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
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sat Jun 22, 2013 19:02

A more developed version is included in Better HUD mod
 


Return to Old Mods

Who is online

Users browsing this forum: No registered users and 27 guests

cron