Jump to content

Meal Ready-to-Eat


The_Real_Al

Recommended Posts

US field rations. Healthy, lasting and self-heating. Includes custom icons and (sparse) distribution.
The heated version sports the slightest possible stress reduction due to fond memories.
 
Idea and specs are based on a forum request by doomblood66 at:
http://theindiestone.com/forums/index.php/topic/1285-mre-meals-ready-to-eat/
 
Installation:
Extract to root directory. You know the drill.

 

Changelog:

 

0.2
- fixed heated MRE being rotten after two days regardless

 

Known Issues:
- Stress reduction is maximized because of buggy calculation in java. Look over here for info:
http://www.theindiestone.com/community/viewtopic.php%3Ff=27&t=16574.html
 
- Icons based on real photographs (and not too beautiful either). The first one was public domain, but i don't know for the second. If somebody asks whether this is his picture of MRE Tortillas then tell him it's chicken.
 
Future Plans:
When distribution is more varied.

MealReadytoEat.zip

Link to comment
Share on other sites

I went to the Police station and i found them MRE's :D it worked perfectly unfortunately, the sprite/icon was a "?", so i must have placed the icons in the wrong place, i put it in the media folder, if this is wrong please direct me to the right directory! (See what i did there)

 

Regards,

Alex

 

 

Edit: Also is it permanently non-perishable if it hasnt been cooked? If so great if not please tell me what to edit 

Link to comment
Share on other sites

I'm not quite sure if i understand what you mean with 'rarity to be a definite 3'. AFAIK it's always a propability.

 

Well, the following will be deduction rather than knowledge: 

The number is a percentage. If you increase it, you increase the chance of getting the item. But that's not the whole story. There is a number of rolls assigned to each container which - based upon a pure lack of further information - i believed to be simply the number of times each item is checked. However the formula behind this is much more complicated, involves density and distance of surrounding Zombies and allegedly some hardcoded features. So far it's only babyluanian gibberish for me. You can check it out in /media/lua/items/ItemPicker.lua. Search and ask around the forum for more information.

 

Now, the problem with the other shelves can be helped, but i'd advise against. If you look into /media/lua/Items/SuburbsDistribution.lua then you'll find the list of items which can be spawned in every container. You can then simply add more lines in mre.lua corresponding to the ones already in there. E.g. if you want to spawn them in every metal shelf then simply add:

table.insert(SuburbsDistributions["all"]["metal_shelves"].items, "MRE.mrecold");table.insert(SuburbsDistributions["all"]["metal_shelves"].items, 0.5);

The problem is that these shelves where you found the MREs are the only containers specifically assigned to the police station. So if you add them to ["all"]["metal_shelves"] they will spawn in literally every metal shelf since containers from the "all" table are found all over the place. Also, i already included them in ["all"]["crate"] with a chance of 0.5. Not much, but i'm pretty sure you'll find some in the lumber yard.

Link to comment
Share on other sites

No worries. That's because the tables in suburbsdistribution.lua are merely accessed by the game when it fills the container you open. Which table a container uses is set by the game and can't be changed until a map-editor is available.

 

The point is that you can add those lines above to the mre.lua and then you will find the items in the other shelves as well. Alas, you can also find them in every metal shelf outside the police station because those access the same table.

 

I wouldn't do it for balancing reasons, but that's just me. If you want to have more MREs ingame then go ahead. Adding them to the kitchen counters will do. Or try a higher spawn-chance.

Link to comment
Share on other sites

No worries. That's because the tables in suburbsdistribution.lua are merely accessed by the game when it fills the container you open. Which table a container uses is set by the game and can't be changed until a map-editor is available.

 

The point is that you can add those lines above to the mre.lua and then you will find the items in the other shelves as well. Alas, you can also find them in every metal shelf outside the police station because those access the same table.

 

I wouldn't do it for balancing reasons, but that's just me. If you want to have more MREs ingame then go ahead. Adding them to the kitchen counters will do. Or try a higher spawn-chance.

 

Sorry to be a pest, but ive just got 2 quick questions:

 

1. If i use the code you posted every single metal shelf will spawn 3 mre's?

2. Can you please add code for a 20% chance of mre's spawning in kitchen cabinets

 

Again sorry to be a pain, and if you cant i understand

 

Regards,

Alex

Link to comment
Share on other sites

Relax. No need to be sorry except for excusing yourself in every other sentence.

 

1. Well... they may spawn in every single metal shelf. You see the 0.5 there? That is a percentage that represents the spawn chance. It's only a slim chance. But as mentioned above, the mathematics are a bit more complicated. Just increase the 0.5 until you find a value you're happy with.

 

2. Might as well:

table.insert(SuburbsDistributions["kitchen"]["counter"].items, "MRE.mrecold");table.insert(SuburbsDistributions["kitchen"]["counter"].items, 0.5);
Link to comment
Share on other sites

Try raising it to 100. That should give you at least one or two of them per container.

 

Beats me if there is a way to directly address a specific container. Then again, i strongly believe that you could program a script in lua that does this. You would need some sort of id for the container and an event that fires when you open it. Interesting question actually, this would give you the possibility to distribute unique items anywhere on the map. I'm thinking story-mode here.

 

Why don't you start a new thread on this topic in the Modding Help forum? Others might have the expertise i lack.

Link to comment
Share on other sites

Ain't that a bird. Sounds like 'DaysTotallyRotten' and 'DaysFresh' count the number of ingame-days instead of the actual date. Can you confirm this for other foods as well?

 

Edit:

Well, it gets even more quirky than that:

 

I tested this with Tuna and Watermelon and both behave normal. Fresh after preparation even if 'DaysTotallyRotten' exceeded the ingame-days. (The former beeing a 'Normal' and the latter a 'Food' item)

 

Putting items and recipes in the items.txt file or changing the module doesn't work.

A 'destroy item' line in the recipe doesn't help either.

 

The only thing that helped so far was to include something else in the recipe, e.g. a 'keep KitchenKnife' line.

Then the item is still fresh when you prepare it a couple of days into the game.

 

However - and that's where i'm completely out of ideas - the aforementioned does not apply to vanilla items. If i just delete the line 'keep CanOpener' from the OpenTunaTin-recipe then the opened tin is still fresh after weeks.

 

No clue, still searching.

Link to comment
Share on other sites

The idea of there being "in-between" forms is rather amusing, imagine the faces of a bunch of hungry soldiers who open up a ration pack only to find a bunch of metally, wibbly-wobbly cans that are still too steely to open by hand or knife, but flappy enough that you can't get the can opener to bite.

 

 

"In 20 generations, we'll actually be able to eat these!"

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

I plan on changing out the images that currently being used with something that is more inline with the graphical feel of PZ, and once I am happy with them and know that they are usable in game, if you like I can post them here for you to see and use if you would like.

 

Love the mod BTW, and would it be possable to have different MRE's such as Meatloaf, Chili-mac, Pork Riblet, or Maple Sausage?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...