[MOD 0.12.x] Nixie Tubes - numeric display elements

Changing/adding/removing one thing of the game. Doesn't break the game completely, if mod is removed.

[MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Sun Aug 09, 2015 4:48 pm

Big thanks to Narc for updating this while I'm busy with life and addictions other than factorio.
Narc wrote:
Narc wrote:I'm gonna post a pull request and an unofficial binary once I'm sure everything looks right.

And done, pull request and Nixie Tubes v0.1.8 unofficial (direct download). Please prefer GopherAtl's actual release, whenever he gets around to making one.

^^Use that version for the latest Factorio, my last version is non-functional after, I think, 0.12.11?
Nixie Tubes

Image

Info:
Adds an item that can be used to display the value of signals in a circuit network.


License
License
Copyright (c) 2015 GopherAtl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Long Description
Long Description
Adds craftable nixie tubes, each displaying a single digit, which can be connected to your circuit network and configured to display the value of any signal on it. If you like the idea of the 7-segment displays that've been floating around since 0.12 came out, but don't like how big they are or difficult to read some can be, well, this mod is for you.

The recipe takes .5 seconds and costs 1 electronic circuit, 2 iron plates, and 9 iron sticks.

Rows of them will be automatically linked together, so only the right-most of a group needs to be configured; if the number is too large to display, it will simply be cut off at the left (so, with only 1 nixie placed, "91" would display as just "1"), while extra tubes will be off. The comparison (<,=, or >) and the right-side value for comparison specified in the gui will be ignored; when you close and re-open the gui, it will always switch back to showing "=<num>" where num is the number of the signal being displayed.

Note that, like lamps, the gui will not open until a red or green wire is connected.

If red and green are both connected, like lamps and combinators, the value of the signal from both will be added together.


Pictures
Pictures
Image
ImageImage

Version history
Version history
  • 0.1.7 2015-9-2:
    • added refresh_rate config setting to config.lua
    • made tweaks to how it updates when gui is open and condition being changed, blind stab at maybe addressing a reported desync that might have been nixie-related?
  • 0.1.6 2015-8-17: Bug-fix, due to a entity name change, you could enter the "vehicle." Caught & fixed by Choumiko.
  • 0.1.5 2015-8-13: Most minor of minors, but I'd already pushed 0.1.4. Removed unnecessary old gfx and fixed a missed ref to the old icon.
  • 0.1.4 2015-8-13:
    • Latest sprites courtesy of GotLag, which include little "antenna" wire contact point and shadow.
    • negative number support - minus sign goes to the left.
    • sprite restructure - no longer invisible in the gui, you can see it properly!
    • Actually require power - unpowered nixies will stay in the off state. In rows, unpowered ones will still pass signals up to higher digits from lower, but the "master" that is actually wired and has the signal specified (the right-most) must be powered or none will work.
    • cleaned up behavior when placing/removing - removing master now clears it's children, as does removing the signal by right-clicking on it in the condition.
    • surface no longer hard-coded to "nauvis," making them friendly with other surfaces (future space, underground, tardis, etc)
  • 0.1.3 2015-8-10:
    • added technology "Cathodes" to unlock nixie tubes
    • moved nixies in crafting menu from the power section next to lamps, to the circuit logic section next to combinators, which makes more sense
    • fixed bug with initialization on placement that sometimes made them appear as random numbers until updated by a signal
  • 0.1.2 2015-8-9: New graphics courtesy of GotLag, involved a change to 1x2 tile size, so is a breaking change from earlier versions. Also new localizations - af, ca, da, de, en, es, fi, fr, hu, it, nl, pt, and zh.
  • 0.1.1 2015-8-9: forgot to commit a final recipe tweak so it didn't get included in 0.1.0; recipe now calls for 1 elec. circuit, 2 iron plates, and 9 iron sticks.
  • 0.1.0 2015-8-9: Initial version released into wild for testing by people-who-aren't-me


Planned Features
Planned Features
  • I'm considering modifying it to use a smart inserter instead of a lamp, so it display values from the logistics network and not just circuit networks
  • config settings - variable recipe options (including an "expensive" one that uses some petroleum gas (since neon isn't an option) as well as a cheap one like the current, as well as a config to adjust the refresh rate, which is how frequently it will poll the signal value (currently hard-coded to 5 times a second)
  • better graphics - I'm no artist, and it took me a long time to make these look as presentable as they do now, but they could look a lot better. Hopefully one of the talented artists in the community will step up and volunteer their services? (hint, hint)
  • find a reasonable work-around for the whole "not displayed in gui" thing.


Use in Mod Packs
Use in Mod Packs
Go ahead. You don't need to ask. You're free to include it in any mod pack either as-is, or with changed recipes/graphics, or whatever. Comments to this thread linking the mod pack are encouraged/appreciated, as it helps me keep track of who's using the mod, but that's it.

[spoiler=post format notes]Hopefully the format is satisfactory, if any automatic parsing systems have a problem with anything let me know.
Last edited by GopherAtl on Sat Feb 06, 2016 8:14 pm, edited 16 times in total.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Sun Aug 09, 2015 4:51 pm

I debated whether to throw this in WIP for a bit, but in use it's pretty simple and I haven't found any issues in testing (except the whole invisible-in-config-gui thing, but not sure yet how I'm gonna fix that)

My art skills suck, so I'm hoping to eventually replace these graphics with something, well, better. Assuming someone who doesn't suck at arting will volunteer their time to the task...

:edit: Oh, translations of "Nixie Tube" are encouraged, that is literally the only thing to be translated for the mod at present, so couldn't really be easier.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GotLag » Sun Aug 09, 2015 9:02 pm

How's this for art?
Image

Note that these are laying "flat" rather than standing up, so work better as a 2-tile-high entity instead of 1 by 1.

Sprite strip - it's 39 pixels wide, so add a horizontal shift of 0.109375

PS: Take a look at the Language links on the Wikipedia article for translations.

PPS: Let me know if you'd like them brighter/bolder or in a different font. I used Segoe UI Light.
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Sun Aug 09, 2015 10:51 pm

Certainly looks much better than my original art! I was kind of attached to the idea of them standing up, looking more like the typical designs in glass tubes, but beggars can't be choosers, so I can work with that. Thanks!

Good thought on the wikipedia translations, it should have everything I need for a translation job this simple.

I'll get a version 0.1.2 pushed out in a bit with the graphics update and some more localizations.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GotLag » Sun Aug 09, 2015 11:02 pm

I'm not a great artist either, I just copied the frame from a logistics chest, cloned the edges to extend it all the way around, and re-coloured it. However I will say that I think it's better for them to be "flat" than standing, so they aren't hiding things behind them. That would also be more consistent with the base game, the only entities that overlap others significantly are things like power poles which are not full-width and have plenty of transparency.

Let me know if there are any changes you'd like made, eg frame colour, font, brightness. I can also send you the PSD if you like.
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Sun Aug 09, 2015 11:36 pm

The psd would be nice - I meant to include the .xcf of the original in the github repo, and would put yours there as well, as the original forms may be helpful in hypothetical futures were others are updating the mod and need, for example, to make higher-res versions or something.

Hmm. Is the shadow in a separate layer in the PSD? Not sure how to go about it exactly, but shadows seem to be pretty commonly rendered as separate layers in factorio, would like to do them the same way here if I can, so having them in a separate strip would be ideal. Other than that, no, no particular suggestions. Your point about consistency of style is well-taken, too.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Mon Aug 10, 2015 12:14 am

updating the mod and thought of one thing... would be nice if there was a visual indication of the attach point for wires. Any way you could add something like that? Just a little antenna sticking out, like on a smart chest, perhaps? For now I'm leaving the contact point at the bottom-right, but top-right would make more sense visually and be more consistent.

:edit: Ok, pushed out 0.1.2, main post updated. Note this is a slightly breaking change, because the tile size of the tubes went from 1x1 to 1x2; did a test loading a save from 0.1.1, though, and it didn't seem to really hurt anything, nixies already placed in the world just had a slightly wonky selection and collision box as a result, but removing and re-placing them fixed it.

Also added the following localizations: af, ca, da, de, es, fi, fr, hu, it, nl, pt, and zh. If you speak one of these, I'd appreciate it if you let me know if the translation is wonky in any way (I'm particularly unsure about fi and zh, but could have mistakes in any of them). If you speak something not listed, you can submit a localization pull request on github, or just post the proper translation of "nixie tube" here and I'll add it myself.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GotLag » Mon Aug 10, 2015 2:57 am

I'll look into it.

Edit: how's this?
Image
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Mon Aug 10, 2015 7:39 am

looks good, thanks! Should have a 0.1.3 release ready tomorrow, which'll use these, and have another minor fix - I found that in some circumstances (?) when places, they don't initialize right, and display numbers instead of being in the off state. Will be an easy fix, just too tired tonight, as it's gotten late.

Got something else I can't decide if I should add to this mod, or do as a separate mod...

Image

Calling it a Logistic Combinator. You select item types in the constant combinator-like gui, and the counts are pulled from the logistics network and output on the connected circuit networks (any counts you enter will ignored, when opened it'll show the counts on logistics at the time of opening).

So basically it imports logistic network values into circuit networks for you, to then use as you please - in the pic, with nixie tubes, but could be used in any combinator logic. Ought to have it finished tomorrow, too.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GotLag » Mon Aug 10, 2015 10:40 am

Separate mods in my opinion. Maybe once you have a bunch of stuff you can bundle it together.
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Mon Aug 10, 2015 5:40 pm

GotLag wrote:I'll look into it.

Edit: how's this?
Image



Didn't notice last night, but you didn't include the raw graphic for the updated sprite? Gonna be pushing 0.1.3 directly, which fixes the initialization issue where the "car" sometimes places rotated (so displaying some number instead of being off), adds a technology (Cathodes, allows nixies, requires "advanced electronics"), and puts the nixies in the crafting menu next to combinators and circuit stuff instead of in the power section with lamps. I'll push a 0.1.4 with the new sprites later.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby DOSorDIE » Mon Aug 10, 2015 9:38 pm

Great Mod ... I love it :D
DOSorDIE
Fast Inserter
Fast Inserter
 
Posts: 242
Joined: Sat Oct 11, 2014 3:43 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GotLag » Wed Aug 12, 2015 3:15 am

Sorry for the delay, here are the sprites:
http://gozaima.su/factorio/art/nixie-tube.png
http://gozaima.su/factorio/art/nixie-glyphs.png

For the tube, use the following settings:
Code: Select all
  shift = {0.25, -0.125}
...
  circuit_wire_connection_point =
    {
      shadow =
      {
        red = {0.9, -0.5625},
        green = {0.9, -0.5625},
      },
      wire =
      {
        red = {0.4375, -1.125},
        green = {0.4375, -1.125},
      }
    }


The delay and the minus sign are due to me trying to tinker with the mod to display negative numbers. However unless I'm reading it incorrectly, there's no way to directly access to signal amount, and you have work out the signalled amount by binary search every time?
GotLag
Filter Inserter
Filter Inserter
 
Posts: 444
Joined: Sat May 03, 2014 3:32 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Wed Aug 12, 2015 3:27 am

GotLag wrote:Sorry for the delay, here are the sprites:
[snip sprites and settings]

The delay and the minus sign are due to me trying to tinker with the mod to display negative numbers. However unless I'm reading it incorrectly, there's no way to directly access to signal amount, and you have work out the signalled amount by binary search every time?


ayup. It stores the last value in an = condition so it can shortcut that process when it hasn't changed, but if it has? yawp, binary search. I've toyed with ways to change the search that will prioritize nearby values, but so far not sure if the gains would be worth the effort.

Supporting negatives shouldn't be too bad, it does resolve negative numbers already and just strips the sign off, it'll just need to remember and pass that sign up to the next nixie, and when it arrives at "0" with the negative flag, display and discard the negative and then carry on as before. Hasn't been a priority, and in fact I'd forgotten about it entirely for a while there. If you haven't done it first, I'll see about doing it tomorrow when I integrate the new sprites. Getting lateish and I'm too tired to be trusted with code right now XD
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby jorgenRe » Thu Aug 13, 2015 3:06 pm

Could you possibly in your mod do this small, but future proof change that will make your mod compatible with the upcomming space thing in 0.13 and my mod The underground?
Basically it is to remove the hardcoded part
Code: Select all
game.surfaces.nauvis

to this:
Code: Select all
builder.surface.

and after:
Code: Select all
local function onPlaceEntity(event)

add in:
Code: Select all
   local index = event.player_index
    builder = game.players[index]

so it looks like this:
Code: Select all
local function onPlaceEntity(event)
   local index = event.player_index
    builder = game.players[index]
  local entity=event.created_entity


Basically what it does is it uses the surface that the player who triggered that event(built the nixie tube)!
Logo
Image

Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces
jorgenRe
Filter Inserter
Filter Inserter
 
Posts: 546
Joined: Wed Apr 09, 2014 3:32 pm
Location: Tromso Norway

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Thu Aug 13, 2015 3:44 pm

@jorgenRe Absolutely, I'm glad you caught that, it should've been written that way in the first place. Next update, probably later today, will have this change, as well as support for displaying negative signals and the updated sprites that show the wire connection antenna.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby jorgenRe » Thu Aug 13, 2015 4:01 pm

GopherAtl wrote:@jorgenRe Absolutely, I'm glad you caught that, it should've been written that way in the first place. Next update, probably later today, will have this change, as well as support for displaying negative signals and the updated sprites that show the wire connection antenna.

Thank you :D!
Logo
Image

Noticed the told change in FFF #111 so il continue to use my signature ^_^
Thanks for listening to our suggestions, devs :D!
I would jump of joy if we could specify which tiles spawned in a surfaces
jorgenRe
Filter Inserter
Filter Inserter
 
Posts: 546
Joined: Wed Apr 09, 2014 3:32 pm
Location: Tromso Norway

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Thu Aug 13, 2015 4:09 pm

just coded that in now; I don't see that player/builder bit is actually needed - the entity being build that triggers the events has a surface, I just create the 2nd entity on that surface. I did double-check that I didn't use game.player anywhere that I should be using the event's reported player instead, and I don't seem to be - my handler for on_player_driving_changed_state already uses the player as reported by the event instead of the local player.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby GopherAtl » Thu Aug 13, 2015 6:26 pm

Version 0.1.5 is released! (updating OP right now) Direct link for the super-impatient here

Changes:

  • Updated sprites courtesy again of GotLag, which include little "antenna" wire contact point and shadow.
  • negative number support - minus sign goes to the left.
  • sprite restructure - no longer invisible in the gui, you can see it properly!
  • Actually require power - unpowered nixies will stay in the off state. In rows, unpowered ones will still pass signals up to higher digits from lower, but the "master" that is actually wired and has the signal specified (the right-most) must be powered or none will work.
  • cleaned up behavior when placing/removing - removing master now clears it's children, as does removing the signal by right-clicking on it in the condition.
  • surface no longer hard-coded to "nauvis," making them friendly with other surfaces (future space, underground, tardis, etc)

I dunno if it was intentional or not, as he didn't mention it at all, but regardless I'm giving half the credit for fixing the invisible-in-gui thing to GotLag. The numeral strip being in a separate sprite without the frames is what got me thinking in the right direction. Obvious in hindsight.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
GopherAtl
Fast Inserter
Fast Inserter
 
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Postby DOSorDIE » Thu Aug 13, 2015 10:27 pm

In the new Version you forget to disalbe the "Debug Mode" in config.lua
DOSorDIE
Fast Inserter
Fast Inserter
 
Posts: 242
Joined: Sat Oct 11, 2014 3:43 pm

Next

Return to New Items, Entities, Extensions

Who is online

Users browsing this forum: No registered users and 6 guests