[mod]Chains Mod [1.1][chains]

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

[mod]Chains Mod [1.1][chains]

by Doc » Wed Nov 14, 2012 22:03

This mod adds chains which can be climbed.

Dependencies: default

Licence: WTFPL

Downloads:
Version 1.1:Download


Image

Chain Top:
Image

Chain:
Image

Chandelier:
Image

Recipes:

Chain Link (chains:chain)
Image

Chain Top: (chains:chain_top)
Image

Chandelier (as of 1.1):
Image
Last edited by Doc on Mon Jul 07, 2014 07:31, edited 3 times in total.
 

User avatar
nomohakon
Member
 
Posts: 218
Joined: Fri Aug 10, 2012 16:34
Location: VanessaE's servers
IRC: nomohakon
In-game: nomohakon

by nomohakon » Wed Nov 14, 2012 23:41

Nice!
"To learn who rules over you, simply find out who you are not allowed to criticize." - Voltaire
"Knowledge, like air, is vital to life. Like air, no one should be denied it." - Alan Moore, V for Vendetta
- - -
"To never die... and to conquer all, that is winning." ―Illyria
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Wed Nov 14, 2012 23:42

Thanks! I have little ideas, and I make em into a quick mod. Eventually, I want to make a big mod though.
 

User avatar
InfinityProject
Member
 
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Wed Nov 14, 2012 23:47

Instead of crafting the individual chains you may like this:
Code: Select all
function chain(pos, node)
if node.name == "chains:chain_top" then
minetest.env:add_node(pos.x,pos.y-1,pos.x{name="chains:chain"})
minetest.env:add_node(pos.x,pos.y-2,pos.x{name="chains:chain"})
minetest.env:add_node(pos.x,pos.y-3,pos.x{name="chains:chain"})
end
end
minetest.register_on_placenode(chain)


What it does is when chains:chain_top is placed, 3 chains are added underneath it.
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Wed Nov 14, 2012 23:52

Yeah, that sounds like a good idea. I still want there to be the ability to place single chain tops though. This gave me the idea of a chain roll item which uses this function! Perhaps I will add something like this in the next version or so. Thanks for the idea!
 

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

by VanessaE » Thu Nov 15, 2012 04:52

InfinityProject, you'll also need to check for the presence of air just before each of those add_node() calls, otherwise you could easily end up replacing dirt, stone, or part of a building.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Thu Nov 15, 2012 15:46

Thanks VanessaE,
I was just about to borrow this code. I will be sure to add this.

Edit:
Here is my code:
Code: Select all
minetest.register_craftitem("chains:roll", {
    description = "Roll of chains",
    inventory_image = "Chains_roll.png",
    on_place_on_ground = function chain(pos, node)
           
            if node.name == "default:air" then
            minetest.env:add_node(pos.x,pos.y-1,pos.x                    {name="chains:chaintop"})
            end
            if node.name == "default:air" then
            minetest.env:add_node(pos.x,pos.y-2,pos.x                    {name="chains:chain"})
            end
            if node.name == "default:air" then
            minetest.env:add_node(pos.x,pos.y-3,pos.x                    {name="chains:chain"})
            end
}),

I think I am doing something wrong on check for air... Can someone fix my code? This is basically an item that places chain when you use it.

Edit: Actually, I think I am doing this all wrong. Please help me out!
Last edited by Doc on Thu Nov 15, 2012 16:20, edited 1 time in total.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Thu Nov 15, 2012 17:18

First off you need to take a look at your register with minetest. Do you want the roll to act like a node where it is placeable like dirt or stone or do you want it to be treated much like placing a tool on the ground where it becomes an entity. Either one can be crafted by recipes but each has there own events that fires by minetest. I am not sure if on_place_on_ground is a registered event since I don't have the lua api with me since I am in class right now.

Moving into the code, with a event function you don't need to name it anything.
Code: Select all
trigger event = function(pos, node)

is acceptable.
To add a node to minetest
Code: Select all
pos = {x=value, y=value, z=value}

You have the correct function and node declaration just change the pos declaration.

Now how to actually accomplish what you want it to do. I would use a while loop to check if the node below is air and if it is then place a chain.
Pseudocode:
Code: Select all
incremented y value outside while loop
while(node below is air) then
  add chain
end
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Sat Nov 17, 2012 05:04

Thanks ashenk69! I will look at the api to see if there is that function or something similar. I essentially want it to be a minetest.register_craftitem that when right clicked on a block, it spawns a chain top and two or three chain below it.

Edit: I found on_place... will this work for what I need, and is pointed_thing a pos item that can be accessed with pointed_thing:x, y, z?
Last edited by Doc on Sat Nov 17, 2012 05:06, edited 1 time in total.
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21

by Doc » Sat Nov 17, 2012 17:26

I have tried many things, but I just can't get it to work. Oh well, maybe later. For now I updated with chandeliers!
 

User avatar
webdesigner97
Member
 
Posts: 1323
Joined: Mon Jul 30, 2012 19:16
Location: Bergisch Gladbach, Germany
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Wed May 15, 2013 21:53

Overall- EPIC! The chandelier looks a little derpy though, maybe check out my Simply Candles mod for a slightly less derpy, however weedy and small looking chandelier. Still, epic mod!

Another thing, a suggestion. Maybe horizontal chains that can be used to cross lava, for example.

I have uploaded this mod with horizontal chains (they really work!) at:
https://www.dropbox.com/s/46sucqgmrqdwkhs/chains.zip

They go up diagonally like rails too!

Image of an example of flat Horizontal Chains
Image

My test code:
Code: Select all
minetest.register_node("chains:horizontalchain", {
    description = "Horizontal Chain",
    walkable = false,
    climbable = true,
    sunlight_propagates = true,
    paramtype = "light",
    drops = "",
    tile_images = { "Horizontal_chain.png" },
    drawtype = "raillike",
    groups = {cracky=3},
    sounds =  default.node_sound_stone_defaults(),
    })

Note: they don't connect properly at corners, but in real life a hanging chain would be straight anyway so it wouldn't matter.
Last edited by Dan Duncombe on Thu May 16, 2013 16:43, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

Sokomine
Member
 
Posts: 3648
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Thu May 16, 2013 03:10

There's the vines mod that also comes with a ropebox that auto-extends downwards. It has the drawtype plantlike and looks and works very well. I've wished for a horizontal version of that for some time.
A list of my mods can be found here.
 

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
 

User avatar
mimilus
Member
 
Posts: 75
Joined: Thu Mar 06, 2014 09:08
Location: France
GitHub: mimilus
IRC: Mimilus

by mimilus » Fri Apr 04, 2014 22:25

maybe there is a working link : https://github.com/Doc22/chains-mod
minetest 0.4.9
Ubuntu 12.04
 

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40
Location: Germany
 

Doc
Member
 
Posts: 75
Joined: Sun Nov 04, 2012 00:21
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 6 guests