Page 1 of 20

[Mod] Carts [carts]

PostPosted: Fri Jul 20, 2012 17:02
by PilzAdam
Hello everyone!
This mod adds minecarts to Minetest.

Craft them like 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
steel       steel
steel steel steel


Place them on the default rails or any rails, that have the group "rails = 1" (this is the case for moreores' copper rails).

Punch them with leftclick to speed them up a bit. They will accelerate when driving downhill, and also decelerate while driving uphill. Punching them while holding shift will add them back to your inventory.

Rightclick the carts to jump into them and make sure to enjoy the ride!

The carts can follow each track you can build! At t-junctions they will always turn left (as you can see in the default textures). There are no railroad switches.

There is a powerrail and a brakerail. The powerrail will accelerate the cart when driving over it, the brakerail decelerates the cart. They can be crafted like this:
Powerrail:
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
steel  mese_crystal_fragment  steel
steel        stick            steel
steel                         steel

Brakerail:
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
steel  coal  steel
steel  stick steel
steel        steel


This mod has also mesecon compatibility. When placing the power- or brakerail with a the mesecon mod installed, the rails will only work if they get a mesecon signal.

License:
WTFPL

Dependencies:
default

Minetest Version:
0.4.4 or later

GitHub:
https://github.com/PilzAdam/carts

Download:
https://github.com/PilzAdam/carts/zipball/master

Old Version:
https://github.com/PilzAdam/carts/archive/old.zip

PostPosted: Fri Jul 20, 2012 18:16
by InfinityProject
It works really well when it's on the rails. I blocked the corners so it stayed on. It's also difficult to put on the rails. Can you ride the cart?

PostPosted: Fri Jul 20, 2012 18:28
by jin_xi
this is brilliant, thanks. placing of carts is tricky but i find it very nice. cool!

PostPosted: Fri Jul 20, 2012 18:36
by PilzAdam
InfinityProject wrote:Can you ride the cart?

Not yet. Its difficult to implement it but maybe it gets easier with some changes in the lua-api in the future. But i give my best to do it.

PostPosted: Fri Jul 20, 2012 18:44
by InfinityProject
I remember sapier had a pushable block mod with a cart that you could ride but it was EXTREEMELY buggy. Maybe you could use that. But over all this is an amazing mod +∞

PostPosted: Fri Jul 20, 2012 18:53
by Mito551
thank you very much!this so amazing! i will see what i can do about riding too, if you don't mind ;)

PostPosted: Fri Jul 20, 2012 19:56
by PilzAdam
Could somebody provide new graphics or maybe sound? I want to add sound but i have none.

PostPosted: Fri Jul 20, 2012 23:05
by SegFault22
If we ever get entity-to-entity collision or collision frame technology for entities, we could make the minecart where that you just ''jump'' into the cart and you're in it, instead of latching to it.

PostPosted: Sat Jul 21, 2012 01:09
by lkjoel
This looks identical to thexyz's mod

PostPosted: Sat Jul 21, 2012 08:46
by PilzAdam
lkjoel wrote:This looks identical to thexyz's mod

I used the graphics of his mod because im not so good in painting. But the code is completly self-made. xyz moved the carts by using the setpos() command. This is laggy because everey 0.05 seconds the server moves the cart one step.
I used the setacceleration() and setvelocity() methods to use the in c++ implemented move methods. This is not so laggy.

PostPosted: Sun Jul 22, 2012 04:01
by SegFault22
I was working on a mineshaft, and got the idea of using this mod with it. Just for the screenshots.
Here are some screenshots:


Image
The opening of the mineshaft


Image
A 4-way junction inside the mine. One leads off to a dead end, another to a helix going down, and the other to where some gravel fell in the shaft.


Image
This is where the gravel fell in the shaft.


Image
And a degrading bridge over a lake of magma.

PostPosted: Sun Jul 22, 2012 08:53
by cornernote
i assume its pretty easy to make these act like a chest where you can put items in it?

PostPosted: Sun Jul 22, 2012 09:31
by PilzAdam
cornernote wrote:i assume its pretty easy to make these act like a chest where you can put items in it?

It is not easy because of 2 reasons:
  • 1. You start/stop the cart with an rightclick and you open chests with a rightclick too.
  • 2. Objects that are implemented in lua cant have an inventory (if im wrong tell me how you can implement it).
But you can transport items without an inventory (see description).

PostPosted: Sun Jul 22, 2012 10:01
by mauvebic
take the meta code from chests and apply to any node you want. I had chests in the shapes of oil drums and wooden barrels.

In order to keep the carts moving you could use punchnode for start/stop, that way keeping right click for inventory. Hope this helps :-)

PostPosted: Sun Jul 22, 2012 10:03
by sfan5
Moved back because forum Guidelines not followed

PostPosted: Sun Jul 22, 2012 10:06
by PilzAdam
mauvebic wrote:take the meta code from chests and apply to any node you want.

The cart isnt a node its an object.

PostPosted: Sun Jul 22, 2012 10:09
by PilzAdam
sfan5 wrote:Moved back because forum Guidelines not followed

??

PostPosted: Sun Jul 22, 2012 10:14
by sfan5
The topic was in Mod Releases but did not follow the guidelines

PostPosted: Sun Jul 22, 2012 10:15
by PilzAdam
sfan5 wrote:The topic was in Mod Releases but did not follow the guidelines

I have everything in the first post that is needed.

PostPosted: Sun Jul 22, 2012 10:27
by mauvebic
everything does indeed look fine.

PostPosted: Sun Jul 22, 2012 11:43
by severak
Great! I really like your mod.

I will probably make a fork (mainly for better graphics), so I have one question: Where to place code-modification to support concepts of turnouts/rairoad switchs?

http://en.wikipedia.org/wiki/Railroad_switch

This would be real advance in transport in minetest.

PostPosted: Sun Jul 22, 2012 13:51
by PilzAdam
severak wrote:Great! I really like your mod.

I will probably make a fork (mainly for better graphics), so I have one question: Where to place code-modification to support concepts of turnouts/rairoad switchs?

http://en.wikipedia.org/wiki/Railroad_switch

This would be real advance in transport in minetest.

I have added railroad switches in Version 8. If you want to create new graphics you can post them here and i will take them gratefully.

PostPosted: Mon Jul 23, 2012 13:54
by PilzAdam
Has anyone an idea what do add next?

PostPosted: Mon Jul 23, 2012 16:53
by sfan5
Add Detector Rails
And fix this Bug:
If you right click the Rail Switch with a Rail and change the State of it, the cart seemse to ignore the switch

PostPosted: Mon Jul 23, 2012 17:07
by PilzAdam
sfan5 wrote:If you right click the Rail Switch with a Rail and change the State of it, the cart seemse to ignore the switch

How do you change the state of the switch with a rightclick? You can only change the state with a leftclick and this works ive testet it very well.
EDIT: And could you please move this back to Mod releases or tell me whats missing?

PostPosted: Mon Jul 23, 2012 17:09
by sfan5
Title not formatted right

PostPosted: Mon Jul 23, 2012 17:14
by PilzAdam
sfan5 wrote:Title not formatted right

celeron55 wrote:[Mod] <Mod Name> [<version number>] [<modname>]

PostPosted: Mon Jul 23, 2012 17:16
by PilzAdam
sfan5 wrote:Add Detector Rails

I'll think about it.

PostPosted: Mon Jul 23, 2012 17:23
by sfan5
PilzAdam wrote:
sfan5 wrote:Title not formatted right

celeron55 wrote:[Mod] <Mod Name> [<version number>] [<modname>]

[<version number>] means you need something like "[Mod] Carts [14] [carts]"

PostPosted: Mon Jul 23, 2012 17:26
by PilzAdam
sfan5 wrote:[<version number>] means you need something like "[Mod] Carts [14] [carts]"

Thanks for the hint I have changed it.
And maybe i will connect mesecons with my carts (thanks for the idea).