[INACTIVE][MECH] Gastronomic v1.3.4 - Adding realism through hunger. [766]

Discussion in 'Inactive/Unsupported Plugins' started by fullwall, Jan 28, 2011.

  1. Offline


    The first specialised hunger plugin for Bukkit!
    Now with Thirst - open GastronomicWater Spoiler!

    Download latest release: v1.3.4 (Uses Permissions)
    Older Versions: 1.33, 1.31, 1.3, 1.26, 1.25, 1.2, 1.1, 1.0, 0.1
    Direct link to latest: here

    Ever felt like something was missing from Bukkit? A sense of immersion, of depth? Ever felt like people shouldn't be able to survive for weeks without a single piece of food? Gastronomic provides a reason to kill those pigs, catch that fish, and cook that bread. So gather up your [wheatpicked], [redmushroom] and [meat], and keep reading.

    • User-specified hunger intervals, increments, and damage amounts.
    • Per-item hunger restoration amounts.
    • 'Effects' system allowing very customisable health restoration/damage effects.
    • Permissions support.
    Give gastronomic.admin.* support to trusted players, and gastronomic.player.* permissions to all, or configure permissions manually from the list below.
    gastronomic.admin.enable - gives access to the /gastronomic command.
    gastronomic.admin.reload - gives access to the /gastronomic reload command.
    gastronomic.admin.sethunger - gives access to the /sethunger command.
    gastronomic.player.checkhunger - gives access to the /hunger command.
    gastronomic.player.checkfood - gives access to the /food command.
    gastronomic.disablehunger - give this permission to disable hunger for the user/group.
    /gastronomic - enables and disables plugin.
    /gastronomic reload - reloads all configuration files.
    /hunger - checks your current hunger level.
    /sethunger [player name] [hunger level] - sets player's hunger to the specified amount.
    /food [id] - tells the player how much hunger the id restores.
    /food list - lists how much hunger each food id restores.
    Known issues:
    • If configuration files are deleted for any reason, the server may show some scary messages. Don't worry, it should work out fine! If not, report please :).
    • In GastronomicWater, users must left click to empty buckets (bug with bukkit not calling correct events on bucket use)
    Planned Features:
    • Suggest some!
    v1.3.4 - compatibility, bugfixes.
    Older Versions (open)

    v1.33 - bugfixes, permissions are now opt-out
    • Finally fixed hunger saving (!)
    • Lotsa bugfixes (tm)
    • Incremented version number to reflect amount of bugfixes/new features added to 1.2.
    • Player hunger resets to initial-hunger after death.
    • Added enforce-limit setting to stop hunger going below 0 after death.
    • Added hunger restoration settings.
    • Allowed eating cake.
    • Added /food [id] command to get food hunger restoration value. Add gastronomic.player.checkfood to allow access.
    • Messages are now only sent to the player upon reaching the threshold.
    • Lots of bugfixes.
    • Changed the way players are added/removed on join/quit.
    • Added /gastronomic reload command.
    • Added initial-hunger setting to allow users to start at varying levels of hunger.
    • Added Permissions support.
    • Changed versioning scheme to reflect this.
    • Added support for messages with colour codes, as defined in the properties file.
    • Fixed miscellaneous bugs.
    • Hunger values can go below 100.
    v0.1 - initial release.
    Mechanics (open)

    Each player is given a hunger value, starting at 0. Every so often, at a user-specified interval, every user's hunger level goes up by a specified increment. This goes on until their hunger level reaches 100, and they begin to starve. At every following interval, damage will be taken until food is eaten, restoring hunger levels back to 0.
    Credits (open)

    • Firstly to this thread for inspiring the creation of Gastronomic. Thanks to Bashur and the other posters in that thread!
    • Secondly to TimberJaw, whose Hey0 mod (here) served as ideas for some of my plugin's functionality.
    GastronomicWater (open)
    Please note - this is not updated for 766 yet.
    Download link: 1.11, 1.0

    GastronomicWater has exactly the same features as Gastronomic, but with a separated config file.
    Commands are:
    /drink [id]
    /gastronomicwater (reload)
    /setthirst [player name] [thirst]
    gastronomic.admin.enable - gives access to the /gastronomicwater command.
    gastronomic.admin.reload - gives access to the /gastronomic reload command.
    gastronomic.admin.setthirst - gives access to the /setthirst command.
    gastronomic.player.checkthirst - gives access to the /thirst command.
    gastronomic.player.checkdrink - gives access to the /drink command.
    gastronomic.disablethirst - give this permission to disable hunger for the user/group.

    As this is an early release (and my first actual plugin), please report any bugs or issues, and also features you'd like to be added - I'm always open to suggestions! Also taking suggestions for my next plugin.
  2. Offline


    OK i've been doing a bit of testing, seems that messages are working flawlessly, as well as negative health values for food, also items not dropping when dying from hunger has been fixed, however, i am now noticing that a player who dies to anything other than hunger does not have his hunger lvl reset, this isnt a huge deal, but i could see someone getting a bit peeved if they are starving, and running to get food, falling from a height or getting hit by a mob and dying, just to spawn in starving again :p

    -using latest gastronomics, Cbukkit updated a few hours ago.

    also, i/ve been having some trouble getting /food to work for any food type, think you could have it just type /food and list all food with associated values?

    edit: hate to keep buggin ya, and this may have been brought up b4, but one of my users had a request for a visual on the UI showing hunger lvl, think this would be hard to implement? i know it would prolly have to be client side but most players would prolly be down for it :p
  3. Offline


    after a longer test i noticed that it starts getting a bit odd after a few hours (least on my server)
    it will say hunger =30, then amoment later come up and say your starving , ill eat till full.. /hunger will say =0 then a moment later i get the you are starving and start taking damage heh.
  4. Offline


    Hi. First, sorry for my English please :)
    When i use your plugin with Authorize plugin, sometimes i see this bug. When user disconnect and left the game, your plugin save his hungry level not as "UserName=<his hungrylevel>", but <dummyuser=0>. Thus any user may reset his hungrylevel by reconnect. It very bad for us :) Can u fix it please?
  5. Offline


    This plugin is awesome :eek:

    I have the same problem as AnotherBoris but also, the messages who are triggered on threshold are not showed to the player upon reaching the threshold. In fact, they never appear.

    My config file is at follow (messages are in french) :
    #Gastronomic Settings File
    #Author: Fullwall
    #Whether the plugin is activated. true/false
    #How much each user's hunger goes up by every interval. (Any number, but hunger is capped at 100)
    #How much a user is damaged if they're starving (1-20)(1 = half a heart).
    #What hunger level new players start at, and what you return to after death. (can be negative, capped at 100)
    #Interval between hunger updates. Measured in seconds.
    #If true, hunger cannot go below 0 after eating - use to stop people 'stocking up' on hunger.
    #Messages are configured here and are sent at the indicated hunger level.
    #For best results, don't put any spaces after the equals sign and before the text, and don't use any quotation marks.
    #Color codes are at the bottom.
    #OPTIONAL: Add these to your messages to display something.
    #+hunger+ - display hunger.
    #+name+ - display player name.
    message-20=§dVous n'avez pas faim mais ne serriez pas contre une petite gourmandise.
    message-40=§dVotre estomac gargouille un peu...
    message-60=§dVous avez faim même si vous pensez pouvoir encore tenir plusieurs heures.
    message-80=§cVous avez vraiment faim. Pensez à manger aujourd'hui !
    message-100=§4Vous êtes affamé ! Mangez quelque chose, n'importe quoi !
    message-eat=§dCa fait du bien ! Votre niveau de faim est désormais +hunger+/100.
    message-stuffed=§dVous avez le ventre plein. Difficile de manger plus !
    message-no-permission=§4You don't have permission to use that command.
    message-check-hunger=§dVotre niveau de faim actuel est de +hunger+/100.
    #Color Codes are as follows; put them into your message!
    # §0 = Black
    # §1 = Navy
    # §2 = Dark Green
    # §3 = Cyan
    # §4 = Red
    # §5 = Purple
    # §6 = Gold
    # §7 = Light Gray
    # §8 = Dark Gray
    # §9 = Dark Purple / Light Blue
    # §a  = Light Green
    # §b  = Light Cyan
    # §c  = Light Red/Orange
    # §d = Light Purple
    # §e = Yellow
    # §f = White
  6. Offline


    Hello there;

    First: congrats on the plugin.

    I have a RPG server in development, and this is one of the plugins we keep on track for adding it to the server. As it is now seems perfect for the hunger system we want.
    There is another system (close to this) that we tought of: a stamina plugin.
    The concept is that players needs to rest for an amount of time after a few days (or hours of play). Something like if a player is playing for 1 hour, they need to rest (stay in the same block for 5 min), or drink a soup (just tought of that; doesent make much sense though). When they don't rest, they walk like if they were on slowsand and they can't use tools. I hope you get what I mean when I say it's close to your plugin; and if not, I hope u get interested in developping it.

  7. Offline


    i second this :D also i was thinking. i have toying with challenge vs reward aspects on my server. I noticed that the hunger mod has 0 rewards at all. I was wondering if you could implement some sort of "buff" or bonus to having your hunger above a set lvl, say, 75. Maybe the player would gain 2x health from eating when hunger is above 75? i'm sure there would be other, non-health/food related bonuses we could come up with?
  8. Offline


    some plugins shouldnt have a reward. Some should be there to make the game more realistic or hard. by adding in a feature then buffing the other end there is no real point to having the hinderance to begin with.

    Although i can understand where some servers like tit for tat. so hopefully any/all bonus's or rewards would be toggle on/off. i think the stanima plugin is more bloated if thats what your looking for. This is a nice simple hunger plugin why i personally use and like this one.
    (aside from the messages not showing up)
  9. Offline


    Sorry for all the bugs :(. I don't have as much time to spend on this as I would like anymore, unfortunately... I will do a quick release to fix the entity death apart from hunger not resetting hunger.

    About the visual UI mentioned, that is probably beyond what I'd want to do :p. To AnotherBoris: dummyuser is obviously just a dummy... I'm not sure what causes that issue, but do other players still get saved when that occurs?

    EDIT: Redownload - player hunger will be reset for all types of death, /food list will list all food ids.
    EDIT2: Backup previous version before redownloading, as messages may repeat heaps again. I think I figured out the messages error!
    EDIT3: If you've downloaded from earlier, redownload - think I've actually, finally, positively fixed the message issues. Bit of fixing of mistaken for loop breaking, missing brackets on comparisons, and I think the issue is gone! If I get confirmation of this, I'm incrementing the version to reflect the amount of bugs fixed in this revision :).

    Indepth explanation: Basically, my code was only checking the first entry in a player messages table (used break instead of continue, so loop wasn't iterating) - so, your threshold (which message you were up to) would never get updated, so you'd never get the messages! Once I realised that, also realised that the comparison code for which interval you should change to was also wrong (missing brackets on && for a || condition, so it'd only check one condition), so you'd always get the message repeated.
    --- merged: Feb 9, 2011 12:50 PM ---
    I reiterate: redownload now.
  10. Offline


    I have a feature suggestion; A water extension. You need food, likewise you need water. It would be great as I am running a desert themed survival map where you need to fight for water, food and resources. I guess I bucket of water would be what you want to use to drink from, or just spending time in water would work as well, or both ways. This feature would be really appreciated.
  11. Offline


    Yeah an alernative water need would be nice. desert theme server? nice..
  12. Offline


    This seems nice. Trading the water bucket for a bucket when u drink it (so you wont lose the bucket).
  13. Offline


    Yeah, not getting the bucket back would be game breaking, as on my server finding 3 iron is pretty damn hard.
    Also, if anyone is interested in a test-run in my desert-server you can add me on skype: Lisianthus12345 or axon: DeadLeaves
    Here's the current generated world: http://zoom.it/q9Ia
  14. Offline


    I would really like to add water as a need... but my time is severely limited now, so it will probably take at least a few days. Maybe it should be a separate plugin as well?
  15. Offline


    Well it could be a separate plugin, it doesn't really matter. Anyhow, this plugin is superb and I wish you flow in coding this follow up. Without you my server wouldn't be reality.
  16. Offline


    Why can you only add food items? The explanation in the config isn't clear.

    I'd like players to be able to snort glowstone dust, eat sugar, etc, but these aren't counted as 'foods' so I can't, that seems like a bit of a silly limitation.

    Great plugin otherwise, though!
  17. Offline


    For some reason when I take hunger damage on my server, I'm healed automatically. I've looked at my worldguard settings and all the block-damage was set to off, and I take damage to monsters, but not hunger. Any ideas why?
    Plugins: worldguard, worldedit, towny, permissions, lwc, gastronomic, and essentials.
  18. Offline


    At the poster 2 posts above: You can add hunger values to any item/block, sorry if that was unclear. To the one just above: that is certainly unusual. Have you set starve-damage to a negative value? Is there a : in any of your foodstuffs values?
    --- merged: Feb 10, 2011 8:37 AM ---
    OK, about to update the main post. Made a thirst plugin/addon, has all of the same features as the main. Check the spoiler for link, is separate to gastronomic. If people don't like this, I have a backup plan.
  19. Offline


    Thank you very much fullwall for this update. I am going to try it in ~7 hours (afternoon in France). Then, I'll tell you how it is.

    So, to be clear, I'll check these:
    • Messages at threshold not appearing for some players (20-40-60-80-100)
    • Messages appearing too often for some players (every minute, but it have to be only at threshold)
    • Hunger reset when disconnect/reconnect
  20. Offline


    Just in general check for bugs fixed :p.
    --- merged: Feb 10, 2011 10:11 AM ---
    Redownload main, just realised from water addon, that using buckets will not register eating something if hunger value is specified. Now, buckets must be swung to eat from.
    --- merged: Feb 10, 2011 12:23 PM ---
    By the way, if you liked this plugin, please remember to look out for my next, ultra cool one that I've been working on. I promise it'll be epic :D.
  21. Offline


    You are totally awesome. This is what I call true service. I ask for a feature and within 24 hours it's done. Totally Amazing. Thanks many times over.
    On a side-note is it possible to have so that you can drink directly from a water source?
  22. Offline


    Thanks for the compliment! Had a good coding day today :). Secret plugin is progressing... About drinking from a water source, I'll have to check if bukkit will call the correct hooks. If it's possible, it'll definitely be added!
    --- merged: Feb 10, 2011 1:20 PM ---
    Well... I've checked out drinking directly, and it's not possible without using some slightly hacky methods... There are two possible approaches right now... I use a vector to get the block aimed at, and check if it's water (slow), or, I check that, when you right click a block, it is underwater and the block above that is air, and then remove the water (faster, but hacky). Are these methods at all desirable?
    --- merged: Feb 10, 2011 1:38 PM ---
    OK, went ahead and just added the drinking option. If you set still water (ID 8) or flowing water (ID 9) to a thirst restoring value, and right click on a water block, the thirst will be restored, and the water block will disappear. NOTE: This tends to be infinitely repeatable, as surrounding blocks will refill the consumed area...
  23. Offline


    Great job! I think I found a typo in the GastronomicWater properties file
    To change item health restoration per item, just add a : to the end of the thirst value
     and then put your new [U]thirst restoration[/U] value in.
    Should be health restoration right?

    I even made so that if drinking a cactus you will receive a little water and take some damage :p
  24. Offline


    Unusual typo. There's no formatting, and I made the file in Notepad, so I'm totally confuzzled as to why it's there XD. That's awesome with the cactus :). Hope you like the plugin!
  25. Offline


    Oh I don't like it. I love it. food and water plugins are what makes my server even possible.

    EDIT: I have a new idea for this plugin. You could make so when eating/drinking an item you can give a specific message. for example, "You ate raw food, you don't feel so good"

    EDIT2: I have found something game-breaking with the new water mod. You cannot place water with your bucket. as soon as you place it, you will drink it. Which causes the water to disappear.

    EDIT3: It seems like the intervals aren't accurate. I got two hunger intervals like 20seconds from each other even though it set at 80seconds.
  26. Offline


    Ive been having this happen as well. i believe its the same as one of the above posts as for me it only happens after some ammount of uptime. its fine after server reset for a bit.

    this makes me wonder, are you using server time to determine hunger updates fullwall? if you are that might explain this behaviour.
  27. Offline


    The interval update problem is probably due to the lack of proper scheduling Bukkit provides... Right now, I'm using a scheduledupdaterservice, not checking the server time. The issue happens probably with continued load causing the interval timer to get out of sync for whatever reason, changing it... I want to focus on releasing my new plugin first, before ironing out bugs/adding new features to this.
    --- merged: Feb 11, 2011 8:41 AM ---
    Redownload, fixed the issue with water - can't be holding a bucket to drink from water.
  28. Offline


    My server is using this and we love it, just wanted to say keep up the good work!
  29. Offline


    Any chance we could have a version that put all the admin commands to the server op if permissions isn't available?
  30. Offline


    Just changed it so if Permissions isn't enabled, only ops can use commands. Redownload for feature.
  31. Offline


    My players can't use /hunger /food or /food lis, this is my permissions config

    default: true
    build: true
    - 'gastronomic.player*'

Share This Page