[Mod] Minecart [minecart]

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

[Mod] Minecart [minecart]

by joe7575 » Sun May 12, 2019 19:08

Minecart, the lean railway transportation automation system

Image

The mod Minecart has its own cart (called Minecart) in addition to the standard cart.
Minecarts are used for automated item transport on private and public rail networks.
The mod features are:
  • configurable timetables and routes for Minecarts
  • automated loading/unloading of Minecarts by means of a Minecart Hopper
  • rail network protection based on protection blocks called Land Marks
  • protection of minecarts and cargo
  • Minecarts run through unloaded areas (only the stations/hopper have to be loaded)
  • Extra Minecard privs for rail workers
  • Ingame documentation (German and English), based on the mod "doc"



The code is on GitHub.

License

Code: MIT (as the original code)
Textures: CC-0 (as the original textures)

Dependencies
default, carts
optional: doc

Edit: Adapted to v1.0
Attachments
screenshot.png
(153.88 KiB) Not downloaded yet
Last edited by joe7575 on Sat Jan 04, 2020 15:05, edited 3 times in total.
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

Sokomine
Member
 
Posts: 3976
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Minecart [minecart]

by Sokomine » Mon May 20, 2019 18:21

Finally! Carts that can travel on their routes even if the area is unloaded. Without that, carts where usually a bit pointless. Thanks for creating the mod!

joe7575 wrote:To get the items back you have to dig the cart (as usual).

Perhaps a mechanism to unload the cart would be helpful. It could empty its content into a chest when punched from the side and not locked (maybe with right-click?). Just imagine those old tipping wagons that where actually used for mining. Removing those from the tracks in order to get their content wouldn't be a very practical approach.
A list of my mods can be found here.
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Wed May 22, 2019 10:50

A mechanism to unload the cart is added:
1. Sneak+click the cart to get the items back
2. Dig the empty cart with a second sneak+Click (as usual).
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

R-One
Member
 
Posts: 153
Joined: Wed Dec 20, 2017 23:06
Location: Nice, France

Re: [Mod] Minecart [minecart]

by R-One » Sat Aug 10, 2019 16:26

Hi, this mod is really good.

it would be cool to be able to detect the passage of a cart (mesecon rail detector?) and another function to be able to load or unload automatically at the end of the line, can be with a node compatible with pipeworks?

Question: Entities do not destroy themselves when they are in a card after a while?
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Tue Aug 13, 2019 10:18

R-One wrote:it would be cool to be able to detect the passage of a cart (mesecon rail detector?)

That's not so easy. The main feature of Minecart is the handling of carts in unloaded areas. A mesecon detector rail does not work in unloaded areas. To keep all areas loaded by means of forceloading items seems no good solution.
Apart from that, advtrains has all these features...

R-One wrote:and another function to be able to load or unload automatically at the end of the line, can be with a node compatible with pipeworks?

My answer to that is the Signs Bot mod which allows both.
But I could imagine some kind of hopper with cart sensor to be able to load/unload and than push the cart again.

R-One wrote:Question: Entities do not destroy themselves when they are in a card after a while?

If the cart is running, the items are stored in RAM and will not disappear. If the cart is stopped, I guess the entities will disappear after a while.
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

R-One
Member
 
Posts: 153
Joined: Wed Dec 20, 2017 23:06
Location: Nice, France

Re: [Mod] Minecart [minecart]

by R-One » Tue Aug 13, 2019 14:14

hi,

Signs_bot is a little too futuristic to be put on my server, that's why I thought that a block of loading, unloading could be cool.


another small question?

You have to put a power rails all how many blocks?
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Tue Aug 13, 2019 18:21

R-One wrote:You have to put a power rails all how many blocks?

I don't know but I guess 5 to 8 blocks between two power rails, and 1 to 2 blocks on slopes. You have to test it. But it is identical to the standard carts mod, because the rails and the cart logic are the same.
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Tue Aug 13, 2019 20:14

Signs_bot is a little too futuristic to be put on my server, that's why I thought that a block of loading, unloading could be cool.

loading, unloading needs some kind of chest or container node on the other side. Due to the lack of a standard API for container nodes, this could become complex and time consuming.

I know what I'm talking about, Signs Bot, tubelib/TechPack and other unfinished mods of mine, but also all other automation mods have their own, incompatible API for that....
The best way would be that your favorite automation mod would add such kind of functionality.
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

neoh4x0r
Member
 
Posts: 72
Joined: Wed Aug 29, 2018 20:16
GitHub: neoh4x0r

Re: [Mod] Minecart [minecart]

by neoh4x0r » Tue Aug 13, 2019 20:30

joe7575 wrote:loading, unloading needs some kind of chest or container node on the other side. Due to the lack of a standard API for container nodes, this could become complex and time consuming.
The best way would be that your favorite automation mod would add such kind of functionality.


Minetest already provides a standard API for handling inventory.

Code: Select all
local inv1 = minetest:get_inventory(location) -- https://dev.minetest.net/minetest.get_inventory
if inv1 ~= nil then
 -- call methods on inv1
end

local meta = minetest:get_meta(pos) -- https://dev.minetest.net/minetest.get_meta
if meta ~= nil then
 local inv2 = meta:get_inventory()
  if inv2 ~= nil then
   -- call methods on inv2
 end
end


To implement loading/unloading you would simply call those methods on a nearby node (say within 1 node).
Obviously checking if the returned value is nil before continuing.

That would allow you to implement a "standard" way of doing things.

NOTE: inv1 and 2 are copies of item stack -- changed made won't be updated in the inventory unless
a call is made to a method that updates the inventory (ie set_stack, etc)
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Wed Aug 14, 2019 14:18

Sorry, my post was not precise enough.
It is not only the access to the inventory. You have to handle the following in addition:
* the name of the inventory list has to be known
* some nodes have several lists like furnaces, which you have to distinguish
* some nodes do not even have a real inventory, they store the items in RAM or elsewhere
* some nodes have locked or protected inventories, which you have to handle in an appropriate way
* some nodes have special connection sides, which have to be considered
and so on...

There is one lib called node_io which tries to solve these issues, but the number of mods with support for node_io are rare.
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Sat Jan 04, 2020 15:12

Contrary to my statement one higher ( :-) ), I decided to add further features, so that Minecart is useful by its own:
- a simple Hopper to load/unload carts
- a cart stop time for each buffer. Carts start after that time automatically.

Now, Minecarts can be used as a "lean railway transportation automation system".

More info here: readme.md
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 18:33

I may be missing something here, but I set up a cart, a hopper, and a chest per the .png in the folder, and the hopper pulls from the chest, but does not deposit the items in the cart-- when the cart leaves, the items are there on the ground.

What did I do wrong here?
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Sat Feb 08, 2020 19:06

Did you use the special Minecart or a standard cart?
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 19:15

The minecart specifically-- not standard cart
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 20:39

Mine looks the same as yours. I had put a brake rail on either end of my track, but I don't see how that should matter...
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Sat Feb 08, 2020 20:54

The rail type doesn't matter.
Do you use Minetest 5.0 or newer?
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 21:01

5.1.1... something I noticed-- on one end 'a' is connected to 'b'; but the other end says 'a' connected to none. Would that affect anything?
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 21:03

5.1.1... something I noticed-- on one end 'a' is connected to 'b'; but the other end says 'a' connected to none. Would that affect anything?
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 21:03

5.1.1... something I noticed-- on one end 'a' is connected to 'b'; but the other end says 'a' connected to none. Would that affect anything?
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 21:04

Sorry phone was being dumb, didn't mean to duplicate responses.
 

User avatar
joe7575
Member
 
Posts: 345
Joined: Mon Apr 24, 2017 20:38
Location: Germany, in the deep south
GitHub: joe7575
In-game: JoSto

Re: [Mod] Minecart [minecart]

by joe7575 » Sat Feb 08, 2020 21:07

No, this missing connection has no impact on the loading of the carts
Sent from my Commodore 64. My Mods: TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Entrance, Minecart, Signs Bot.
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19

Re: [Mod] Minecart [minecart]

by N0RVLL » Sat Feb 08, 2020 21:13

I wouldn't think so... just throwing out ideas

[img]Screenshot%20from%202020-02-08%2015-06-03.png[/img]
Attachments
Screenshot from 2020-02-08 15-06-03.png
(396.7 KiB) Not downloaded yet
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19
 

N0RVLL
Member
 
Posts: 18
Joined: Sat Feb 08, 2020 17:19
 

Next

Return to WIP Mods



Who is online

Users browsing this forum: Google [Bot] and 14 guests