Two improvements to player.add_custom_alert: position instead of entity, and duration
Two improvements to player.add_custom_alert: position instead of entity, and duration
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
Yes please.
Having to write a ticker just to show alerts for more than 10s is such an annoyance and easily avoidable overhead.
Having to write a ticker just to show alerts for more than 10s is such an annoyance and easily avoidable overhead.
My Mods: mods.factorio.com
Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
+1 on this.
Don't forget, you're here forever.
Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
Duration isn't possible. The times a given alert last are compiled and stored in the exe:
Position may be possible.If you want to get ahold of me I'm almost always on Discord.
Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
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)?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

Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
Has to be; no. It could be in utility constants but it would still apply for all alerts of a category.Reika wrote: Sat Aug 29, 2020 6:28 pmIs 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)?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
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?'
If you want to get ahold of me I'm almost always on Discord.
Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
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
The category of the alert determines which timeout it uses. It isn't configurable per alert.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.
If you want to get ahold of me I'm almost always on Discord.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Two improvements to player.add_custom_alert: position instead of entity, and duration
+1 for duration please.