Jump to content

Simple cleaning script wanted


Recommended Posts

There could be two ways:

Do you really want it the way you described? Or might it be more interesting, if any rot that laid 15 minutes on the ground, will disappear?
So instead all disappearing at once, they will disappear individually.

Edited by Serpens
Link to comment
Share on other sites

To be honest I asked for help getting lists of items to become perishable and someone was kind enough to provide this and it's working beautifully.  The problem is perished items are becoming rot.  Ideally I want them to disappear instead.  I don't understand how to change the bit about onperishreplacement. I tried removing the line but the item would then just stop perishing when it gets low.  Another side note, while certain items are in your inventory you see the perishing % and it not until you equip an axe for example and actually use it then you get to see its remaining item uses.  Same with torch which is a bit worrying sometimes :)  Can this be improved?  Ideally the perishing % could be removed completely and the green background getting lower is enough.  Also why do items like cut stone not have the green background?  Some do some don't.

 

local addperish = {
	["silk"]	=	GLOBAL.TUNING.PERISH_FAST	,
	["twigs"]	=	GLOBAL.TUNING.PERISH_SLOW	,
}
for k,v in pairs(addperish) do
	AddPrefabPostInit(k or "",function(inst)
		if inst.components.perishable==nil then
			inst:AddComponent("perishable")
		end
		inst.components.perishable:SetPerishTime(v)
		inst.components.perishable:StartPerishing()
		inst.components.perishable.onperishreplacement = "spoiled_food"
	end)
end
Edited by Berwin
Link to comment
Share on other sites

Blimey, yes turning things into ash would make sense.  That never even occurred to me.  Out of interest how would I add to the code to make birds eat rot?  I'm still learning but it makes sense to go the ash route.Why also does cut stone not have a green 'perishing' background when in inventory like a lot of other items?

Edited by Berwin
Link to comment
Share on other sites

2 hours ago, Berwin said:

Blimey, yes turning things into ash would make sense.  That never even occurred to me.  Out of interest how would I add to the code to make birds eat rot?  I'm still learning but it makes sense to go the ash route.Why also does cut stone not have a green 'perishing' background when in inventory like a lot of other items?

There may be a wide range of confilcts when adding perishable to something that is not ment to be perishable.
But in this case I think maybe the picture of stone is too big, so it covers the perishing background.

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