Page 1 of 1

Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Wed Jul 15, 2020 2:43 pm
by Reika
As per the title, the ability to give a Position instead of a LuaEntity would be very useful, as would the ability to specify how long the alert lasts. "Structure damaged" alerts already last longer than the "Turret Firing" ones, so I know the system already has something of a mechanism for that built in.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 10:14 am
by Optera
Yes please.

Having to write a ticker just to show alerts for more than 10s is such an annoyance and easily avoidable overhead.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 5:41 pm
by raiguard
+1 on this.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 6:09 pm
by Rseding91
Duration isn't possible. The times a given alert last are compiled and stored in the exe:
Capture.PNG
Capture.PNG (22.75 KiB) Viewed 1922 times
Position may be possible.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 6:28 pm
by Reika
Rseding91 wrote:
Sat Aug 29, 2020 6:09 pm
Duration isn't possible. The times a given alert last are compiled and stored in the exe: Capture.PNG
Is there a reason this has to be as such? Why is it hardcoded (ie not even a utility constant, let alone a prototype or script thing)?

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 6:59 pm
by Rseding91
Reika wrote:
Sat Aug 29, 2020 6:28 pm
Rseding91 wrote:
Sat Aug 29, 2020 6:09 pm
Duration isn't possible. The times a given alert last are compiled and stored in the exe: Capture.PNG
Is there a reason this has to be as such? Why is it hardcoded (ie not even a utility constant, let alone a prototype or script thing)?
Has to be; no. It could be in utility constants but it would still apply for all alerts of a category.

Mostly; that's how base game uses them and so that's how they're coded and saved/loaded. Then the Lua API was added to read/add/remove them because 'why not?'

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 7:58 pm
by sparr
Seems like it might be viable to at least let Lua decide between 300 600 1800s, just by exposing three of the constants.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sat Aug 29, 2020 8:29 pm
by Rseding91
sparr wrote:
Sat Aug 29, 2020 7:58 pm
Seems like it might be viable to at least let Lua decide between 300 600 1800s, just by exposing three of the constants.
The category of the alert determines which timeout it uses. It isn't configurable per alert.

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration

Posted: Sun Oct 16, 2022 4:23 pm
by Deadlock989
+1 for duration please.