Santa's Nixie Tube Display


Another version of the nixie tubes, less features, less UPS drops.

Content
3 years ago
0.15 - 1.1
25.1K
Circuit network

b [Bug] how to construct from script? (and deconstruct error)

3 years ago

Hi!

i really like this mod. I am considering using them in a mod (as indicators for elevators in a skyscraper). But i have some trouble constructing them via scripts.
The problem is that the display doesn't show numbers when the entity is artificially created. You can see it also in a test:
(just run this cheat command in a new game - expected behavior is to see number "1" displayed)

/c
local entitiesToClear = game.surfaces["nauvis"].find_entities({{1,1},{10,10}})
for _,e in ipairs(entitiesToClear) do e.destroy() end
local solar = game.surfaces["nauvis"].create_entity{name="solar-panel", position={3,6}, force="neutral"}
local pole = game.surfaces["nauvis"].create_entity{name="medium-electric-pole", position={4,4}, force="neutral"}
local tube = game.surfaces["nauvis"].create_entity{name="SNTD-nixie-tube", position={3,3}, force="neutral", raise_built=true}
local combinator = game.surfaces["nauvis"].create_entity{name="constant-combinator", position={3,4}, force="neutral"}
combinator.connect_neighbour({wire=defines.wire_type.red,target_entity=tube})
combinator.get_control_behavior().set_signal(1, { signal = {type = "virtual", name = "signal-F"}, count = 1, })
tube.get_control_behavior().circuit_condition = {condition={comparator=">", first_signal={type="virtual", name="signal-F"}, constant=0}}

playing with the tube's energy (like setting it to tube.energy = 1000000) does nothing - i tried it based on the other comment about energy > 50 being required.
is there a way how i can create the entities correctly, or would i be better of rolling my own display solution?

also if i would mine such a constructed entity, i get the following error:
8336.858 Error MainLoop.cpp:1281: Exception at tick 1230: The mod Santa's Nixie Tube Display (0.1.12) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event SantasNixieTubeDisplay::on_pre_player_mined_item (ID 11)
SantasNixieTubeDisplay/control.lua:29: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
SantasNixieTubeDisplay/control.lua:29: in function 'removeNixieSprites'
SantasNixieTubeDisplay/control.lua:234: in function <SantasNixieTubeDisplay/control.lua:230>

i am using SantasNixieTubeDisplay_0.1.12

3 years ago

Ah yes, I see the issue, it is not listening to the build event, only to the revive event... I'll fix this in the next release.

3 years ago

great, much appreciated :)

New response