Beam prototype with definable lifespan
Posted: Wed Aug 22, 2018 3:33 pm
The beams used by destroyer bots are used as ammo, and has a nice action parameter for the duration of the beam in ticks and the max length etc.
When creating a beam entity by script, using create_entity(), there is no way to set the duration/lifespan of the beam.
The beam just sits there, forever, running through the animation. I have to manually add the beam to a table and keep track of it and kill it after X game ticks.
Please add an optional parameter either to the beam prototype itself for specified lifespan for automatic self-destroy, or perhaps have this as a more generic parameter added to create_entity (can have other uses) so that ANY entity spawned by create_entity can have a timed lifespan, perhaps even with optional end-of-time function call/callback or even raised in case users want to catch the timeout and add a nice swirl of magic dust or something silly.
Pic for example of never-ending beam lol. Construction units trying to 'zap' building into existence, only their beams stayed forever!
When creating a beam entity by script, using create_entity(), there is no way to set the duration/lifespan of the beam.
The beam just sits there, forever, running through the animation. I have to manually add the beam to a table and keep track of it and kill it after X game ticks.
Please add an optional parameter either to the beam prototype itself for specified lifespan for automatic self-destroy, or perhaps have this as a more generic parameter added to create_entity (can have other uses) so that ANY entity spawned by create_entity can have a timed lifespan, perhaps even with optional end-of-time function call/callback or even raised in case users want to catch the timeout and add a nice swirl of magic dust or something silly.
Pic for example of never-ending beam lol. Construction units trying to 'zap' building into existence, only their beams stayed forever!