[Mod] Carts [carts]

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

Your screenshot - this is correct movement:
x+
x+
x+
y-
x+
y-
x+
y-
x+
y-
x+
x+


Here is what mine does (sometimes):
x+
x+
x+
y-
x+
y-
x+ <---- after this point the cart:on_step() didnt get called until the cart moved twice in the X+ direction
y- <---- at this point there is no track at y-1 (the track is at y-2), the cart stops

Note, this only happens on a really long descent. And I think it never happens on the way back up.
Last edited by cornernote on Wed Aug 01, 2012 01:15, edited 1 time in total.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

im not sure, but it might also have the same effect if you have lots and lots of corners and no straight track?

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

by PilzAdam » Post

cornernote wrote:im not sure, but it might also have the same effect if you have lots and lots of corners and no straight track?
Yes. It is the same problem. The cart moves on its one and the on_step() method (wich controls the cart) is only called every 0.25 sec. (or something like that). So if the server lags the control method cant control the cart -> problems appear.

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

is there any way to store the last piece of track it went over (and the direction) and then if it goes off, kinda try to put it back?

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

error[serverthread] serverenvironement deactivatefarObjects(): id=74 m_static_exists=true but static data doesn't actually exist in (3,0,-2)

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

by PilzAdam » Post

pagliaccio wrote:error[serverthread] serverenvironement deactivatefarObjects(): id=74 m_static_exists=true but static data doesn't actually exist in (3,0,-2)
Never had this error. Does it appear when you go far away from a cart and then come back to it?
Does it appear always or just sometimes?

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

by PilzAdam » Post

cornernote wrote:is there any way to store the last piece of track it went over (and the direction) and then if it goes off, kinda try to put it back?
Sounds like a good idea. I will think about that.

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

PilzAdam wrote:
pagliaccio wrote:error[serverthread] serverenvironement deactivatefarObjects(): id=74 m_static_exists=true but static data doesn't actually exist in (3,0,-2)
Never had this error. Does it appear when you go far away from a cart and then come back to it?
Does it appear always or just sometimes?
it appear sometimes. Does it appear when i go far away from a cart and the cart stop or disappears.

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

by PilzAdam » Post

pagliaccio wrote:
PilzAdam wrote:
pagliaccio wrote:error[serverthread] serverenvironement deactivatefarObjects(): id=74 m_static_exists=true but static data doesn't actually exist in (3,0,-2)
Never had this error. Does it appear when you go far away from a cart and then come back to it?
Does it appear always or just sometimes?
it appear sometimes. Does it appear when i go far away from a cart and the cart stop or disappears.
The cart is an object and objects only can move if there is a player near by. If all players go far away the engine creates something that is called "static data" to save the current state of the cart. When you go closer the engine gives the static data back to the cart, so the cart knows what to do.
It seems that there appear problems when the static data are created in your game.
Could you please answer the following questions:
  • Wich version of Minetest do you use (please not only "0.4")?
  • Wich version of the carts mod do you use?
  • Wich other mods do you have installed.
  • Do you have any other problems with any mod?

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

by PilzAdam » Post

cornernote wrote:is there any way to store the last piece of track it went over (and the direction) and then if it goes off, kinda try to put it back?
Thanks for this idea! I was able do fix the derail bug.

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

by PilzAdam » Post

Ragnarok wrote:I made a bit more natural sound for cart. Do you like it?:

http://speedy.sh/r4dPu/carts-cart-sound.ogg

License: WTFPL
Ive implemented it in version 28. The sounds are now played randomly.

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

PilzAdam wrote:
pagliaccio wrote:
PilzAdam wrote: Never had this error. Does it appear when you go far away from a cart and then come back to it?
Does it appear always or just sometimes?
it appear sometimes. Does it appear when i go far away from a cart and the cart stop or disappears.
The cart is an object and objects only can move if there is a player near by. If all players go far away the engine creates something that is called "static data" to save the current state of the cart. When you go closer the engine gives the static data back to the cart, so the cart knows what to do.
It seems that there appear problems when the static data are created in your game.
Could you please answer the following questions:
  • Wich version of Minetest do you use (please not only "0.4")?
  • Wich version of the carts mod do you use?
  • Wich other mods do you have installed.
  • Do you have any other problems with any mod?
  • v 0.4.1
  • 25 but now try a new version
i need a transport in long distance.

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

by PilzAdam » Post

pagliaccio wrote: but now try a new version
Tell me if the bug is stiil there.

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

PilzAdam wrote:
pagliaccio wrote: but now try a new version
Tell me if the bug is stiil there.
i have a make a rail for connect a mine width castle and return. cart stop at midle way. not return.
the problem is the long distance.

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

by PilzAdam » Post

pagliaccio wrote:
PilzAdam wrote:
pagliaccio wrote: but now try a new version
Tell me if the bug is stiil there.
i have a make a rail for connect a mine width castle and return. cart stop at midle way. not return.
the problem is the long distance.
This is an engine thing. I cant change anything about that. Sorry.

pagliaccio
Member
Posts: 65
Joined: Tue Jul 31, 2012 07:38
Location: italy

by pagliaccio » Post

we ask at developers some API for maintaining active
some object

cornernote
Member
Posts: 844
Joined: Wed Jul 11, 2012 15:02

by cornernote » Post

[REQUEST] - locked cart / dropoff / pickup

CART - this cart only allows the owner to start/stop and pickup the cart
DROPOFF /PICKUP - instead of just throwing items on the ground, they are placed in a chest that only the player can access

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

by PilzAdam » Post

cornernote wrote:[REQUEST] - locked cart / dropoff / pickup

CART - this cart only allows the owner to start/stop and pickup the cart
DROPOFF /PICKUP - instead of just throwing items on the ground, they are placed in a chest that only the player can access
I will add something like this.

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

by PilzAdam » Post

PilzAdam wrote:
cornernote wrote:[REQUEST] - locked cart / dropoff / pickup

CART - this cart only allows the owner to start/stop and pickup the cart
DROPOFF /PICKUP - instead of just throwing items on the ground, they are placed in a chest that only the player can access
I will add something like this.
Added in version 29.

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

What about with detecting of kinds of rails? Is it possible?

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

by PilzAdam » Post

Ragnarok wrote:What about with detecting of kinds of rails? Is it possible?
What do you mean?

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

I say about playing carts_straight_rails.ogg when cart is over straight rails, carts_curved_rails.ogg when cart is at the turn and carts_railway_crossover.ogg when cart cross the intersection.

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

by PilzAdam » Post

Ragnarok wrote:I say about playing carts_straight_rails.ogg when cart is over straight rails, carts_curved_rails.ogg when cart is at the turn and carts_railway_crossover.ogg when cart cross the intersection.
The sounds are to long for that.

User avatar
Ragnarok
Member
Posts: 217
Joined: Thu Mar 22, 2012 12:56
Location: Poland
Contact:

by Ragnarok » Post

The sounds are too long to play them on a single rail - I agree - but you can detect whether the rail is changed, and then play the sound carts_curved_rails.ogg or carts_railway_crossover.ogg for a while according to the type of rail. Over straight rails should be played carts_straight_rails.ogg. The question is: how to detect rails?

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

by PilzAdam » Post

Ragnarok wrote:The sounds are too long to play them on a single rail - I agree - but you can detect whether the rail is changed, and then play the sound carts_curved_rails.ogg or carts_railway_crossover.ogg for a while according to the type of rail. Over straight rails should be played carts_straight_rails.ogg. The question is: how to detect rails?
This is possible. Rails use the param2 variable so you can see wether they are curved or straight etc.. And with the get_new_direction() of the cart you can simulate the next 4 to 5 steps so you can detect the rails and check wether they are curved etc.
But I dont want to add this. I want some sounds that are played randomly.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests