Jump to content

Recommended Posts

Hello!

Please tell me, how can I remove unnecessary lines in a file of a certain prefab using this or similar function?

AddPrefabPostInit("bedroll_straw", function(inst)
	if TUNING.BEDROLL_STRAW_USES > 1 then
		inst:AddComponent("finiteuses")
		inst.components.finiteuses:SetConsumption(GLOBAL.ACTIONS.SLEEPIN, 1)
		inst.components.finiteuses:SetMaxUses(TUNING.BEDROLL_STRAW_USES)
		inst.components.finiteuses:SetUses(TUNING.BEDROLL_STRAW_USES)
	end
end)

I need to remove these two lines of code for prefab "bedroll_straw":
    inst:AddComponent("stackable")
    inst.components.stackable.maxsize = TUNING.STACK_SIZE_LARGEITEM

I don't want to modify this prefab file.
Can I do this using only code in modmain.lua?

Thank you for attention.

Edited by Tezumoto

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