Page 1 of 1

[1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Wed Dec 09, 2020 3:34 am
by yagaodirac
rendering.draw_sprite{..., time_to_live = 2} This works.
rendering.draw_sprite{..., time_to_live = 1} This doesn't.

Re: [1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Wed Dec 09, 2020 5:43 am
by Rseding91
Thanks for the report however that's just how it works.

Re: [1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Wed Dec 09, 2020 5:47 am
by yagaodirac
Rseding91 wrote: Wed Dec 09, 2020 5:43 am Thanks for the report however that's just how it works.
To be honest, I didn't expect this to be intentional. I'll say it's a bug in my tutorial. But it does work well except for this.

Re: [1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Wed Dec 09, 2020 5:53 am
by Rseding91
yagaodirac wrote: Wed Dec 09, 2020 5:47 am
Rseding91 wrote: Wed Dec 09, 2020 5:43 am Thanks for the report however that's just how it works.
To be honest, I didn't expect this to be intentional. I'll say it's a bug in my tutorial. But it does work well except for this.
The way script rendering logic works is: decrement time-to-live, if 0 then it's dead, then render all non-dead rendering objects.

So if you start with 1 time-to-live you never render it because it dies the same tick it's created.

Re: [1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Wed Dec 09, 2020 11:48 am
by eradicator
Duplicate of viewtopic.php?t=75788 , which has more detailed explanations.

Re: [1.1.5] rendering.draw_sprite time_to_live has to be at least 2

Posted: Thu Dec 10, 2020 5:43 am
by yagaodirac
Rseding91 wrote: Wed Dec 09, 2020 5:53 am
I really recommend you introduce more intuition in api. This detail is annoying with nothing good in return.