Page 1 of 1
Entity enable/disbale to generate lua event
Posted: Sun Jun 24, 2018 12:42 am
by Sandman2003
I would like to be able to define an event that will trigger based on a (definable) entity type changing status from enabled to disabled or vice versa via in game circuit network conditions. Currently (as far as I can see), this has to be done by an on_nth_tick function that checks current status versus prior status, so an actual lua event could greatly improve mod performance versus this method.
Re: Entity enable/disbale to generate lua event
Posted: Sun Jun 24, 2018 10:54 pm
by eradicator
So basically a completely new prototype whichs sole purpose is to raise an event when it recieves a hard-coded (or better runtime determined?) circuit signal?
I guess that could be pretty useful for multi-entities with heavily customized behavior too. Would also make it possible to have "on/off" switches for basically any entity.
Re: Entity enable/disbale to generate lua event
Posted: Sun Jun 24, 2018 11:50 pm
by Rseding91
This currently isn't possible because the entire circuit network doesn't use events. The network operates by checking the signals each tick to see if the current condition is satisfied and if it is it operates. If not, it doesn't operate.
Re: Entity enable/disbale to generate lua event
Posted: Mon Jun 25, 2018 12:24 am
by Sandman2003
Unfortunate, but I understand. Thanks Rseding91.