Page 1 of 1

[Mod] Fences [1.0] [fences]

PostPosted: Thu Mar 07, 2013 13:52
by BlockMen
Hi everyone,

this mod implements Fences like known from Minecraft.

Differences (to default Fence):
- new look
- connects to a neighbour Block
- introduces Fencegates
- NEW: impossible to jump over Fence and closed Fencegate

Screenshot:
Image
Although the Fence acts like 1.5 Blocks, you can still build on it.


Recipes:
This mod "overrides" the recipe for the default fence, so when crafting THIS fence will be crafted.
The Fencegate is crafted this way:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
stick    wood    stick
stick    wood    stick


Notice:
-This mod does not(!) replace automatically the default fence.
-If you want replace already placed default fences open the "init.lua" and change
the first line to "local override_original = true". Then all placed default fences will be replaced with this fence.

Depends:
default

Info: If you have installed the "Doors mod" the fencegate also has opening/closing sounds.

Download:
Version 1.0: current Release

Version 0.2: beta
Version 0.1: first version
Notice: works with Minetest 0.4.5

License:
WTFPL


Please give Feedback and ideas for improvement

PostPosted: Thu Mar 07, 2013 14:05
by Evergreen
+1

PostPosted: Thu Mar 07, 2013 14:31
by Likwid H-Craft
Should Minetest Fences have, some new cool addons Minecraft don't have?

PostPosted: Thu Mar 07, 2013 15:10
by deivan
Nice

PostPosted: Fri Mar 08, 2013 17:13
by jordan4ibanez
that's neat, thexyz has done this but I think yours looks a little better

PostPosted: Fri Mar 08, 2013 20:01
by 4aiman
This version has it's problems: http://youtu.be/f-Y7XvVeIIk

PostPosted: Fri Mar 08, 2013 22:58
by Mito551
4aiman wrote:This version has it's problems: http://youtu.be/f-Y7XvVeIIk


facedir done wrong :D

PostPosted: Sat Mar 09, 2013 12:03
by BlockMen
4aiman wrote:This version has it's problems: http://youtu.be/f-Y7XvVeIIk


Thanks, that was a great feedback! ;)
It is fixed now in Version 0.2


Mito551 wrote:
4aiman wrote:This version has it's problems: http://youtu.be/f-Y7XvVeIIk


facedir done wrong :D


Wow, how brilliant -.-'

PostPosted: Sat Mar 09, 2013 12:04
by BlockMen
Version 0.2 released.
Changelog:
-Fencegates open like Doors in Minetest 0.4.5 (rightclick)
-Fixed direction when placing Fencegate
-Fixed "opening-problem" of Fencegates

PostPosted: Sat Mar 09, 2013 13:04
by 4aiman
I still have problems with direction of fencegates...
Also It would be nice to have fences that will connect to other blocks - like xfences.

PostPosted: Sat Mar 09, 2013 21:38
by BlockMen
4aiman wrote:I still have problems with direction of fencegates...
Also It would be nice to have fences that will connect to other blocks - like xfences.


The same problems like before?? If not another vid would be great...

And the fences connect to other blocks:
BlockMen wrote:...
Screenshot:
Image
You can see the connection to the neighbour block and an open fencegate.
...


But not to every type of block ;) So if you are missing a type, please write here .

PostPosted: Sun Mar 10, 2013 03:38
by GloopMaster
So basically your fences are like xfences but more picky. Seems legit.

PostPosted: Sun Mar 10, 2013 04:47
by johnbone
+1

PostPosted: Wed Mar 13, 2013 18:59
by BlockMen
GloopMaster wrote:So basically your fences are like xfences but more picky. Seems legit.


As far i know xFences has no Fencegates and a different look.

PostPosted: Tue Mar 19, 2013 19:19
by Bas080
Good mod, I prefer the look of these over the default. The sound that you get when including your doors mod that has working steel door that supports mesecons. This is a combo must have. Should be in default.

PostPosted: Mon Mar 25, 2013 18:28
by BlockMen
Version 1.0 released.
Changelog:
- Fences and closed Fencegates can't be jumped over anymore.

Although the Fences acts like a 1.5 high Block it is still possible to build any Block, torches, or whatever upon it. (See screenshot)

PostPosted: Sun Nov 17, 2013 21:06
by Johnyknowhow
Great, I love it

Re: [Mod] Fences [1.0] [fences]

PostPosted: Thu Jan 22, 2015 14:47
by gumangel
is there any way to make it connect to other blocks beside wood? it a really nice mod,but also idk why my fences dont replace even that i placed true in the ini....it replces it only when u craft it? and not in the creative menu?

Re: [Mod] Fences [1.0] [fences]

PostPosted: Thu Jan 22, 2015 18:14
by Krock
gumangel wrote:is there any way to make it connect to other blocks beside wood?

No, this is a limitation in the engine. But it's possible to connect one fence type to another.

EDIT:
If it's possible to connect to other cubic nodes, then it's an ugly hack.

Re: [Mod] Fences [1.0] [fences]

PostPosted: Thu Jan 22, 2015 18:21
by gumangel
Krock wrote:
gumangel wrote:is there any way to make it connect to other blocks beside wood?

No, this is a limitation in the engine. But it's possible to connect one fence type to another.

EDIT:
If it's possible to connect to other cubic nodes, then it's an ugly hack.

thank you,i found a way to connect other blocks to fences,just : -connect a fence to a plank,-remove plank,-place another block,but still thank you :) God bless you!

Re: [Mod] Fences [1.0] [fences]

PostPosted: Thu Jan 22, 2015 21:27
by 4aiman
Don't listen to Krock - he doesn't know what he's talking about. He even used "if".
There's nothing "ugly" OR "hacky" in checking the drawtype of a node.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if nodename == "default:wood" or nodename == "default:brick" or nodename == "default:cobble" or nodename == "default:dirt" or nodename == "default:sandstone" or nodename == "default:stone" or string.find(nodename, "fences:fence_wood") or string.find(nodename, "fences:fencegate") then
        return true
    end
end


Just change all that conditions to smth like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if (minetest.registered_nodes[nodename] and minetest.registered_nodes[nodename].drawtype=='normal')
    or nodename:find("fence_wood")
    or nodename:find("fencegate") then
        return true
    end
end


Edit:
One may even search for "fences:"
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if (minetest.registered_nodes[nodename] and minetest.registered_nodes[nodename].drawtype=='normal')
    or nodename:find("fences:") then
        return true
    end
end

Re: [Mod] Fences [1.0] [fences]

PostPosted: Fri Jan 23, 2015 10:28
by gumangel
4aiman wrote:Don't listen to Krock - he doesn't know what he's talking about. He even used "if".
There's nothing "ugly" OR "hacky" in checking the drawtype of a node.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if nodename == "default:wood" or nodename == "default:brick" or nodename == "default:cobble" or nodename == "default:dirt" or nodename == "default:sandstone" or nodename == "default:stone" or string.find(nodename, "fences:fence_wood") or string.find(nodename, "fences:fencegate") then
        return true
    end
end


Just change all that conditions to smth like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if (minetest.registered_nodes[nodename] and minetest.registered_nodes[nodename].drawtype=='normal')
    or nodename:find("fence_wood")
    or nodename:find("fencegate") then
        return true
    end
end


Edit:
One may even search for "fences:"
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local function dockable(nodename)
    if (minetest.registered_nodes[nodename] and minetest.registered_nodes[nodename].drawtype=='normal')
    or nodename:find("fences:") then
        return true
    end
end

thank you really much! God bless you! your really good with programing,just like the other modders over here,it really amaze me.

Re: [Mod] Fences [1.0] [fences]

PostPosted: Wed Sep 23, 2015 10:40
by Echoes91
Since default_fence.png seems to not exist anymore or have been replaced (I don't know how it was before 0.4.12), I suggest this addition to follow the new default's fences definition:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"

then replace all inventory and weld images:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
inventory_image = fence_texture,
wield_image = fence_texture,