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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

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

Post 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.
Image

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

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

Post 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.

User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

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

Post by raiguard »

+1 on this.
Don't forget, you're here forever.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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 1760 times
Position may be possible.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

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

Post 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)?
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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?'
If you want to get ahold of me I'm almost always on Discord.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

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

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

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

Post by Deadlock989 »

+1 for duration please.
Image

Post Reply

Return to “Modding interface requests”