on_selected_entity_click | LuaControl.fake_name | flying-tex

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Angamara
Inserter
Inserter
Posts: 39
Joined: Mon Oct 30, 2017 3:52 pm
Contact:

on_selected_entity_click | LuaControl.fake_name | flying-tex

Post by Angamara »

on_selected_entity_click
Called after the selected entity is clicked for a given player.

Contains
player_index :: uint: The player whose selected entity clicked.
entity :: LuaEntity : The selected entity clicked



LuaControl
fake_name :: string [Read-Write]
Fake name of Entity replace real name of entity in right popup information.



WHY ?

The need for these additions is related to the implementation of an RPG system. And we can find him another use for other type of game creation with a little imagination

The idea is to have NPCs giving quest.
"on_selected_entity_click" lets me know that the player clicks on the NPC to open the quest interface.

"LuaControl.fake_name" is a detail but would be appreciated to improve the content of a scenario. (This would change the names of the buildings and any other entity.)

Quest example: Find Marcus Riley and give him 10 iron plate.

Image
* "Joueur" is "player" in french.

And as a bonus if it were possible to have invisible entities for a different Force (the ghost entities are not visible for an enemy force for example)

This would make it easier to define NPCs that have new quests or quests in progress. But by fiddling a bit there is a way to use the resources currently available.






Data.raw.entity.flying-text
move :: boolean (optional): If the text move, true by default
destroy :: boolean (optional): If the entity destroys itself, true by default
text :: LocalisedString: The string to show.
font :: string (optional): Font of the displayed text.
color :: Color (optional): Color of the displayed text.


WHY ?


1 - If it is possible to make an entity invisible to other Force, a "!" over a NPC would be appreciated to report a new quest

2- By controlling the distance between the players and the use of the chat.
The use of flying-text could be used as a chat for players who are not part of the same Force. (instead of /s, Visually, it would look like old MMORPGs)

Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: on_selected_entity_click | LuaControl.fake_name | flying-tex

Post by Bilka »

Hello, your third request will be possible in 0.17 with the script rendering system: https://lua-api.factorio.com/0.17.0-pre ... ering.html
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding interface requests”