Page 1 of 2

[Mod] Lifts [0.3.4] [lift]

PostPosted: 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 4654 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.

PostPosted: 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 ^.^

PostPosted: 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

PostPosted: 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
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 (dir == 2) then pos = {x=pos.x,y=pos.y+2,z=pos.z} end

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 (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.

PostPosted: 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.

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

PostPosted: 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:
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
--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

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

PostPosted: Tue Mar 25, 2014 19:08
by Krock
LuxAtheris wrote:Nice, Great mod!!

Give me one of those two posts.

PostPosted: 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?

PostPosted: 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.

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

PostPosted: 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...

PostPosted: 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.

PostPosted: 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?

PostPosted: 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.

PostPosted: 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]

PostPosted: 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:

PostPosted: 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]

PostPosted: 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]

PostPosted: 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]

PostPosted: 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]

PostPosted: 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

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
(((((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:
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
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:
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
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]

PostPosted: 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]

PostPosted: 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).

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

PostPosted: Fri Aug 28, 2015 12:29
by siteswap423
Hello whwn i use this mod iv got this error message " 2015-08-28 12:27:14: ERROR[main]: Server: Failed to load and run /home/lele/.minetest/mods/lift/init.lua
2015-08-28 12:27:14: ERROR[main]: ModError: ModError: Failed to load and run /home/lele/.minetest/mods/lift/init.lua
2015-08-28 12:27:14: ERROR[main]: Error from Lua:
2015-08-28 12:27:14: ERROR[main]: /usr/share/minetest/builtin/game/register.lua:391: attempt to index global 'debug' (a boolean value)
2015-08-28 12:27:14: ERROR[main]: Controllare debug.txt per i dettagli."

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

PostPosted: Fri Aug 28, 2015 20:48
by Kociak
siteswap423 wrote:Hello whwn i use this mod iv got this error message " 2015-08-28 12:27:14: ERROR[main]: Server: Failed to load and run /home/lele/.minetest/mods/lift/init.lua
2015-08-28 12:27:14: ERROR[main]: ModError: ModError: Failed to load and run /home/lele/.minetest/mods/lift/init.lua
2015-08-28 12:27:14: ERROR[main]: Error from Lua:
2015-08-28 12:27:14: ERROR[main]: /usr/share/minetest/builtin/game/register.lua:391: attempt to index global 'debug' (a boolean value)
2015-08-28 12:27:14: ERROR[main]: Controllare debug.txt per i dettagli."


As I wrote few posts earlier:

The following solves the problem:
Kociak wrote:distance = 5 -- Operating range of connectors
local debug = true -- Print debug information, useful for reporting bugs
-- added word local here


(Edit init.lua of course...)

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

PostPosted: Sun Aug 30, 2015 17:29
by siteswap423
Yes it' works :)
Another question ........
I cant see lift stop and move down

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

PostPosted: Sun Aug 30, 2015 18:21
by portals
Try use /giveme lift:control_down etc. Kociak probably will release a new version with the patch soon. The code requires serious refactoring.

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

PostPosted: Sun Aug 30, 2015 18:26
by rubenwardy
You should add local to all the variables in init.lua

The only time you should not put local (when declaring a variable) is if the variable name is "lifts" and is part of the API.