[Mod] Carts [carts]

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

I would like to collaberate with you. A mod based on this one. Message me when I come on the IRC.
hello, am program. do language in rust. make computer do. okay i go now.

kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

Hi there. I am quite new to posting but have enjoyed the game for quite some time now.
One thing I really like is the carts mod - so much that I created a "station rail" which is the combination of the brake rail and the accelerate rail such that the rail accelerated when powered and brakes if not.
That way I can make carts stop where I want them to and move them along again when throwing a switch.

The carts module does however contain a bug which can be shown by just using the accelerate rail:
Build a stretch of accelerate rails and power them all. Place a cart and move it along by punching a button. Power off immediately again so that the cart will stop eventually. Notice the direction. If it is in the negative x or z direction the cart will reverse!
In one the the directions you will notice that the cart reverses direction even if more rail is available in the direction it was travelling before when power is restored once more.

I have looked at the code and am half way to understanding it but the mod writer might have a better clue here. To me it seems that the mod has to save the sign of the direction vector to let the cart travel along in the direction it was going towards so that it does not reverse if it was going in the negative direction.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

kpo wrote:The carts module does however contain a bug which can be shown by just using the accelerate rail:
Build a stretch of accelerate rails and power them all. Place a cart and move it along by punching a button. Power off immediately again so that the cart will stop eventually. Notice the direction. If it is in the negative x or z direction the cart will reverse!
In one the the directions you will notice that the cart reverses direction even if more rail is available in the direction it was travelling before when power is restored once more.
I dont know exactly how to reproduce this.

kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

PilzAdam wrote:
kpo wrote:The carts module does however contain a bug which can be shown by just using the accelerate rail:
Build a stretch of accelerate rails and power them all. Place a cart and move it along by punching a button. Power off immediately again so that the cart will stop eventually. Notice the direction. If it is in the negative x or z direction the cart will reverse!
In one the the directions you will notice that the cart reverses direction even if more rail is available in the direction it was travelling before when power is restored once more.
I dont know exactly how to reproduce this.
Ehm. Okay I am not sure how to attach an image. But imagine this:


B
(-x or -z) ==============C======================= (+x or +z)
<---- if the cart stops while moving this way it will move ----> this way when powered again.

'=' = long accelerate track
'B' = Mesecon Button (either the lever, switch or button) and mesecons to each and every piece of track
'C' = Cart

When the button is pressed the cart will move in the positive direction (+x or +z) and return when it reaches the end of the track - sort of bouncing back and forth if power is kept on.
IF the cart is stopping while travelling in the negative direction (-x or -z) it will reverse its direction when the tracks are powered again.

For ease of debugging this set the acceleration to be negative when the accelerate rail is off (that is the extra rail type I made here). That will cause the cart to stop when power is off.

As I write I suspect the code to be "positively inclined" towards the positive direction vector rather than saving the vector it came to a halt with.

Does that make any sense?

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

kpo wrote:
PilzAdam wrote:
kpo wrote:The carts module does however contain a bug which can be shown by just using the accelerate rail:
Build a stretch of accelerate rails and power them all. Place a cart and move it along by punching a button. Power off immediately again so that the cart will stop eventually. Notice the direction. If it is in the negative x or z direction the cart will reverse!
In one the the directions you will notice that the cart reverses direction even if more rail is available in the direction it was travelling before when power is restored once more.
I dont know exactly how to reproduce this.
Ehm. Okay I am not sure how to attach an image. But imagine this:


B
(-x or -z) ==============C======================= (+x or +z)
<---- if the cart stops while moving this way it will move ----> this way when powered again.

'=' = long accelerate track
'B' = Mesecon Button (either the lever, switch or button) and mesecons to each and every piece of track
'C' = Cart

When the button is pressed the cart will move in the positive direction (+x or +z) and return when it reaches the end of the track - sort of bouncing back and forth if power is kept on.
IF the cart is stopping while travelling in the negative direction (-x or -z) it will reverse its direction when the tracks are powered again.

For ease of debugging this set the acceleration to be negative when the accelerate rail is off (that is the extra rail type I made here). That will cause the cart to stop when power is off.

As I write I suspect the code to be "positively inclined" towards the positive direction vector rather than saving the vector it came to a halt with.

Does that make any sense?
Oh, I understand now.
The carts dont save their previous direction, so when they are powered they again they look in wich direction they can move, independently from the previous direction.
I see if I can fix it somehow.

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

Coincidence, I read this exactly message in a readme file one minute ago. :-o

logang730
New member
Posts: 1
Joined: Sun May 12, 2013 01:57

by logang730 » Post

why wont it let me build the cart? :/ my first time on minetest... im in build mode right now and i get the rail road. but not the cart.. can some one help me?

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

Did you install the mod in the right location? If you're playing the build game, it must go under $MINETEST_FOLDER/mods/build, in a folder named "carts". Inside that folder should be the file init.lua.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

The only bug is that if going at speed then hitting a downward slope it just flies into the air- quite realistic actually :)
InfinityProject wrote: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 +∞
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
222jkm
New member
Posts: 6
Joined: Wed May 15, 2013 22:27

by 222jkm » Post

Hi, I am trying to install this mod but every time I start the game, it says error cannot read init.lua. Im running 4.6.6. LM 14. Thanks! The same thing happened with the boats mod.
Thanks a lot, jim

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

222jkm wrote:Hi, I am trying to install this mod but every time I start the game, it says error cannot read init.lua. Im running 4.6.6. LM 14. Thanks! The same thing happened with the boats mod.
Thanks a lot, jim
Can try collecting some more information about the error as described here: http://forum.minetest.net/viewtopic.php?id=5073?

Also there is no Minetest version "4.6.6".

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

222jkm wrote:Hi, I am trying to install this mod but every time I start the game, it says error cannot read init.lua. Im running 4.6.6. LM 14. Thanks! The same thing happened with the boats mod.
Thanks a lot, jim
try renaming the mod from 'carts-master' to 'carts'.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Hi Traxie21
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

Little update: A new feature in the engine allows the power- and breakrail to connect to the normal rails. This feature will be in 0.4.7. The carts mod works still with 0.4.6, though, so its save to update for everyone.

kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

Will you work on the direction issue as well? You know: The one where the cart reverses its direction to the positive direction if stopped and started using the brake and accelerate rails? :-) (Issue described further up this page)

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Maybe powered carts would be nice. like putting coal in a furnace allowing it to move and also linking carts would also be nice.
Last edited by jojoa1997 on Wed May 22, 2013 22:26, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

kpo wrote:Will you work on the direction issue as well? You know: The one where the cart reverses its direction to the positive direction if stopped and started using the brake and accelerate rails? :-) (Issue described further up this page)
Finally fixed :-)

User avatar
AndrOn
Member
Posts: 50
Joined: Fri May 31, 2013 22:32
Location: Orléans, France

by AndrOn » Post

I have a bug with the carts, they stop for no reason or even bouncing and going backwards when I'm travelling, each 10 meters or so, forcing me to get out of the cart, punching it and go back inside. Love your mod btw but it kinda wastes the pleasure!

Also, sorry for the bad english.
k8NzxjXgxpd3KOKx8pz2z12pStfpe5tR

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

AndrOn wrote:I have a bug with the carts, they stop for no reason or even bouncing and going backwards when I'm travelling, each 10 meters or so, forcing me to get out of the cart, punching it and go back inside. Love your mod btw but it kinda wastes the pleasure!

Also, sorry for the bad english.
The cart doesnt keep its velocity forever. It slows constantly down. Try driving down a hill or use acceleration rails.

User avatar
AndrOn
Member
Posts: 50
Joined: Fri May 31, 2013 22:32
Location: Orléans, France

by AndrOn » Post

Yes, I use accelerators (with mesecons) and it works, but my issue is that sometimes even at full speed on an horizontal track, suddenly the cart stops with no reason or goes instantly back with the same speed as if it were hurting or bouncing against something invisible. I could make a video of that tomorrow if I'm not clear (though tomorrow because it's 01.40 am here in France).
k8NzxjXgxpd3KOKx8pz2z12pStfpe5tR

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

AndrOn wrote:Yes, I use accelerators (with mesecons) and it works, but my issue is that sometimes even at full speed on an horizontal track, suddenly the cart stops with no reason or goes instantly back with the same speed as if it were hurting or bouncing against something invisible. I could make a video of that tomorrow if I'm not clear (though tomorrow because it's 01.40 am here in France).
Could you test if this commit causes it: https://github.com/PilzAdam/carts/commi ... 931d795413?
Also, a video would be helpful, I guess.

kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

PilzAdam wrote:
kpo wrote:Will you work on the direction issue as well? You know: The one where the cart reverses its direction to the positive direction if stopped and started using the brake and accelerate rails? :-) (Issue described further up this page)
Finally fixed :-)
Thanks Adam. I like these little carts and how I can at least create circular railroads within chunk limits.
I may bother you with a powered accelerate/brake rail just the same at some stage :-P
The idea of having the cart stop at stations and punching a mesecon button makes it go again is great fun on rails.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

kpo wrote:
PilzAdam wrote:
kpo wrote:Will you work on the direction issue as well? You know: The one where the cart reverses its direction to the positive direction if stopped and started using the brake and accelerate rails? :-) (Issue described further up this page)
Finally fixed :-)
Thanks Adam. I like these little carts and how I can at least create circular railroads within chunk limits.
I may bother you with a powered accelerate/brake rail just the same at some stage :-P
The idea of having the cart stop at stations and punching a mesecon button makes it go again is great fun on rails.
You may want to look at MiniTest, it has rails that stop you if they are not powered by redstone, and accelerate you when they are powered.

AlphaD1
New member
Posts: 2
Joined: Mon Jun 03, 2013 03:25

by AlphaD1 » Post

Hi PilzAdam, I was just wondering: I am having a server error type with the carts where in the console says to me, "08:13:20: ERROR[ServerThread]: ServerEnvironment::deactivateFarObjects(): id=2 m_static_exists=true but static data doesn't actually exist in (21,-1,37)." What does this mean? The cart accelerates well but it suddenly stops completely in a random pattern.

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

by PilzAdam » Post

AlphaD1 wrote:Hi PilzAdam, I was just wondering: I am having a server error type with the carts where in the console says to me, "08:13:20: ERROR[ServerThread]: ServerEnvironment::deactivateFarObjects(): id=2 m_static_exists=true but static data doesn't actually exist in (21,-1,37)." What does this mean? The cart accelerates well but it suddenly stops completely in a random pattern.
What Minetest version do you use?
In the current development version there is a commit that fixes the storage of static data.

Post Reply

Who is online

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