Page 1 of 2

Secret Passages! :D

PostPosted: Fri Dec 30, 2011 20:08
by Gatharoth
Want to hide your treasury? Want to make your house/castle/home look smaller than it really is? Well come try this simple mod! XP Haha, okay okay. Enough joking around.

Anyway, this is a simple mod that will create false wall, which you can pass through, but not see through. :D

Default False Nodes:
  • Dirt
  • Brick
  • Cobble
  • Wood
  • Sand
  • Stone
  • Tree
  • Glass
  • Jungle Tree
  • Mossy Cobble
  • Mese
  • Steel Block
  • Sand Stone
  • Gravel
  • Clay
  • Cactus
  • Papyrus
  • Bookshelf
  • Desert Stone
  • Desert Sand

Crafting:
C X C

C = component
X = What ever node you want to false-a-fy

Component:
G G G
G D G
G G G

G = Glass
D = Dirt.


Other Modders! If you want to add a node to become a false node, use this code

Registering:
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
register_secret_passage(modname, yournodename, yournode, drawtype)

Example:
register_secret_passage("secret_passage", "cobble", 'secret_passage:cobble', 'normal')


Download Zip
Download Here

Known Problems:

Unsolved:
  • Minor error with textures when using fake glass with real glass.

Solved:

Updates:

2012/7/3
  • Added desert stone and sand
  • Updated code for current version.
  • All false blocks are instantly destructible.
  • Increased glass required to craft components
  • Decreased components required to make false blocks

2012/02/04
  • Added more nodes, probably some that won't be used.
  • Made possible for other mods to add nodes to become false nodes as well.
  • Fix for bugs thanks to Kahrl_


2012/02/12
  • Added drawtype definition for other modders
  • Manually registered fake glass to avoid errors.

PostPosted: Fri Dec 30, 2011 20:19
by Hackeridze
Good job! But recipe... Is not so god as can be.

PostPosted: Fri Dec 30, 2011 20:19
by rahonejm
TRAPS! Awesome mod!

PostPosted: Fri Dec 30, 2011 20:39
by Gatharoth
Hackeridze wrote:Good job! But recipe... Is not so god as can be.


You can change them. They were just something I threw together quickly.

PostPosted: Fri Dec 30, 2011 20:43
by rahonejm
you should try doing a especial block for false things, like a transparent block or something like that... Then, instead of using wood blocks, use the special one!

PostPosted: Fri Dec 30, 2011 20:44
by Gatharoth
rahonejm wrote:you should try doing a especial block for false things, like a transparent block or something like that... Then, instead of using wood blocks, use the special one!

Hmmm :D good idea!

PostPosted: Fri Dec 30, 2011 21:28
by Gatharoth
Updated mod.

PostPosted: Fri Dec 30, 2011 21:41
by sfan5
i like this Mod!

PostPosted: Fri Dec 30, 2011 22:41
by rahonejm
hell yeah now is fu###n awesome!

PostPosted: Sat Dec 31, 2011 05:49
by Jeija
Great Idea! +1

PostPosted: Sat Dec 31, 2011 11:37
by redcrab
I love it , but I guess you should use the default texture and not a copy of default texture. by this way secret passage stay secret even after customization of the default textures
may be there is a constraint that avoid a mod can't use texture from another mod ?

Great idea .

PostPosted: Sat Dec 31, 2011 15:57
by RAPHAEL
Excellent mod but came across some issues.

When you make something like say a hidden bookshelf, make sure there is no light coming from behind it or above it or someone will spot that it is brighter than the other bookshelves.

PostPosted: Sat Dec 31, 2011 19:15
by Gatharoth
redcrab wrote:I love it , but I guess you should use the default texture and not a copy of default texture. by this way secret passage stay secret even after customization of the default textures
may be there is a constraint that avoid a mod can't use texture from another mod ?

Great idea .


Well, the reason why I used a customization of the default textures, is so that way, it can be seen as a different type of block. Think about it, in most games, when there's a false wall, it is generally a little bit different in texture from the real wall next to it. So that's what I was aiming for.

RAPHAEL wrote:Excellent mod but came across some issues.

When you make something like say a hidden bookshelf, make sure there is no light coming from behind it or above it or someone will spot that it is brighter than the other bookshelves.


Yeah, this is my first attempt at a mod, I don't have all the attributes down yet. So there is probably something I added, or didn't change that does/caused that.

PostPosted: Sat Jan 07, 2012 00:31
by rahonejm
hey, can you make a false sand block? The one that looks like a wood, but colored like a sand? I'm making a pyramid and would like to make some traps ;D
I've tried to do it by myself, copying your code and substituting the names... but it didn't work :(

PostPosted: Sat Jan 07, 2012 14:45
by sdzen
Gatharoth wrote:
redcrab wrote:I love it , but I guess you should use the default texture and not a copy of default texture. by this way secret passage stay secret even after customization of the default textures
may be there is a constraint that avoid a mod can't use texture from another mod ?

Great idea .


Well, the reason why I used a customization of the default textures, is so that way, it can be seen as a different type of block. Think about it, in most games, when there's a false wall, it is generally a little bit different in texture from the real wall next to it. So that's what I was aiming for.

you could put a one pixel watermark on the corner such as this
Image
of course maybe less evident
BTW that is a false sand block!

PostPosted: Sat Jan 07, 2012 17:52
by Gatharoth
@Rahonejm
Why didn't it work?
All you need to do is use this code, and replace the names and image.
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
minetest.register_node('somenode', {
    drawtype = 'allfaces',
    tile_images = {'someimage.png'},
    inventory_image = 'someimage.png',
    sunlight_propagates = false,
    paramtype = 'light',
    walkable = false,
    climable = false,
    selection_box = {
        type = "fixed",
        fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
    },
    material = minetest.digprop_constanttime(1.0),
    dug_item = 'NodeItem "somenode" 1',
})

If you still can't get it to work, then I'll make one. But for now I'm working on some code for Mesecon.

@sdzen
A watermark like that would be too visible for me tastes.

Also, those "false sand" blocks do not look like blocks, just 1-sided nodes. FYI (for your information).

PostPosted: Sat Jan 07, 2012 18:24
by sdzen
about the sand I know I was just messing around with your mod bored out of my mind one day altering random stuff

PostPosted: Sat Jan 07, 2012 22:23
by rahonejm
Well, don't know what, but i'm doing something wrong. Here's what i've did:

minetest.register_node('secret_passage:sand', {
drawtype = 'allfaces',
tile_images = {'sp_sandstone.png'},
inventory_image = 'sp_sandstone.png',
sunlight_propagates = false,
paramtype = 'light',
walkable = false,
climable = false,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},

But then, i need a recipe huh?

minetest.register_craft({
output = 'NodeItem "secret_passage:sand" 1',
recipe = {
{'node "secret_passage:compoent" 1', 'node "default:sandstone" 1', 'node "secret_passage:compoent" 1'},
{'node "secret_passage:compoent" 1', 'node "default:sandstone" 1', 'node "secret_passage:compoent" 1'},

What happens:

ERROR[main]: ModError: Failed to load and run C:\Documents and Settings\Marcelino\Meus documentos\Downloads\minetest-0.4.dev-20120102-1-win32\bin\..\data\mods\secret_passage\init.lua
20:17:18: ERROR[main]: error_message = ModError: Failed to load and run C:\Documents and Settings\Marcelino\Meus documentos\Downloads\minetest-0.4.dev-20120102-1-win32\bin\..\data\mods\secret_passage\init.lua

P.S I've copied the default_sandstone and pasted it on the textures folder, then renamed it sp_sandstone

PostPosted: Sat Jan 07, 2012 22:51
by Gatharoth
You need to close the register. So after
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
    selection_box = {
        type = "fixed",
        fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},


add this
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
    },
    material = minetest.digprop_constanttime(1.0),
    dug_item = 'NodeItem "secret_passage:sand" 1',
})

PostPosted: Sun Jan 08, 2012 02:18
by rahonejm
Gatharoth wrote:You need to close the register. So after
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
    selection_box = {
        type = "fixed",
        fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},


add this
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
    },
    material = minetest.digprop_constanttime(1.0),
    dug_item = 'NodeItem "secret_passage:sand" 1',
})


My god i'm definetly not a minetest modder... I still can't make it work :(

PostPosted: Sun Jan 08, 2012 04:08
by Gatharoth
This code should work. Just copy it and paste it below the register_node for the component (compoent due to my spelling error that I never fixed).

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
minetest.register_node('secret_passage:sand', {
    drawtype = 'allfaces',
    tile_images = {'sp_sandstone.png'},
    inventory_image = 'sp_sandstone.png',
    sunlight_propagates = false,
    paramtype = 'light',
    walkable = false,
    climable = false,
    selection_box = {
        type = "fixed",
        fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
    },
    material = minetest.digprop_constanttime(1.0),
    dug_item = 'NodeItem "secret_passage:sand" 1',
})
minetest.register_craft({
    output = 'NodeItem "secret_passage:bookshelf" 1',
    recipe = {
        {'node "secret_passage:compoent" 1', 'node "default:sandston" 1', 'node "secret_passage:compoent" 1'},
        {'node "secret_passage:compoent" 1', 'node "default:sandstone" 1', 'node "secret_passage:compoent" 1'},
    },
})

PostPosted: Sun Feb 05, 2012 06:31
by Gatharoth
Updated:
Added more default nodes
False defaults use same image as real defaults
Made possible for other mods to create false version of nodes.

PostPosted: Sun Feb 05, 2012 07:49
by Gatharoth
Update:
Bug fixes thanks to Kahrl

PostPosted: Mon Feb 13, 2012 01:02
by Gatharoth
Updated:
Changed registering parameters
Manually register glass to avoid errors.

PostPosted: Tue Feb 14, 2012 00:07
by IPushButton2653
All this is is changing walkable = true to walkable = false. But he had the intuition to make it. Well done sir

PostPosted: Tue Feb 14, 2012 18:49
by Gatharoth
IPushButton2653 wrote:All this is is changing walkable = true to walkable = false. But he had the intuition to make it. Well done sir


Haha. Thanks I think? If anything, I'm just an Idea Factory.

Besides, when I was younger, I loved to draw out dungeons, and castles that were full of traps, secret passages, hidden treasures, ect. This was caused by my uncle who play(s/ed) DnD. But yeah, my dungeons and castles were more elaborate, and "more suited" for a game of DnD than any of his were, or so he told me. XD

PostPosted: Sat Mar 24, 2012 17:57
by SelfishCar
ERROR[main]: error_message = ModError: Failed to load and run C:\Documents and Settings\Charlotta\Mina dokument\Downloads\minetest-0.4.dev-20120122-1-win32 (1)\minetest-0.4.dev-20120122-1-win32\bin\..\data\mods\secret_passage\init.lua
18:55:00: ERROR[main]: Check debug.txt for details.


Any help here?

PostPosted: Sun Mar 25, 2012 02:53
by bgsmithjr
open minetest/bin/debug.txt look for a block of text
[ SOMETHING LUA ERROR]
text text
text
[ END OF LUA ERROR ]
and post the text here.

PostPosted: Sun Mar 25, 2012 14:19
by SelfishCar
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
18:58:19: ERROR[main]: [LUA]
18:58:19: ERROR[main]: [LUA] ...netest-0.4.dev-20120122-1-win32\bin\..\data\mods\secret_passage\init.lua:64: ')' expected near 'typename'
18:58:19: ERROR[main]: [LUA]


Is this right?

PostPosted: Sun Apr 01, 2012 05:01
by Gatharoth
SelfishCar wrote:
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
18:58:19: ERROR[main]: [LUA]
18:58:19: ERROR[main]: [LUA] ...netest-0.4.dev-20120122-1-win32\bin\..\data\mods\secret_passage\init.lua:64: ')' expected near 'typename'
18:58:19: ERROR[main]: [LUA]


Is this right?


I believe there's typo problems currently. So with your problem, just open up the init.lua, then scroll down to the "minetest.register_node(modname" line. In that line put ".." in front of the "typename," and it should be fine.

Sorry for those little mistakes. I've been busy for awhile now. Haven't been able to work on anything for minetest.