[Mod] Lifts [0.3.4] [lift]

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

[Mod] Lifts [0.3.4] [lift]

by portals » Post

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 2210 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.
Last edited by portals on Tue Sep 01, 2015 08:32, edited 9 times in total.

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

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 ^.^
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

User avatar
John1
Member
Posts: 36
Joined: Mon Mar 10, 2014 01:21
Location: USA

by John1 » Post

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

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

by portals » Post

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.
Last edited by portals on Mon Mar 24, 2014 16:36, edited 1 time in total.

User avatar
John1
Member
Posts: 36
Joined: Mon Mar 10, 2014 01:21
Location: USA

by John1 » Post

I was using latest git with singleplayer. Your new version must have fixed it as it isn't happening anymore.

User avatar
hoodedice
Member
Posts: 1374
Joined: Sat Jul 06, 2013 06:33
GitHub: hoodedice
IRC: hoodedice
In-game: hoodedice
Location: world
Contact:

by hoodedice » Post

Please upload your mod to GitHub. It's a pain to just browse the code otherwise =)
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

by portals » Post

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
Last edited by portals on Mon Mar 24, 2014 17:44, edited 1 time in total.

User avatar
LuxAtheris
Member
Posts: 169
Joined: Fri Oct 25, 2013 00:54
Location: Aether

by LuxAtheris » Post

Nice, Great mod!!
Believe you can and you’re halfway there.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

LuxAtheris wrote:Nice, Great mod!!
Give me one of those two posts.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
LuxAtheris
Member
Posts: 169
Joined: Fri Oct 25, 2013 00:54
Location: Aether

by LuxAtheris » Post

Krock wrote:
LuxAtheris wrote:Nice, Great mod!!
Give me one of those two posts.
What two posts?
Believe you can and you’re halfway there.

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

by portals » Post

New version upload and new missing textures :).

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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...
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Pavel_S
Member
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Post

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.
Last edited by Pavel_S on Fri Mar 28, 2014 15:51, edited 1 time in total.

User avatar
Excalibur Zero
Member
Posts: 142
Joined: Tue Apr 02, 2013 19:45
GitHub: ExcaliburZero
Location: United States
Contact:

by Excalibur Zero » Post

This mod looks interesting. Could you upload a video of it so people can see how it works without having to download it?

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

by portals » Post

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.
Last edited by portals on Fri Mar 28, 2014 19:35, edited 1 time in total.

RohitM
Member
Posts: 45
Joined: Tue Jul 02, 2013 22:16

by RohitM » Post

How do you set up the lift???? Please have something like a guide for it.

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

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

by portals » Post

Small fixes and how to set up added. Code still need a lot of bug fix and i am working on it.

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re:

by cx384 » Post

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]
Can your read this?

User avatar
balthazariv
Member
Posts: 214
Joined: Mon Apr 07, 2014 15:48
Contact:

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

by balthazariv » Post

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

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

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

portals
Member
Posts: 10
Joined: Sat Feb 11, 2012 09:14

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

by portals » Post

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

User avatar
Kociak
Member
Posts: 17
Joined: Fri Apr 03, 2015 20:29
In-game: kociak
Location: Warszawa / Poland

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

by Kociak » Post

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

User avatar
jogag
Member
Posts: 106
Joined: Wed Aug 12, 2015 18:32
GitHub: jogag
IRC: jogag
In-game: jogag
Location: Online

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

by jogag » Post

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

User avatar
Kociak
Member
Posts: 17
Joined: Fri Apr 03, 2015 20:29
In-game: kociak
Location: Warszawa / Poland

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

by Kociak » Post

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).
Attachments
filter.png
filter.png (344.6 KiB) Viewed 2210 times

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests