Page 1 of 1

[Solved] Question about LuaPlayer::add_custom_alert()

Posted: Fri Feb 14, 2020 11:11 am
by Schallfalke
Want to ask what parameter entity in LuaPlayer::add_custom_alert does?

Code: Select all

add_custom_alert(entity, icon, message, show_on_map)
Adds a custom alert to this player.
Parameters
  entity :: LuaEntity
  icon :: SignalID
  message :: LocalisedString
  show_on_map :: boolean
I know what other three do, but I have no idea what entity does (no description in doc).
I put whatever entity to it and still works without noticeable difference.

Re: Question about LuaPlayer::add_custom_alert()

Posted: Fri Feb 14, 2020 11:14 am
by Klonan
Schallfalke wrote:
Fri Feb 14, 2020 11:11 am
Want to ask what parameter entity in LuaPlayer::add_custom_alert does?

Code: Select all

add_custom_alert(entity, icon, message, show_on_map)
Adds a custom alert to this player.
Parameters
  entity :: LuaEntity
  icon :: SignalID
  message :: LocalisedString
  show_on_map :: boolean
I know what other three do, but I have no idea what entity does (no description in doc).
I put whatever entity to it and still works without noticeable difference.
If you click the alert it will open the map at that entity

Re: Question about LuaPlayer::add_custom_alert()

Posted: Fri Feb 14, 2020 11:32 am
by Schallfalke
Thanks for the answer.
I would recommend adding such description after that parameter. It is not straightforward to find this out.