- 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
-
- Yes
- I named my file(s) correctly (see Filename Conventions)
-
- 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.
All item settings can be found within custom thing 4020: Food in Zone Builder:
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!
Remember to change
As for the foods and drinks list, all you need to do is repeat the
And done! All your food items are now available in ZoneBuilder, starting at angle 17 from the order you added them in!
Credits and thank-yous:
- 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 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 |
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!
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