Using entity freezing as a script trigger
Posted: Mon Sep 01, 2025 10:05 pm
Howdy all,
I'm currently working on a mod to add new plastic pipes to the game. I'm 90% done, assets and most of the lua is at least first-draft done.
But I thought it would be a fun option to add to have a %chance of these pipes breaking when frozen (adjustable, but default I'm thinking like 10% chance). Issue is I believe that's all actually handled by the engine and not really exposed in the API? Maybe I'm wrong, but is there a discrete "whoosh this entity is now frozen" event or maybe even tie it to the alert, that I can use as a trigger for a wee script?
Reasonably I could do this with a poll on an hourly or even less frequent basis. This is just flavor and I think it ultimately matters very little (and rhymes closer with real life probably) if pipes burst immediately on freezing vs "in an hour from now". But I've had the thought now and want to see if there's a way to do it trigger-based.
I'm currently working on a mod to add new plastic pipes to the game. I'm 90% done, assets and most of the lua is at least first-draft done.
But I thought it would be a fun option to add to have a %chance of these pipes breaking when frozen (adjustable, but default I'm thinking like 10% chance). Issue is I believe that's all actually handled by the engine and not really exposed in the API? Maybe I'm wrong, but is there a discrete "whoosh this entity is now frozen" event or maybe even tie it to the alert, that I can use as a trigger for a wee script?
Reasonably I could do this with a poll on an hourly or even less frequent basis. This is just flavor and I think it ultimately matters very little (and rhymes closer with real life probably) if pipes burst immediately on freezing vs "in an hour from now". But I've had the thought now and want to see if there's a way to do it trigger-based.