ControlTech updated for Factorio 2

by fctrusr

Control Technology - Allows you to monitor your factory using Smart Displays. There are seven types: SD1020 - 2 digit display to- SD1080 - 8 digit display.

Content
3 months ago
2.0
255
Circuit network

b [Fixed] Error while running event fct-ControlTech

3 months ago

Мод ControlTech updated for Factorio 2 (2.0.3) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event fct-ControlTech::on_entity_settings_pasted (ID 37)
fct-ControlTech/displays/SD1060.lua:443: attempt to index global 'display' (a nil value)
stack traceback:
fct-ControlTech/displays/SD1060.lua:443: in function 'SD1060_settings_pasted'
fct-ControlTech/control.lua:238: in function <fct-ControlTech/control.lua:222>

the error occurred when copying settings from one display to another using shift+right click -> shift+left

3 months ago

Privet,

currently i can not reproduce this easily it seems to depend on a special constellation, everything i tried didn't crash yet.
Can you please provide me with information which signal the source display is measuring and which it is showing?
Please also provide the state of the check boxes.
Best Regards

3 months ago

Perhaps the problem is that I am copying to a panel that is not connected to the electrical network. Recorded a short 20-second video.

https://jmp.sh/s/TrbyJKN4cS5IjT0ZACbF

3 months ago

Strange, i tried to do the same as shown in the video, i have a arithmetic combinator and two displays viewing an item and multiply the value with the arithmetic combinator and view the result at the second display. Then i copy this group to a position where no electric network is available and copy the settings from the original to the copied display without any crash :/.

I can definitely prevent the crash by changing the code and ignore the entity when "display" is a nil value, but i rather would like to understand why this is happening at all.

At this location in the source code "display" should be the destination display which seems to be an "invalid" entry when you do it.

The routine iterates over all known display entities and figures which one is the source and which is the destination. If by any means the list is incomplete or somehow garbled the variables source or destination may end uninitialized.
In the current case this has happened to the destination display ...

Can you please provide me the Configuration of the source display ... which item is measured, which item is displayed ....

Meanwhile i will add some debugging code which can be enabled/disabled while playing to prevent unnecessary output.
The messages will end in the console log.

3 months ago

I can share the save. If it helps. Or do you need something else?

3 months ago
(updated 3 months ago)

I am interested in your save file since i can not trigger the situation for myself and your setup "contains" the issue, even if it is strange that a newly placed entity seems not to be in the table/list of known displays.

Meanwhile find version 2.0.4 which contains the prevention from crashes and a debugging switch which should be enabled before pasting settings ... it will then output the number of known displays ... and iterate over them. The log output then should contain lines like:

Script @fct-ControlTech/displays/SD1060.lua:435: number of display entities known = 4
Script @fct-ControlTech/displays/SD1060.lua:440: processed entity = 1
Script @fct-ControlTech/displays/SD1060.lua:440: processed entity = 2
Script @fct-ControlTech/displays/SD1060.lua:444: entity 2 is the source display
Script @fct-ControlTech/displays/SD1060.lua:440: processed entity = 3
Script @fct-ControlTech/displays/SD1060.lua:444: entity 3 is the destination display
Script @fct-ControlTech/displays/SD1060.lua:440: processed entity = 4

if one of the lines "is the ... display" is missing something went terribly wrong ... and i have currently no clue why and where this can happen
This code has been there also in the old version for Factorio 1 ...

I hope using your save file will enlighten us :-).

3 months ago

I recorded a new video with information on wire connections and setting up combinators.
https://gemoo.com/tools/upload-video/share/789567194378235904?codeId=Payxg70OAL7BV&card=789567190884380672&origin=videohosting - Video

https://limewire.com/d/Kcujh#7T8Frznsi0 - My saving

3 months ago

Hi, i tracked it down to the Nanobots ... if the displays are placed by the nanobots they somehow don't end up as known entities ... need to check which events need to be used or are triggered when nanobots are at work and place entities.
I already tried using "normal" bots and those entities placed by them worked.

3 months ago

And it crashes now at a different line :/

3 months ago

Ok, find version 2.0.5, fixing the issue using nanobots or similar methods to create entities.

Thank you for reporting the issue and providing the save file, otherwise we could have been in the dark for a long time.

3 months ago

Thank you very much!

This thread has been locked.