[MOD] Jacob's Ladder [jacobs_ladder]

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

[MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Tue Mar 24, 2015 02:59

[MOD] Jacob's Ladder [jacobs_ladder]

original code by dgm5555
modified by Napiophelios rev-005

License: WTFPL v2

Depends: default

For Minetest 0.4.12

jacobs_ladder_rev005.zip
now an attached node for easier removal
(11.91 KiB) Downloaded 91 times


jacobs_ladder_rev004.zip
added Don's fixes for proper placement
(10.66 KiB) Downloaded 48 times


jacobs_ladder-rev002.zip
fixed typo
(10.59 KiB) Downloaded 62 times


This mod adds a 3D ladder to the game that will extend 5 nodes high each time it is punched.

Image

It will not destroy blocks in its path, however it will still place the nodes if there is empty space beyond the obstacles.

So basically you need a ceiling of 5 nodes thickness to stop the ladder from expanding.


Players can rotate with screwdriver 2 clicks and punch should work to destroy it (most of the time)
Tnt works pretty good too...

I dont have a craft recipe yet so you will have to use the giveme command to aquire it in the game.

+ License and credits


Image

EDIT:
-Fixed a typo in the lua file
-Added Don's Fix
-Added 'attached node=1' and "wallmounted" to node registration
Last edited by Napiophelios on Tue Sep 01, 2015 11:33, edited 4 times in total.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Don » Tue Mar 24, 2015 14:36

Nice idea.
I noticed that you can not destroy the ladder because it keeps placing more.
If you add get weilded item then the player has to hold the ladder when punching to make it grow.

Change line 48 to
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
      if node.name == "jacobs_ladder:ladder" and
    puncher:get_wielded_item():get_name() == "jacobs_ladder:ladder"then
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Tue Mar 24, 2015 15:35

Don wrote:Nice idea.
I noticed that you can not destroy the ladder because it keeps placing more.
If you add get weilded item then the player has to hold the ladder when punching to make it grow.

Change line 48 to
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
      if node.name == "jacobs_ladder:ladder" and
    puncher:get_wielded_item():get_name() == "jacobs_ladder:ladder"then


Thanks Don, Its no longer a cursed item!
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Don » Tue Mar 24, 2015 16:45

I hope you don't mind me helping. I am not good with lua but like to help when I can.

To get the ladders to face the right direction you can do this
Change line 86 from
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
function growblock(blockName, targetHeight, pos)

to 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
function growblock(blockName, targetHeight, pos, puncher)


And then you change line 93 from
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.env:add_node(p, {name=blockName})

to 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
minetest.env:set_node(p, {name = "jacobs_ladder:ladder", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Tue Mar 24, 2015 21:10

I dont mind the help at all..I need all I can get !

But if you make those changes to the lua it crashes game;
you also have to change line 52
from: growblock(node.name, targetHeight, pos)
to: growblock(node.name, targetHeight, pos, puncher)

But I dont see any differance myself in how the node is placed;
so long as its an open area they go right where I want them with and without the changes.

But when in a single node open shaft where its cramped, placement is kinda messed up
with and without the changes.

I will keep testing these changes though.

Thanks for the help man!
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Don » Tue Mar 24, 2015 22:04

Napiophelios wrote:I dont mind the help at all..I need all I can get !

But if you make those changes to the lua it crashes game;
you also have to change line 52
from: growblock(node.name, targetHeight, pos)
to: growblock(node.name, targetHeight, pos, puncher)

But I dont see any differance myself in how the node is placed;
so long as its an open area they go right where I want them with and without the changes.

But when in a single node open shaft where its cramped, placement is kinda messed up
with and without the changes.

I will keep testing these changes though.

Thanks for the help man!

I did it to my copy and it worked fine. The ladders are placed in the direction that you are facing.
I am using the latest minetest dev from 2 days ago. The version shouldn't matter.

Here is my copy.
https://www.dropbox.com/s/1hl4al4xn38qw6t/jacobs_ladder.zip?dl=0
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Tue Mar 24, 2015 22:25

Haha you forgot to mention you changed line 52 in your instructions :)

Anyways,it works the same for me with or without the additional code you provide.
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Don » Tue Mar 24, 2015 23:42

That's weird. They facedir properly for me. Maybe someone that knows more than me can make it work.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Wed Mar 25, 2015 00:53

Okay I think I see what you are talking about now.
I have updated with your code changes in revision 004.
Thanks Don.
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [MOD] Jacob's Ladder [jacobs_ladder]

by Napiophelios » Sun Apr 19, 2015 05:59

Mod Updated

just some small changes to the node registration
-is now an attached node (for easier removal)
-wallmounted param added for better placement
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 4 guests

cron