Food

[Open Assets] Food v1.0

What permissions do you give others to modify and/or maintain your submission?
Modify: YES - Maintain: YES - I give permission for my entire submission to be modified by others or used in their own work. I give permission for my entire submission to be maintained by others as well.
I made sure my file(s) follow the Submissions Guidelines
  1. Yes
I named my file(s) correctly (see Filename Conventions)
  1. Yes
This small mod allows map creators to place food items in their maps! These items can optionally respawn and award rings to the players that collect them.


mmmmm fooood.png

All item settings can be found within custom thing 4020: Food in Zone Builder:

So many options.png

  • Food sprite: Used to decide the kind of food item to be spawned. (See the list below)​
  • Respawning: Determines whether or not the food item will respawn after 8 seconds.​
  • Rings: How many rings are awarded to the player when touching the food item​
  • 2X Rings / 4X Rings: Multiply the amount of rings given by the item. Stackable.​



ANGLE
SPRITE
0​
FOO1A0.png
1​
FOO2A0.png
2​
FOO3A0.png
3​
FOO4A0.png
4​
FOO5A0.png
5​
FOO6A0.png
6​
FOO7A0.png
7​
FOO8A0.png
8​
FOO9A0.png
9​
FOOAA0.png
10​
FOOBA0.png
11​
FOOCA0.png
12​
FOODA0.png
13​
FOOEA0.png
14​
FOOFA0.png
15​
FOOGA0.png

ADDING ONE ITEM
In order to add your own food item all you'll need is a sprite with proper offsets and adding the lines of code shown below to a lua file. No need to do anything with SOC!

Lua:
freeslot("SPR_YOURSPRITENAME")
if not (foods)
    rawset(_G, "foods", {})
end
table.insert(foods, SPR_YOURSPRITENAME)

If your food item is a drink make sure you also add this to the above code. You need BOTH OF THESE to make a drink, otherwise characters will play a crunchy bite sound when drinking it!
Lua:
if not (drinks)
    rawset(_G, "drinks", {})
end
table.insert(drinks, SPR_YOURSPRITENAME)

Remember to change SPR_YOURSPRITENAME to the name of your food sprite. So if your sprite is called BURGA0, make sure to rewrite those pieces of code to say SPR_BURG, without the last two letters!

ADDING MULTIPLE ITEMS
Follow the same steps as above, but add a new entry to freeslot for each food item you're adding, separated by a comma. So if you are adding three items named BURG1, BURG2 and BURG3 your freeslot would become...
freeslot("SPR_BURG1", "SPR_BURG2", "SPR_BURG3")

As for the foods and drinks list, all you need to do is repeat the table.insert part! Let's say BURG3 and BURG2 are drinks, so we'll do this:
table.insert(foods, SPR_BURG1) table.insert(foods, SPR_BURG2) table.insert(foods, SPR_BURG3) table.insert(drinks, SPR_BURG2) table.insert(drinks, SPR_BURG3)

And done! All your food items are now available in ZoneBuilder, starting at angle 17 from the order you added them in!

I don't wanna eat it, it's too cute!.png

Don't know how to make maps? No worries! Just add the mod and order some pizza for your friends with the orderpizza command! Just take it easy when doing so. The cook can only handle so many requests at once.

Credits and thank-yous:
  • All sprites were taken from the game Sun Haven, a lovely farming game available on Steam
  • Shoutouts to Luy from SRB2 Brasil for somehow convincing me to cook this mod up
Author
JonBaxter
Downloads
561
Views
3,514
Extension type
pk3
File size
63.5 KB
MD5 Hash
276eea2e9e6da94894d9a6521bc38f27
First release
Last update
Rating
4.67 star(s) 3 ratings

More resources from JonBaxter

Share this resource

Latest reviews

harika bir mod bu modu map ımda kullanabilirmiyim ?
JonBaxter
JonBaxter
Elbette! (thanks google)
Upvote 0
Absolutely incredible. Nice sprites, easy customization, and implementation so simple I can do it in SLADE's THINGS lump editor, since all of my level editors are either SLADE (bad) or broken (also bad).

Thanks for making this!
Upvote 1
I can eat the food, place the food in my maps, and even order the food. And since I'm not too picky, I don't mind the sprites either. Great add-on Jon!
Upvote 2
Back
Top