Jump to content

Recommended Posts

I was taking a look at all related files and saw how the game generates farm plants in batch. The final table creation includes a curious comment about how mods can bypass the custom constructor.

Spoiler

local plant_prefabs = {}
for k, v in pairs(PLANT_DEFS) do
    if not v.data_only then --allow mods to skip our prefab constructor.
        table.insert(plant_prefabs, MakePlant(v))
    end
end

This made me confused: aren't I supposed to just create new prefab files inside [mod name]/prefabs/farm_plant_[thing]? Or is there a way to add entries to the relevant tables (PLANT_DEFS, for example) and let the game create the prefabs? I don't think the game runs the mod files before unpacking this table, but I might be wrong.

A really similar thing happens to spiced foods.

Spoiler

function GenerateSpicedFoods(foods)
    for foodname, fooddata in pairs(foods) do
        for spicenameupper, spicedata in pairs(SPICES) do

...

GenerateSpicedFoods(require("preparedfoods"))
GenerateSpicedFoods(require("preparedfoods_warly"))

Is there any way to automate the generation of spiced foods by modifying the "foods" table? Or am I forced to manually add spiced foods one by one?

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...