Page 1 of 2

[Mod] Lifts [0.3.4] [lift]

Posted: Mon Mar 24, 2014 10:55
by portals
Hello
This is my first mod, still needs some work but already works. Their is no craft recipes now so to use it you have to use give command and get blocks:
lift:moveblock, lift:rail and a controller lift:control_up lift:control_down lift:control_stop
Description:
Add an simply elevator that can move the player.
License:LGPLv3
Depends: default
Textures by:John1 (WTFPL)
Download
Github

How to use:
First use /giveme to get: lift:rail, lift:moveblock_1, lift:rail_connector, lift:control_up, lift:control_down, lift:control_stop.
Now let's place blocks like in this screenshot:

Press up button to move elevator up, stop to stop it or press down to move it down.This is a simplest version of lift.


This is more advanced version:
screenshot_2867585685.png
screenshot_2867585685.png (768.8 KiB) Viewed 2264 times


Image
Image



Change log:
0.3 - 0.3.4
  • Small fixes
0.3:
  • Added a lift_moveblock_2 - can move objects other then players (but it is have bugs and require work )
  • Added a lift_moveblock - is now lift_moveblock_1
  • Between rail and moveblock must be lift:rail_connector
  • Not all moveblocks or rail_connectors must be connected to rail. Rail_connector work for 5 moveblocks default
0.2 - Big performance improve and small fix.
0.1 - First release

Know bug:
  • Block stuck if something is on it way and must be recreate.
  • Moving up is slower then moving down.

Posted: Mon Mar 24, 2014 12:43
by hoodedice
You need to rename the title of the post to:

[Mod]Lifts ["actual ingame name of mod"][0.1] - My first mod!! WIP

You also need to write the dependencies, or mods which need to be loaded for this mod to run. If there are no dependencies, then just write Depends: default.

Also,

Welcome to the Minetest Forums! =)

Nice mod! I see that you are already adept at modding =D

Enjoy your stay here ^.^

Posted: Mon Mar 24, 2014 15:38
by John1
Nice mod! Only problem is when going up, the block goes through me instead of lifting.

Anyway, here are some alternate textures:

Image
Image
Image
Image
Image

License is WTFPL

Posted: Mon Mar 24, 2014 16:24
by portals
You are playing single player or on server? What version on minetest you are using?
Moving player up use a bit dirty fix but it work pretty good for me on last git.
Can you checkthis version and give output from the console? You can also edit init.lua and try change

Code: Select all

if (dir == 2) then pos = {x=pos.x,y=pos.y+2,z=pos.z} end
to

Code: Select all

if (dir == 2) then pos = {x=pos.x,y=pos.y+3,z=pos.z} end
Thank you for textures, there are fantastic. I include it in next release.
In next version will be probably possible to move other then player object(like a torch) on a elevator.

Posted: Mon Mar 24, 2014 17:18
by John1
I was using latest git with singleplayer. Your new version must have fixed it as it isn't happening anymore.

Posted: Mon Mar 24, 2014 17:25
by hoodedice
Please upload your mod to GitHub. It's a pain to just browse the code otherwise =)

Posted: Mon Mar 24, 2014 17:38
by portals
Code on github :). Code need many fix because i use LUA first time (I am using very often { and }
instead then and end :) ). Now i thinking why this is necessary:

Code: Select all

--dirty fix to bug: lift moving up too fast
if (dir == 2) then
if (minetest.get_meta(pos):get_int("active") == 0) then
minetest.get_meta(pos):set_int("active",1)
return
end
end

Posted: Tue Mar 25, 2014 11:09
by LuxAtheris
Nice, Great mod!!

Posted: Tue Mar 25, 2014 19:08
by Krock
LuxAtheris wrote:Nice, Great mod!!
Give me one of those two posts.

Posted: Wed Mar 26, 2014 02:17
by LuxAtheris
Krock wrote:
LuxAtheris wrote:Nice, Great mod!!
Give me one of those two posts.
What two posts?

Posted: Wed Mar 26, 2014 04:22
by LionsDen
That's funny, I saw two posts when I looked at his comment earlier as well but it now only shows the one. I even looked at the time stamps and the second post was posted 3 minutes after the first.

Posted: Fri Mar 28, 2014 14:47
by portals
New version upload and new missing textures :).

Posted: Fri Mar 28, 2014 15:13
by Krock
LionsDen wrote:That's funny, I saw two posts when I looked at his comment earlier as well but it now only shows the one. I even looked at the time stamps and the second post was posted 3 minutes after the first.
Yes, there were actually 2 posts with same content. Strange how the poster didn't see them...

Posted: Fri Mar 28, 2014 15:48
by Pavel_S
Awesome mod! Alredy added to my map with hidden helicopters hangar =)


Addind moving entity cube between two positions of nodes will add nice smooth movement.

Posted: Fri Mar 28, 2014 19:16
by Excalibur Zero
This mod looks interesting. Could you upload a video of it so people can see how it works without having to download it?

Posted: Fri Mar 28, 2014 19:33
by portals
Addind moving entity cube between two positions of nodes will add nice smooth movement.
I try to do this after bug fix and code clean up. Next version will by probably only fix bug but idea is good.
Could you upload a video of it so people can see how it works without having to download it?
When someone make better textures i record something, now new textures are very bad. I am very bad textures maker.

Posted: Tue Apr 01, 2014 23:06
by RohitM
How do you set up the lift???? Please have something like a guide for it.

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Wed Aug 06, 2014 10:57
by portals
Small fixes and how to set up added. Code still need a lot of bug fix and i am working on it.

Re:

Posted: Tue Aug 19, 2014 19:53
by cx384
RohitM wrote:How do you set up the lift???? Please have something like a guide for it.
portals wrote:How to use:
First use /giveme to get: lift:rail, lift:moveblock_1, lift:rail_connector, lift:control_up, lift:control_down, lift:control_stop.
Now let's place blocks like in this screenshot:
screenshot_0000000002.png
Press up button to move elevator up, stop to stop it or press down to move it down.This is a simplest version of lift.
[/list]

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Wed Aug 20, 2014 14:57
by balthazariv
Hello,

Great mod but why not activate immediately "lift:control_down" and "lift:control_stop" in the inventory.
I don't like to use first /giveme in creative solo mode.

Thanks

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Thu Jul 30, 2015 01:26
by ExeterDad
It seems the OP's github acct. is gone. Does anyone have a copy of this?
Or an idea what else would work? My intents are to make elevators that you actually slowly ride up and down. I thought it would be cool to to have in some skyscrapers I'm working on. I'd rather avoid the teleport style of elevators as in the travelnet mod. Don't get me wrong, travelnet is cool and useful. I just want the ride this time :)

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Fri Aug 14, 2015 12:11
by portals
Hello
Sorry for long response time but I have been busy. I accidentally deleted repro when I remove duplicated Github account. I upload last version as a attachments.
The mod requires a lot of bugfix and I tried to write it from scratch(with backward compatibility) but did not obtain better results (I do not like LUA).

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Mon Aug 24, 2015 20:05
by Kociak
I like the mod much :)

But!
I think there is a mistake in code, that prevents listing all the items in inventory - I am unable to search all of them by name.

File: init.lua

Code: Select all

(((((SNIP)))))

minetest.register_node("lift:control_up", {
	tiles = {"lift_control_top_and_bottom.png", "lift_control_top_and_bottom.png", "lift_control_up.png", "lift_control_up.png", "lift_control_up.png", "lift_control_up.png"},
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
	description = "lift:control_up"
})
minetest.register_node("lift:control_down", {
	tiles = {"lift_control_top_and_bottom.png", "lift_control_top_and_bottom.png", "lift_control_down.png", "lift_control_down.png", "lift_control_down.png", "lift_control_down.png"},
	groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
})

(((((SNIP)))))
Other control nodes (control_down, control_stop) should have description = "lift:control_down" etc.

Also: When I add this mod my minetest (freshly compiled) keeps crashing soon after run with the following message:

Code: Select all

kociak@kociak_box:~/minetest/bin$ ./minetestserver --config /home/kociak/.minetest/minetest.conf --logfile /home/kociak/minetest/debug.txt 
2015-08-24 21:55:43: ERROR[main]: The following mods could not be found: "builtin_item" "compassgps" "mesecons_compatibility"
[Sign] v1.0
pushable block 0.0.7 mod loaded
2015-08-24 21:55:43: ERROR[main]: ========== ERROR FROM LUA ===========
2015-08-24 21:55:43: ERROR[main]: Failed to load and run script from 
2015-08-24 21:55:43: ERROR[main]: /home/kociak/minetest/bin/../games/minetest_game/mods/gauges/init.lua:
2015-08-24 21:55:43: ERROR[main]: /home/kociak/minetest/bin/../builtin/common/strict.lua:18: attempt to index global 'debug' (a boolean value)
2015-08-24 21:55:43: ERROR[main]: ======= END OF ERROR FROM LUA ========
2015-08-24 21:55:43: ERROR[main]: Server: Failed to load and run /home/kociak/minetest/bin/../games/minetest_game/mods/gauges/init.lua
2015-08-24 21:55:43: ERROR[main]: ERROR: An unhandled exception occurred: ModError: Failed to load and run /home/kociak/minetest/bin/../games/minetest_game/mods/gauges/init.lua
2015-08-24 21:55:43: ERROR[main]: Error from Lua:
2015-08-24 21:55:43: ERROR[main]: /home/kociak/minetest/bin/../builtin/common/strict.lua:18: attempt to index global 'debug' (a boolean value)
The following solves the problem:

Code: Select all

distance = 5 -- Operating range of connectors
local debug = true -- Print debug information, useful for reporting bugs
-- added word local here
Edit: If you post github URL I'll mirror it and do all the above.

Best regards, Kociak

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Wed Aug 26, 2015 17:18
by jogag
Kociak wrote:Other control nodes (control_down, control_stop) should have description = "lift:control_down" etc.
Wrong. The description attribute contains the item description you see when you hover the item in the inventory (the tooltip). The node name (ID) is the first argument to minetest.register_node().

Re: [Mod] Lifts [0.3.3] [lift]

Posted: Thu Aug 27, 2015 16:50
by Kociak
jogag wrote:
Kociak wrote:Other control nodes (control_down, control_stop) should have description = "lift:control_down" etc.
Wrong. The description attribute contains the item description you see when you hover the item in the inventory (the tooltip). The node name (ID) is the first argument to minetest.register_node().
My bad probably.
Missing of attributes I mentioned prevents what's-it's-name unified_inventory (not sure if that's the name) from listing the items after I type a string in the filter field (see attachment, mod's code was fixed in the way I described so nodes could appear after filtering).