{solved}showing signals on a hiden entity

Place to get help with not working mods / modding interface.
Post Reply
CyberWizard2261
Inserter
Inserter
Posts: 23
Joined: Tue Jun 26, 2018 11:01 am
Contact:

{solved}showing signals on a hiden entity

Post by CyberWizard2261 »

For my mod "power combinator" I want to show the circuit signals in an invisible entity to the player

I tried to set player.selected = entity to simulate the player hovering the mouse over the entity but this only sets the selected entity for a few milliseconds.

Does anyone know a way to do this? if possible I'd like to avoid reading all signal myself to show them in my GUI
Last edited by CyberWizard2261 on Mon Jul 16, 2018 3:46 pm, edited 1 time in total.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: showing signals on a hiden entity

Post by eradicator »

CyberWizard2261 wrote:I tried to set player.selected = entity to simulate the player hovering the mouse over the entity but this only sets the selected entity for a few milliseconds.
If i remember right it should hold until the player selects something else. So how about using on_selected_entity_changed to set it to what you want every time it changes?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

CyberWizard2261
Inserter
Inserter
Posts: 23
Joined: Tue Jun 26, 2018 11:01 am
Contact:

Re: showing signals on a hiden entity

Post by CyberWizard2261 »

eradicator wrote: So how about using on_selected_entity_changed to set it to what you want every time it changes?
It worked! It executes 2-3 times per second but it works

Thanks again eradicator

Post Reply

Return to “Modding help”