[Mod] Deploy Nodes [deploy_nodes] nodes that turn into big structures

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

[Mod] Deploy Nodes [deploy_nodes] nodes that turn into big structures

by cornernote » Wed Sep 26, 2012 01:35

Deploy Nodes for Minetest

Craftable nodes that when placed turn into shapes or structures.

Documentation | GitHub Project

Requirements

Image

About

This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching Earthlings, a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.

Credits

mauvebic - author of multinode which provided code for spheres and cylinders
Echo - author of maze which provided code for spheres
Temperest - autory of worldedit which provided code for pyramids
neko259 - author of livehouse which inspired building spawning
VanessaE - contributed buildings
kddekadenz - contributed buildings
ACDC - contributed buildings
Nanuk - contributed buildings
irksomeduck - contributed buildings

License

BSD-3-Clause, Copyright © 2014 Brett O'Donnell
Last edited by cornernote on Tue Apr 08, 2014 05:30, edited 1 time in total.
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 07:10

+1

pls add a simple example how to use this, makes it much easier to understand. like a short code example to crate a wood sphere with your function deploy_sphere ...

i think this has a big potential
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 07:42

its not really indended to call the shape function in lua, its more intended that you craft a sphere node, like this:

Code: Select all
-M-   M=dirt/wood/brick/cobble/stone/glass
MMM   make bigger spheres by using small spere as the material
-M-


then you place it, and you get a sphere.

if you want to make a sphere using an API, worldedit will be better
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 07:54

hmmmm...

whatever i try i got the message when i try to placed a small cobble sphere

no room to build because deploy_sphere:cobble_small is in the way at ( y = 14, x =37, z =-2)

there is plenty of room so i really dont know waht to do
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 08:02

it thinks itself is in the way, i'll check
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 08:03

thanks...
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02
 

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

by VanessaE » Wed Sep 26, 2012 08:16

The suggested wood and glass sphere recipes conflict with round wood and glass tables in Homedecor, just FYI :-)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 08:22

working now...thx for the fast fix
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 08:29

maze and cylinder works too.... lots of work now to remove that from my map again *lol*

how do i use the buliding? i see examples but dont know to place them...

for example, how do i place the 12.we from the small buildings file into my world ?
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 08:31

the only thing you can choose is small, medium or large... the actual building is random

if you want 12.we to appear then you would have to remove all the other *.we files from that folder
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 08:53

okay now check everything and its working, just some probs with the large building, cause i dont finde space to place that...

a suggestion from my side:
maybe its possible to choose a building with a kind of function. maybe have different recipies (paper or craftplan) so its possible to choose the building you want.
so you have a block for a bulding (small, medium, big) and then add a craftplan to choose the type of house.

anyway its a gread tool for minetest, somebody should programm a editor for the building.... i guess when i start doing this a lot of ppl are again faster then me....hehehe...
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 09:11

i was thinking about a mod to add to this pack that kindof does that... very much the same as the deploy_building mod, except it does not auto-deploy. you have to right click it (it opens like a chest), and there is a button added for each building found in the folder. you click which one you want, it checks space then builds
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 09:25

sounds good, maybe you add a kind of function to organize buildings so its easy to add more buildings of the *we type.
maybe a textfile where the buildingstypes can be added. so at the start this file is read and then all availible builldingtypes.

in this way you dont need 3 different folders...

also you should check what kind of building type is placed, just imagine somebody take a big building in the small building folder, i am not sure how the checking works for the space... maybe thiss could be a problem.

can you pls explain the format of the *we fille a bit more..

-1 0 -1 default:wood 0 0 <= thats to place one block whats the 0 0 behind the wood ?
++++ Kung walang tiyaga, walang nilaga. ++++
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 09:34

its even easier than that, no txt file needed... just put them in the folder and they will be detected and made into a button on the deploy node

the 0 0 is param1, param2

eg:

local node = {}
node.name = name
node.param1 = param1
node.param2 = param2
minetest.env:add_node(pos, node)


Oh, i should note... you make *.we files using worldedit mod. =)
Last edited by cornernote on Wed Sep 26, 2012 09:36, edited 1 time in total.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 10:13

added spiral and fixed recipies (see homepage)
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 10:19

cornernote wrote:i was thinking about a mod to add to this pack that kindof does that... very much the same as the deploy_building mod, except it does not auto-deploy. you have to right click it (it opens like a chest), and there is a button added for each building found in the folder. you click which one you want, it checks space then builds


i have had a think about this and decided i probably wont do it. if you want to load a specific building in a specific place then worldedit is probably better.
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Sep 26, 2012 10:20

so fast ...WOOWOOOO....blueprint i love this idea...

sadly no time today anymore to test this

gud job !!!!
++++ Kung walang tiyaga, walang nilaga. ++++
 

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

by Ragnarok » Wed Sep 26, 2012 11:57

Could you implement... cones? 4:1, 3:1, 2:1, 1:1, 1:2, 1:3, 1:4 height to diameter ratios.
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Wed Sep 26, 2012 12:04

Great job!
You could add the braid-maze code (a few lines to detect dead ends and open some of them) to make it harder to get out of the maze. With the "simple" maze you just have to keep right to get out.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 12:24

Hi echo, that maze code is too hardcore, I just skipped over most of it and prayed it worked. Would you be able to put that change in?
 

User avatar
Echo
Member
 
Posts: 121
Joined: Tue Jul 31, 2012 08:11
Location: Germany

by Echo » Wed Sep 26, 2012 14:11

I think there are three changes:
1. two more variables to detect dead ends (two new lines)
old:
Code: Select all
        local pos = {x = 0, y = 0, l = 0}
        table.insert(moves, {x = pos_x, y = pos_y, l = pos_l})

new:
Code: Select all
        local pos = {x = 0, y = 0, l = 0}
        local forward = true
        local dead_end = {}
        table.insert(moves, {x = pos_x, y = pos_y, l = pos_l})


2. set generation direction "forward" (one new line)
old:
Code: Select all
            if #possible_ways > 0 then
                direction = possible_ways[math.random(# possible_ways)]

new:
Code: Select all
            if #possible_ways > 0 then
                forward = true
                direction = possible_ways[math.random(# possible_ways)]


3. dectect dead ends and remove them if possible with 20% chance (math.random(5) == 1 -- 100% would be too easy again)
old:
Code: Select all
            else
                pos = table.remove(moves)
                pos_x = pos.x
                pos_y = pos.y
                pos_l = pos.l
            end
        until pos_x == start_x and pos_y == start_y

-- create exit on opposite end of maze and make sure it is reachable

new:
Code: Select all
            else -- there is no possible way forward
                if forward then -- the last step was forward, now back, so we're in a dead end
                    -- mark dead end for possible braid
                    if not maze[pos_l][pos_x - 1][pos_y] then -- dead end to E, only way is W
                        table.insert(dead_end, {x = pos_x, y = pos_y, l = pos_l, dx = 1, dy = 0})
                    elseif not maze[pos_l][pos_x + 1][pos_y] then -- dead end to W, only way is E
                        table.insert(dead_end, {x = pos_x, y = pos_y, l = pos_l, dx = -1, dy = 0})
                    elseif not maze[pos_l][pos_x][pos_y - 1] then -- dead end to S, only way is N
                        table.insert(dead_end, {x = pos_x, y = pos_y, l = pos_l, dx = 0, dy = 1})
                    elseif not maze[pos_l][pos_x][pos_y + 1] then -- dead end to N, only way is S
                        table.insert(dead_end, {x = pos_x, y = pos_y, l = pos_l, dx = 0, dy = -1})
                    end
                    forward = false
                end
                pos = table.remove(moves)
                pos_x = pos.x
                pos_y = pos.y
                pos_l = pos.l
            end
        until pos_x == start_x and pos_y == start_y
-- create partial braid maze, about 20%
        for _, braid_pos in pairs(dead_end) do
            -- print(braid_pos.x.."/"..braid_pos.y.."/"..braid_pos.l.." "..braid_pos.dx.."/"..braid_pos.dy)
            x = braid_pos.x + braid_pos.dx * 2
            y = braid_pos.y + braid_pos.dy * 2
            if math.random(5) == 1 and x > 0 and x < maze_size_x - 1 and y > 0 and y < maze_size_y - 1 and not maze[braid_pos.l][x][y] then
                -- remove wall if behind is corridor with 20% chance
                maze[braid_pos.l][braid_pos.x + braid_pos.dx][braid_pos.y + braid_pos.dy] = false
                -- print("removed "..braid_pos.l.."/"..braid_pos.x + braid_pos.dx.."/"..braid_pos.y + braid_pos.dy)
            end
        end
-- create exit on opposite end of maze and make sure it is reachable


Maybe it would be better to make it braid only for medium and large mazes. For small mazes it could open too many ways to the exit instead of confusing the player.
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Wed Sep 26, 2012 19:30

I added it, and I made it only do it if the size is above 15 (which means only medium and large). Havent tested it yet but will try later on today.

Thanks for the help with the maze code!

p.s. I would also like to see the maze code added to WorldEdit. Are you interested in doing that?
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Sep 27, 2012 06:35

added more buildings, screenshots on homepage
 

cornernote
Member
 
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Thu Sep 27, 2012 13:03

added deploy_pyramid and created some initial textures (better than nothing)
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 9 guests