Page 1 of 2

[mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Sun Dec 20, 2015 22:02
by VanessaE

kaeza's/VanessaE's signs_lib mod


Image

This is kaeza's and my signs library mod, originally forked from PilzAdam's version and rewritten mostly by kaeza to include a number of new features.

Originally the purpose of the above upstream mods was to make default signs show their text, via an entity placed right in front. This library is a modernized, feature-enhanced version of that code, which not only places visible text, but which allows that text to be colored, along with supplying a number of other sign types (such as yard signs and signs hanging from a ceiling), multiple sign colors, and even signs on wooden fenceposts.

Full multi-color text is a key feature of this mod - simply write your text like normal, plus a "#" sign and number 0-9 or letter a-f (e.g. a single hexadecimal digit with a decimal value of - to 15), to change the color of the text that follows it. By default, the text will be displayed in black if no color is chosen. The color palette follows the good old industry-standard 16-color CGA console palette that we're all familiar with (e.g. the standard Linux terminal/DOS command prompt colors). See the preceding link for the list of colors.

Blank lines can be inserted by writing a single space followed by Enter (analogous to '\n' used elsewhere).

For detailed usage information and API, take a look at the online usage guide.

Download: https://github.com/minetest-mods/signs_ ... master.zip
...or browse the code: https://github.com/minetest-mods/signs_lib

Extra fonts: https://github.com/kaeza/minetest-signs_lib-extrafonts
(In case you want a bigger or different font than the default)

Install: Just copy the mod folder to the usual place and enable it.

Conflicts: The old visible sign text mod linked above.

License:
  • BSD for the code
  • WTFPL for all other assets

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 00:51
by redblade7
Great idea!

Does signs_lib revert whatever happened to homedecor c. March 2015, where the side-to-side unlocked wooden signs don't work anymore? (I noticed the tickets for the homedecor bugs were closed in light of this new mod's creation.)

Also, if I was to update homedecor on my server and install signs_lib, should the existing signs be preserved?

Thank you!

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 00:59
by Naj
Yes, that's a good idea !

There is something else that could be put outside homedecor and pipeworks : oil/paraphin/plastic

These items may be usefull in many crafts in many mods.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 05:10
by VanessaE
This isn't a new mod, really. It's the exact same code that was in the homedecor modpack, merely split off into a separate package.

That aside, I don't seem to have any trouble placing signs at all.

The reason you're having trouble placing the initial sign is because signs_lib is letting the engine handle the facedir prediction. Signs were never meant to be placeable at a right angle to the wall you're pointing at.

Build your wall, then place a block of anything 1 meter behind where you want the sign to go. Then place a sign against it and remove the block. Go around to the back side of the sign, point at it, and hold shift while you place another sign, and it'll be placed flat against the back. Both sides are then writable.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 11:40
by cHyper
is there a solution for umlaute for german users like ü, ä, ö and ß.
how can I enable such signs?

by the way, the game voxelands supports umlaute. Great feature there.

Image

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 11:45
by Naj
Signs handles only ASCII chars. There is one PNG file per char. If locale chars are added (accentuated and specific letters for all languages) this may double (or more) the number of textures.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Dec 21, 2015 11:48
by Fixerol
Great work!

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Tue Dec 22, 2015 19:23
by Martno
It would be awesome if this mod would handle UTF-8 characters. Is it possible?

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Wed Dec 23, 2015 00:32
by kaeza
Martno wrote:It would be awesome if this mod would handle UTF-8 characters. Is it possible?

It's possible, but given that each char is a separate texture, this would increase the distribution size too much. If implemented, will probably include only the characters used in most western scripts (english, spanish, italian, etc.). Textures for other scripts (cyrillic/CJK/etc) would have to be distributed separately.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Wed Dec 23, 2015 03:33
by VanessaE
I agree that UTF-8 would be too much.

Support for the full ISO-8859-1 character set should be enough for the main signs_lib distribution.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Jan 21, 2016 14:37
by Martno
I understand. ISO 8859-1 would be much better (that would give me enough character to substitute the missing ones)
I think I can make the missing textures for myself (because I need the missing charcters for my game) but I don't know how to add them to the mod (what code changes would be needed) because I'm a noob at modding. Could somebody explain it to me (if it's not to much to ask). If it's too complicated or hard to explain in a couple of sentence, then never mind.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Jan 21, 2016 14:57
by VanessaE
It should just be a matter of naming the glyph textures properly, as hdf_xx.png where xx is the ASCII code, in hex, of the character you want to add.

I don't THINK any changes to signs_lib's code are needed, but perhaps you might have to change the range on line 228 also. If you do, a check for non-existent glyph files within that loop might be needed too. That said, I don't know what would be needed to get Minetest to actually USE that encoding in the formspec.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Jan 21, 2016 16:15
by Martno
Thank you!

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 22, 2016 18:51
by Fixerol
VanessaE wrote:I agree that UTF-8 would be too much.

Support for the full ISO-8859-1 character set should be enough for the main signs_lib distribution.


Will be nice to have both ISO-8859-1 and UTF-8 versions. There are players with non-western charsets (Cyrillic, Chinese, Japan, India, and many other).

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 22, 2016 19:08
by VanessaE
There's no way this mod will ever support the full UTF-8 character set - not with its render-to-sprite-entity method of displaying the text, anyway. If the engine ever gets real text displayed on signs (i.e. without this hack), that may change.

Getting even ISO-8859-1 working is dependent on what character codes Minetest gets from the OS (or irrlicht?) when international text is submitted in a formspec.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 29, 2016 03:18
by redblade7
After recent server and mod updates I've run into a problem with signs, but I'm not sure if homedecor/signs_lib is to blame or not.

Before I file anything on github, does installing signs_lib affect the normal wooden signs in any way (the one in the top left corner)? The problem I'm having is true of those signs too.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 29, 2016 05:27
by VanessaE
As long as you're using the current code, it shouldn't have any negative effect on old signs, particularly if you're talking about a world that's never had any version of signs_lib installed. That said, what's the problem?

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 29, 2016 05:52
by redblade7
VanessaE wrote:As long as you're using the current code, it shouldn't have any negative effect on old signs, particularly if you're talking about a world that's never had any version of signs_lib installed. That said, what's the problem?


The server has the latest versions of homedecor_modpack and signs_lib, and existed before signs_lib was spun off.

When signs are placed in certain areas (not sure what the differences are), the following happens:

1. The text correctly shows on the sign
2. Teleport/travelnet/turn around, walk away, walk back to the sign
3. The text on the sign will be partially visible, the visible portion changing as you move the mouse
4. Repeat step #2
5. The text on the sign is completely invisible.
6. Have fun playing Minetest
7. Quit the game
8. Come back later
9. Return to step #1

I'm not sure if this is related, but all signs placed directly on the ground are always completely blank.

This started sometime in January 2016, either in installing/updating a mod on the server, or updating the Github version of Minetest, which I recompile when doing that.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Jan 29, 2016 06:39
by VanessaE
You're talking about z-fighting. That's a minor bug in signs_lib, the entities that display the text just need to be moved a little further out from the sign (they're so close that they just exceed irrlicht's/minetest's positioning precision limit, that's all).

It's just a glitch I've been meaning to fix, just never got around to it.

Text disappearing entirely is due to how minetest manages loading and displaying entities, and is not affected by signs_lib (as far as I know).

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Sat Jan 30, 2016 00:10
by redblade7
VanessaE wrote:You're talking about z-fighting. That's a minor bug in signs_lib, the entities that display the text just need to be moved a little further out from the sign (they're so close that they just exceed irrlicht's/minetest's positioning precision limit, that's all).

It's just a glitch I've been meaning to fix, just never got around to it.


OK, I can file a bug on Github then, but which project, homedecor_modpack or signs_lib?

Text disappearing entirely is due to how minetest manages loading and displaying entities, and is not affected by signs_lib (as far as I know).


This only happens to the signs affected by the glitch (and ground-mounting of signs_lib signs always appear blank) so I'd imagine it's part of the same problem.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Sat Jan 30, 2016 00:37
by VanessaE
file it against signs_lib (and wholly replace your homedecor modpack while you're at it - signs_lib isn't part of it anymore).

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Mon Feb 01, 2016 03:54
by redblade7
VanessaE wrote:file it against signs_lib (and wholly replace your homedecor modpack while you're at it - signs_lib isn't part of it anymore).


I upgraded homedecor_modpack when I first installed signs_lib.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Sat Feb 27, 2016 09:04
by redblade7
redblade7 wrote:
VanessaE wrote:You're talking about z-fighting. That's a minor bug in signs_lib, the entities that display the text just need to be moved a little further out from the sign (they're so close that they just exceed irrlicht's/minetest's positioning precision limit, that's all).

It's just a glitch I've been meaning to fix, just never got around to it.


OK, I can file a bug on Github then, but which project, homedecor_modpack or signs_lib?

Text disappearing entirely is due to how minetest manages loading and displaying entities, and is not affected by signs_lib (as far as I know).


This only happens to the signs affected by the glitch (and ground-mounting of signs_lib signs always appear blank) so I'd imagine it's part of the same problem.


I took a look at the affected signs, and noticed that in every case, the signs are facing east.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Tue Mar 15, 2016 00:27
by Nachtschatten
Not sure if this is a problem on my side, but as far as I can see, the Github repository suddenly only contains a few recent commits by kaeza from the 14th of March. Is that just me, or what's going on?

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Tue Mar 15, 2016 01:16
by VanessaE
Kaeza just collapsed all the old history, since it's all contained in Home Decor's repository anyway, and then added a couple new commits.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Sat Jun 11, 2016 04:04
by amadin
Hi, i create new textures based on default:sign_wall_steel but i need change indent on the edges of sign (left, right, up and down). I tried change textpos section but i badly understand what is this. Can you tell me what numbers i need to change?

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Fri Sep 09, 2016 10:20
by VanessaE
Sorry for the uncustomary delay, I've been busy with non-Minetest stuff for a while. I'm not sure I understand what you mean by "indent" in this case.

Meanwhile, a few new features have gone in:
  • Default metal signs in minetest_game have visible text now.
  • Those signs are now used for crafting the colored metal ones in lieu of the previous steel ingot recipies.
  • Some of the colored metal signs have a new default text color (instead of black) to fit their existing style.
  • For coders, you can now specify a default text color and relative location for the text entity. See comments in https://github.com/minetest-mods/signs_lib/issues/5 regarding the text position, and simply add defaultcolor = "<hex digit>" default_color = "<hex digit>" to your node definition to set the color.
For now, the placement behavior and overall style of the default metal signs is unchanged from upstream, aside from having a new texture and visible text. That is, there are no automatic metal yard signs, metal hanging signs, etc. yet, but this will change in the future.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Sep 15, 2016 05:22
by amadin
I mean text in signs does not fit in borders with my new textures and i don't know how to fix this. If you like you can add my textures in this mod.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Sep 15, 2016 06:08
by VanessaE
It's better that you should fix your textures as needed. I won't be adding anything like that to this mod. If the textures don't fit, they're just too big. :-)

EDIT: amadin was talking about aligning and sizing the text entity itself, so that it fits better with his custom sign background textures.

Re: [mod] kaeza's/VanessaE's signs library [signs_lib][git]

PostPosted: Thu Sep 15, 2016 11:04
by VanessaE
Another update: Inspired by what amadin was asking about, I've added an API feature to let you change the entity's size on a per-node-type basis. Just add text_size = {x=foo, y=bar}, to your node definition. The defaults are x=0.8 and y=0.5.

I've started to document signs_lib's API. Most of what signs_lib does is hard-coded and not really publicly accessible (or at least, not really intended to be used by other mods), but a basic description of it can be found here: http://daconcepts.com/vanessa/hobbies/minetest/signs_usage_guide/signs-usage.html#api

Also a minor API change: in a node definition, defaultcolor is now default_color (to fit better with the other options, not that anyone uses it yet. :-) )