[Mod] Reworked signs from xyz [signs]

User avatar
VanessaE
Moderator
 
Posts: 4468
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

by VanessaE » Fri Feb 08, 2013 05:25

If anyone's interested, I've forked this to add signs onto wooden fenceposts. Place a few standard fences, then place a sign onto the post as usual. Instead of the sign floating in front of the post, the post will be replaced with one bearing the sign.

Right click to edit the text as described in the first post.

Dig the post+sign combination to get back one fencepost and one sign.

Download: https://github.com/VanessaE/signs/archive/master.zip
...or browse the code: https://github.com/VanessaE/signs

Unzip the downloaded file, rename the resultant folder to just "signs", and put it in your Minetest mods folder.

Note that these signs-on-fences objects don't connect to neighboring fences yet (my initial idea was that these be placed onto fences that are being used as vertical posts, e.g. as lampposts).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
 

User avatar
Ragnarok
Member
 
Posts: 215
Joined: Thu Mar 22, 2012 12:56
Location: Poland
 

User avatar
Topywo
Member
 
Posts: 1721
Joined: Fri May 18, 2012 20:27
 

User avatar
VanessaE
Moderator
 
Posts: 4468
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

by VanessaE » Fri Feb 08, 2013 22:33

Fixed a bug in my fork that kept other mods' right-click actions from working right if you happen to be holding a sign when performing such an action. Please re-pull/re-download as needed.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Feb 09, 2013 13:45

+1
Could you add cyrillic letters/explain how to add cyrillic letters?
I added new png file, added it's name w/o extension to the list of filenames, but that didn't work...
Ttf patch applied also.
 

User avatar
VanessaE
Moderator
 
Posts: 4468
Joined: Sun Apr 01, 2012 12:38
Location: Waynesville, NC
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE

by VanessaE » Sat Feb 09, 2013 15:26

I'll have to defer that to PilzAdam (who I hope will merge my changes back to master ;-) ). I don't know anything about handling of non-Latin glyphs.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Sat Feb 09, 2013 18:48

VanessaE wrote:I'll have to defer that to PilzAdam (who I hope will merge my changes back to master ;-) ). I don't know anything about handling of non-Latin glyphs.

What about "interlingual" ones? Like "!" and "&"?
I'm pretty sure I've missed smth obvious... Could you describe how to add new character?
Anyway, I'll try to do smth on my own one more time before asking PilzAdam for help. Don't want to disturb him atm :)

Also, how about changing "edit" control with "textarea"? (Just an idea ;)
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Tue Feb 19, 2013 03:37

+1 for using multiline text field.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

b21munhoz
New member
 
Posts: 1
Joined: Fri Jun 14, 2013 02:07

by b21munhoz » Fri Jun 14, 2013 02:15

I don't know if you are still working on the mod, but, I'm having a little problem.
When I use this mod the LCD item (from digilines mod) show the letters with the same size as they're shown by the signs.
Is there something I can edit to change the characters size?
thank you ^^
oh, and +1
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Jun 14, 2013 10:30

b21munhoz wrote:I don't know if you are still working on the mod, but, I'm having a little problem.
When I use this mod the LCD item (from digilines mod) show the letters with the same size as they're shown by the signs.
Is there something I can edit to change the characters size?
thank you ^^
oh, and +1

The font size is in the textures and in the code. Changing it is a PITA. The digilines mod probably uses the same texture names.
 

User avatar
prof-turbo
Member
 
Posts: 518
Joined: Mon May 07, 2012 17:02
Location: MinetestForFun or Teeworlds master server list

by prof-turbo » Sat Jun 29, 2013 18:48

---------------[Idea]---------------

I had an idea with this mod :

To make signs of different size. The signs would be greater, and the scripture would be too. As it, we could make writting easier to see.

Exemple :
_
size 1 : |_|
__
size 2 : | |
|__|
___
size 3 : | |
| |
|___| ETC.....

crafts ideas :
size 1 : normal craft
size 2 : size 1 + size 1
size 3 : size 2 + size 2
ETC.....

Tell me if you like that idea and if you'd like to use it :)
Last edited by prof-turbo on Sat Jun 29, 2013 18:50, edited 1 time in total.
You should take a look at http://www.xorhub.com
 

User avatar
Pitriss
Member
 
Posts: 253
Joined: Mon Aug 05, 2013 17:09
Location: Czech republic, Bohumin
GitHub: Pitriss
IRC: pitriss
In-game: pitriss

by Pitriss » Wed Oct 16, 2013 13:22

Why is text cropped also when i hover cursor on sign? Sign itself can remember longer text, so why it is not showing when i'm pointing at the sign? When i'm poinitng there is no reason to shorten it to fit on sign..
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Oct 16, 2013 13:44

Pitriss wrote:Why is text cropped also when i hover cursor on sign? Sign itself can remember longer text, so why it is not showing when i'm pointing at the sign? When i'm poinitng there is no reason to shorten it to fit on sign..

This mod is a bit outdated.
The homedecor mod has a more up-to-date version with a few other niceties like being able to "attach" signs to fences and protecting signs from edits ("locked signs").
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal
 

User avatar
davedevils
Member
 
Posts: 52
Joined: Thu Sep 25, 2014 01:13
Location: France
GitHub: davedevils
IRC: davedevils
In-game: davedevils

Re: [Mod] Reworked signs from xyz [signs]

by davedevils » Thu Sep 25, 2014 01:27

Just i post a little edit of PilzAdam version :)

This edit is for multi-player , only the first people have write in sign can edit the same sign :) (like a sign protect)

Code: Select all
-- Font: 04.jp.org

-- load characters map
local chars_file = io.open(minetest.get_modpath("signs").."/characters", "r")
local charmap = {}
local max_chars = 16
if not chars_file then
    print("[signs] E: character map file not found")
else
    while true do
        local char = chars_file:read("*l")
        if char == nil then
            break
        end
        local img = chars_file:read("*l")
        chars_file:read("*l")
        charmap[char] = img
    end
end

local signs = {
    {delta = {x = 0, y = 0, z = 0.399}, yaw = 0},
    {delta = {x = 0.399, y = 0, z = 0}, yaw = math.pi / -2},
    {delta = {x = 0, y = 0, z = -0.399}, yaw = math.pi},
    {delta = {x = -0.399, y = 0, z = 0}, yaw = math.pi / 2},
}

local signs_yard = {
    {delta = {x = 0, y = 0, z = -0.05}, yaw = 0},
    {delta = {x = -0.05, y = 0, z = 0}, yaw = math.pi / -2},
    {delta = {x = 0, y = 0, z = 0.05}, yaw = math.pi},
    {delta = {x = 0.05, y = 0, z = 0}, yaw = math.pi / 2},
}

local sign_groups = {choppy=2, dig_immediate=2}

local construct_sign = function(pos)
    local meta = minetest.env:get_meta(pos)
   meta:set_string("formspec", "field[text;;${text}]")
   meta:set_string("infotext", "")
end

local destruct_sign = function(pos)
    local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
    for _, v in ipairs(objects) do
        if v:get_entity_name() == "signs:text" then
            v:remove()
        end
    end
end

local update_sign = function(pos, fields, sender)
    local meta = minetest.env:get_meta(pos)
   local owner = meta:get_string("owner")
   meta:set_string("infotext", "")
   local text = meta:get_string("text")
   if fields and sender:get_player_name() == owner or text == "" then
      meta:set_string("text", fields.text)
      meta:set_string("owner", sender:get_player_name() or "")
   end
   text = meta:get_string("text")
    local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
    for _, v in ipairs(objects) do
        if v:get_entity_name() == "signs:text" then
            v:set_properties({textures={generate_texture(create_lines(text))}})
         return
        end
    end
   
   -- if there is no entity
   local sign_info
   if minetest.env:get_node(pos).name == "signs:sign_yard" then
      sign_info = signs_yard[minetest.env:get_node(pos).param2 + 1]
   elseif minetest.env:get_node(pos).name == "signs:sign_wall" then
      sign_info = signs[minetest.env:get_node(pos).param2 + 1]
   end
   if sign_info == nil then
      return
   end
   local text = minetest.env:add_entity({x = pos.x + sign_info.delta.x,
                              y = pos.y + sign_info.delta.y,
                              z = pos.z + sign_info.delta.z}, "signs:text")
   text:setyaw(sign_info.yaw)
end

minetest.register_node(":default:sign_wall", {
    description = "Sign",
    inventory_image = "default_sign_wall.png",
    wield_image = "default_sign_wall.png",
    node_placement_prediction = "",
    paramtype = "light",
   sunlight_propagates = true,
    paramtype2 = "facedir",
    drawtype = "nodebox",
    node_box = {type = "fixed", fixed = {-0.45, -0.15, 0.4, 0.45, 0.45, 0.498}},
    selection_box = {type = "fixed", fixed = {-0.45, -0.15, 0.4, 0.45, 0.45, 0.498}},
    tiles = {"signs_top.png", "signs_bottom.png", "signs_side.png", "signs_side.png", "signs_back.png", "signs_front.png"},
    groups = sign_groups,

    on_place = function(itemstack, placer, pointed_thing)
        local above = pointed_thing.above
        local under = pointed_thing.under
        local dir = {x = under.x - above.x,
                     y = under.y - above.y,
                     z = under.z - above.z}

        local wdir = minetest.dir_to_wallmounted(dir)

        local placer_pos = placer:getpos()
        if placer_pos then
            dir = {
                x = above.x - placer_pos.x,
                y = above.y - placer_pos.y,
                z = above.z - placer_pos.z
            }
        end

        local fdir = minetest.dir_to_facedir(dir)

        local sign_info
        if wdir == 0 then
            --how would you add sign to ceiling?
            minetest.env:add_item(above, "signs:sign_wall")
         itemstack:take_item()
         return itemstack
        elseif wdir == 1 then
            minetest.env:add_node(above, {name = "signs:sign_yard", param2 = fdir})
            sign_info = signs_yard[fdir + 1]
        else
            minetest.env:add_node(above, {name = "signs:sign_wall", param2 = fdir})
            sign_info = signs[fdir + 1]
        end

        local text = minetest.env:add_entity({x = above.x + sign_info.delta.x,
                                              y = above.y + sign_info.delta.y,
                                              z = above.z + sign_info.delta.z}, "signs:text")
        text:setyaw(sign_info.yaw)

      itemstack:take_item()
        return itemstack
    end,
    on_construct = function(pos)
        construct_sign(pos)
    end,
    on_destruct = function(pos)
        destruct_sign(pos)
    end,
    on_receive_fields = function(pos, formname, fields, sender)
        update_sign(pos, fields, sender)
    end,
   on_punch = function(pos, node, puncher)
      update_sign(pos)
   end,
})

minetest.register_node("signs:sign_yard", {
    paramtype = "light",
   sunlight_propagates = true,
    paramtype2 = "facedir",
    drawtype = "nodebox",
    node_box = {type = "fixed", fixed = {
        {-0.45, -0.15, -0.049, 0.45, 0.45, 0.049},
        {-0.05, -0.5, -0.049, 0.05, -0.15, 0.049}
    }},
    selection_box = {type = "fixed", fixed = {-0.45, -0.15, -0.049, 0.45, 0.45, 0.049}},
    tiles = {"signs_top.png", "signs_bottom.png", "signs_side.png", "signs_side.png", "signs_back.png", "signs_front.png"},
    groups = {choppy=2, dig_immediate=2},
    drop = "default:sign_wall",

    on_construct = function(pos)
        construct_sign(pos)
    end,
    on_destruct = function(pos)
        destruct_sign(pos)
    end,
    on_receive_fields = function(pos, formname, fields, sender)
        update_sign(pos, fields, sender)
    end,
   on_punch = function(pos, node, puncher)
      update_sign(pos)
   end,
})

minetest.register_entity("signs:text", {
    collisionbox = { 0, 0, 0, 0, 0, 0 },
    visual = "upright_sprite",
    textures = {},

    on_activate = function(self)
        local meta = minetest.env:get_meta(self.object:getpos())
        local text = meta:get_string("text")
        self.object:set_properties({textures={generate_texture(create_lines(text))}})
    end
})

-- CONSTANTS
local SIGN_WITH = 110
local SIGN_PADDING = 8

local LINE_LENGTH = 16
local NUMBER_OF_LINES = 4

local LINE_HEIGHT = 14
local CHAR_WIDTH = 5

string_to_array = function(str)
   local tab = {}
   for i=1,string.len(str) do
      table.insert(tab, string.sub(str, i,i))
   end
   return tab
end

string_to_word_array = function(str)
   local tab = {}
   local current = 1
   tab[1] = ""
   for _,char in ipairs(string_to_array(str)) do
      if char ~= " " then
         tab[current] = tab[current]..char
      else
         current = current+1
         tab[current] = ""
      end
   end
   return tab
end

create_lines = function(text)
   local line = ""
   local line_num = 1
   local tab = {}
   for _,word in ipairs(string_to_word_array(text)) do
      if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
         if line ~= "" then
            line = line.." "..word
         else
            line = word
         end
      else
         table.insert(tab, line)
         if word ~= "|" then
            line = word
         else
            line = ""
         end
         line_num = line_num+1
         if line_num > NUMBER_OF_LINES then
            return tab
         end
      end
   end
   table.insert(tab, line)
   return tab
end

generate_texture = function(lines)
    local texture = "[combine:"..SIGN_WITH.."x"..SIGN_WITH
    local ypos = 12
    for i = 1, #lines do
        texture = texture..generate_line(lines[i], ypos)
        ypos = ypos + LINE_HEIGHT
    end
    return texture
end

generate_line = function(s, ypos)
    local i = 1
    local parsed = {}
    local width = 0
    local chars = 0
    while chars < max_chars and i <= #s do
        local file = nil
        if charmap[s:sub(i, i)] ~= nil then
            file = charmap[s:sub(i, i)]
            i = i + 1
        elseif i < #s and charmap[s:sub(i, i + 1)] ~= nil then
            file = charmap[s:sub(i, i + 1)]
            i = i + 2
        else
            print("[signs] W: unknown symbol in '"..s.."' at "..i.." (probably "..s:sub(i, i)..")")
            i = i + 1
        end
        if file ~= nil then
            width = width + CHAR_WIDTH
            table.insert(parsed, file)
            chars = chars + 1
        end
    end
    width = width - 1

    local texture = ""
    local xpos = math.floor((SIGN_WITH - 2 * SIGN_PADDING - width) / 2 + SIGN_PADDING)
    for i = 1, #parsed do
        texture = texture..":"..xpos..","..ypos.."="..parsed[i]..".png"
        xpos = xpos + CHAR_WIDTH + 1
    end
    return texture
end

if minetest.setting_get("log_mods") then
   minetest.log("action", "signs loaded")
end


I hope that can help 2-3 people ^^
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: [Mod] Reworked signs from xyz [signs]

by kaeza » Thu Sep 25, 2014 01:35

davedevils wrote:Just i post a little edit of PilzAdam version :)

This edit is for multi-player , only the first people have write in sign can edit the same sign :) (like a sign protect)

-snip-

I hope that can help 2-3 people ^^

This mod is old and unmaintained. A more recent version can be found in homedecor_modpack (in the form of signs_lib).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal
 

User avatar
davedevils
Member
 
Posts: 52
Joined: Thu Sep 25, 2014 01:13
Location: France
GitHub: davedevils
IRC: davedevils
In-game: davedevils

Re: [Mod] Reworked signs from xyz [signs]

by davedevils » Thu Sep 25, 2014 01:38

too lot's of conflicts for me ^^ (and too fat i like make my self)
Maybe same for other people it's why i post this :)
 

User avatar
TenPlus1
Member
 
Posts: 2637
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Reworked signs from xyz [signs]

by TenPlus1 » Thu Sep 25, 2014 10:45

I was tinkering with PilzAdam's old signs mod a few weeks ago and came up with this, it has a yard, wall and hanging sign, uses a lightened version of the default_wood.png image and is nice and simple to use...
Attachments
signs_pilzadam(jkedit).zip
(24.53 KiB) Downloaded 91 times
 

User avatar
afflatus
Member
 
Posts: 319
Joined: Tue Apr 01, 2014 19:47
Location: Avalonia
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus

Re: [Mod] Reworked signs from xyz [signs]

by afflatus » Mon Feb 09, 2015 15:48

I am using the version from home decor, but I thought I'd post my questions here in the hope of getting PilzAdam or Kaeza's response.

I'd like to make the text image slightly smaller, but the code is so gnomic I don't dare attempt to mod it without advice. I can see how to reduce the number of characters per line, but how is the size of the PNG set in pixels?

4aiman - if you came up with a set of correctly mapped cyrillic character textures I'd be very grateful. As I'm sure you're aware, there is no good way of writing Russian in Latin script. It may require creating a separate signs:vyveska (or something) node, but I'll worry about that.
Grailtest is dreaming ...
 

User avatar
afflatus
Member
 
Posts: 319
Joined: Tue Apr 01, 2014 19:47
Location: Avalonia
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus

Re: [Mod] Reworked signs from xyz [signs]

by afflatus » Mon Feb 09, 2015 21:58

I managed to get acceptable results messing about with TEXT_SCALE and apologies for double-posting.
Grailtest is dreaming ...
 

snowflake
Member
 
Posts: 215
Joined: Mon Nov 16, 2015 16:50

Re:

by snowflake » Tue Nov 17, 2015 19:14

VanessaE wrote:PilzAdam: There is a new version of the font work we were doing on IRC. This one fixes some missing characters from my previous copy, and also fixes the messed up sizes and alignment of some characters. All eight font sets have been reworked accordingly.

http://digitalaudioconcepts.com/vanessa/hobbies/minetest/signs-textures-20121010-3.zip

(note the -3 in the filename)



is this a one which we have text normally seeing or its the default?
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 6 guests