Jump to content

how to add prefabpostinit to plant_defs (all farm plant)


Recommended Posts

i want to add prefabpostinit effecting all farm plants (and future ones) without having to do it manually or update each time klei adds a new farm plant.

anybody knows what i'm doing wrong, to me this looks like it should work

local function BigCrop(inst)
	inst.Transform:SetScale(10, 10, 10)
end

local PLANT_DEFS = require("prefabs/farm_plant_defs").PLANT_DEFS

for k, v in pairs(PLANT_DEFS) do
	AddPrefabPostInit(v, BigCrop)
end

 

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
 Share

×
  • Create New...