blackteapie Posted October 3, 2015 Share Posted October 3, 2015 There is a string of code: "ReplaceOnCooked". This code could make the item change into another item after it was fully heated.So is it possible to make a string of code whose effect is exactly backward to ReplaceOnCooked, to change a item after it was fully cooled down?Which lua file or string of lua codes should I looking for? Wveth 1 Link to comment Share on other sites More sharing options...
MisterInSayne Posted October 3, 2015 Share Posted October 3, 2015 You'll need to write your own system for it. The concept you want is basicly add an 'on/off' context option to the fridge, give it a moddata of "on" and add that fridge to a table (or "off" when turned off, and remove it from the table). Then have an onTick event, or a EveryTenMinutes event (the latter is ingame time, not real time minutes), loop through the fridges in your table, check the items in it for their temperature, and if it's the right temperature for long enough (you can use a moddata for how many ticks it's been cooled), you remove the item, and add the one you want to change it too.Bonus things you could add are using the "LoadGridsquare" to check if there is a fridge on it, or the "OnObjectAdded" whether that object is a fridge, and add that to the table.You'll also need to create your own tooltip intigration for a "freezing" bar. Here is the code to check if the fridge has power:if object:getSquare():haveElectricity() or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier) thenGood luck, I'm eager to see what you make of it! Link to comment Share on other sites More sharing options...
blackteapie Posted October 3, 2015 Author Share Posted October 3, 2015 You'll need to write your own system for it. The concept you want is basicly add an 'on/off' context option to the fridge, give it a moddata of "on" and add that fridge to a table (or "off" when turned off, and remove it from the table). Then have an onTick event, or a EveryTenMinutes event (the latter is ingame time, not real time minutes), loop through the fridges in your table, check the items in it for their temperature, and if it's the right temperature for long enough (you can use a moddata for how many ticks it's been cooled), you remove the item, and add the one you want to change it too.Bonus things you could add are using the "LoadGridsquare" to check if there is a fridge on it, or the "OnObjectAdded" whether that object is a fridge, and add that to the table.You'll also need to create your own tooltip intigration for a "freezing" bar. Here is the code to check if the fridge has power:if object:getSquare():haveElectricity() or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier) thenGood luck, I'm eager to see what you make of it! Looks like it is quite complicated.I hope I can get it done. MisterInSayne 1 Link to comment Share on other sites More sharing options...
blackteapie Posted October 3, 2015 Author Share Posted October 3, 2015 You'll need to write your own system for it. The concept you want is basicly add an 'on/off' context option to the fridge, give it a moddata of "on" and add that fridge to a table (or "off" when turned off, and remove it from the table). Then have an onTick event, or a EveryTenMinutes event (the latter is ingame time, not real time minutes), loop through the fridges in your table, check the items in it for their temperature, and if it's the right temperature for long enough (you can use a moddata for how many ticks it's been cooled), you remove the item, and add the one you want to change it too.Bonus things you could add are using the "LoadGridsquare" to check if there is a fridge on it, or the "OnObjectAdded" whether that object is a fridge, and add that to the table.You'll also need to create your own tooltip intigration for a "freezing" bar. Here is the code to check if the fridge has power:if object:getSquare():haveElectricity() or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier) thenGood luck, I'm eager to see what you make of it!Hope this won't bother you too much.Do you know which lua string or strings are related to ReplaceOnCooked string? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now