[Mod] Carts [carts]

Post Reply
Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

It would be great if players could be handled the same way as other lua entities. Why can players be moved downwards (gravity in action) or even upwards (with the group of the node the player falls onto set like in the jumping mod) but not be moved/accelerated sideways? Does anyone know if there is a reason to this? Accelerating the player might cause its own problems (like players falling down and dying), but in a controlled environment (like a 2x1 underground tunnel) that might be less of a problem.
A list of my mods can be found here.

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

by PilzAdam » Post

Sokomine wrote:It would be great if players could be handled the same way as other lua entities. Why can players be moved downwards (gravity in action) or even upwards (with the group of the node the player falls onto set like in the jumping mod) but not be moved/accelerated sideways? Does anyone know if there is a reason to this? Accelerating the player might cause its own problems (like players falling down and dying), but in a controlled environment (like a 2x1 underground tunnel) that might be less of a problem.
How to decide who has control of the player? The human in front of the screen via keyboard or the Lua API?
There are many problems when you want to realize this in a good way.

Iqualfragile
Member
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Post

there is no problem if the scripts and the controls just apply forces
if you want to solve it without forces you can make a script lock the players controlls on a per-key-basis
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

A player entering a vehicle would under ideal conditions be transported to the destination and be free to move inside the vehicle. That is of course rather complicated (velocity relative to vehicle and relative to the rest of the world) and would imply such things as player without safety-belt beeing thrown out/off a vehicle that comes to a sudden halt - realistic but impractical.
When the player enters a vehicle it can be assumed that the player wants to go where the vehicle goes and - if he doesn't agree with the direction anymore - will leave the vehicle. Free movement inside the vehicle is not that important. A key to enter/leave it would be ok. It would be good if the player could turn around inside the vehicle and such change the direction into which he's looking. Water and air do that already when the player is falling/swimming. Now add the same thing for horizontal travel :-)
Another related point is that in order to move on one has to constantly press keys. Be it forward+fast for travelling for minutes through tunnels, be it some strange shift+space+whatever combination to climb strange ladders, be it just space for swimming...that is annoying. It may be something players on gaming consoles are used to. For players with a keyboard it's bad. A "continue travelling forward" key would help a lot. Or a vehicle that doesn't have to move the player through set_position.
A list of my mods can be found here.

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

Sokomine wrote:A "continue travelling forward" key would help a lot.
minetest.conf.example?

# Continuous forward movement (for testing)
#continuous_forward = false

But I didn't try it yet.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

problem is nodes don't move, they're removed and added +1 on any given axis. What we need are nodes that have directions and velocities and a drag effect on any object sitting on it. It would help alot with my boats :-)

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

by PilzAdam » Post

If someone uses the 3D model dev version by Taoki (alias MirceaKitsune) (https://github.com/MirceaKitsune/minetest/tree/models) you may want to look at this branch of this mod: https://github.com/PilzAdam/carts/tree/attachment.
It uses the attachment code from the dev version to transport players smoothly. It works realy good.
Please report bugs here and I will tell them Taoki if they are relevant for him and the development of the 3D models.

jin_xi
Member
Posts: 165
Joined: Mon Jul 02, 2012 18:19

by jin_xi » Post

been testing it and its great, works really well too. nice work!

luciferleftwing
Member
Posts: 10
Joined: Tue Oct 23, 2012 14:21

by luciferleftwing » Post

very cool i may signal that it derails if the player tries to dig a node while riding the cart, well it is realistic in a certain way but i do not know if it was intended

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

I have seen a few cases where the carts will get stuck in motion between the node right in front of it and the node behind it. I once clicked a cart in this state in my single player game and the game crashed. Afterwards, the map would not load.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Post

Do your two previous posts recommend potential bug fixes to the code, Hybrid Dog? If so, then they might be of use to PilzAdam.

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

by PilzAdam » Post

Hybrid Dog, if you can provide bug fixes (patches or pull requests on GitHub) I will gladly add them.
But changes like MAX_SPEED = 40.5 should stay in your own version ;-)

lesto
New member
Posts: 9
Joined: Sun Nov 25, 2012 20:00

by lesto » Post

hi, i have a request. Can you make the railchest locket, or better idea, make the railchest drop things in the nearest chest or locked chest (that way we can use bigger chest and/or from others mod)?

edit: and switch! mesecon controlled switch! with lock!

ri-edit: meseconrail stop doesn't seems to work, i've placed mesetorch all around, but cart won't stop.. at lest the "sensor" works, i'm using it with piston, but the cart have to be manually restarted.
Last edited by lesto on Sun Nov 25, 2012 23:18, edited 1 time in total.

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

I have a request :

Powered tunneler/railroad layer.

Make a powered cart that breaks rocks in front of it (up to 3 upside, 3 left 3 right) and lays a new track over the recently opened area, and so on (like those tunel making machines that are used today to build tunnels for the subway), until it runs out of tracks (You place tracks into the cart, kick it and it turns on and do his things...

At the same time rocks and material that are removed get inside the cart and can be collected by the player...

Maybe add another cart that goes back and fort along the line transporting tracks in the trip towards the cart and bringing back collected material in the return trip...

This would simplifly resource collection/track building...

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

aldobr wrote:I have a request :

Powered tunneler/railroad layer.

Make a powered cart that breaks rocks in front of it (up to 3 upside, 3 left 3 right) and lays a new track over the recently opened area, and so on (like those tunel making machines that are used today to build tunnels for the subway), until it runs out of tracks (You place tracks into the cart, kick it and it turns on and do his things...

At the same time rocks and material that are removed get inside the cart and can be collected by the player...

Maybe add another cart that goes back and fort along the line transporting tracks in the trip towards the cart and bringing back collected material in the return trip...

This would simplifly resource collection/track building...
Great idea, would make building long tunnels much less boring and time consuming.
An innocent kitten dies every time you top-post.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

I'm getting an error periodically when trying to enter a cart. Using the attachment branch.

Code: Select all

23:18:55: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error running function 'on_rightclick': ...inetest-ru-win32\bin\..\mods\minetest\carts\init.lua:746: attempt to index a nil value
23:18:55: ERROR[main]: stack traceback:

In thread 1450:
..\..\minetest\src\main.cpp:1749: main: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 1450:
#0  main
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  ServerMap::save)
(Leftover data: #3  ServerMap::saveBlock)
(Leftover data: #4  ItemStack::serialize)

Aslanex

by Aslanex » Post

Hi, meseconrail stop really doesn't work. I've tried to put the mesecon everywhere but the cart won't stop. Please fix it. Thanks!

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

by PilzAdam » Post

BrandonReese wrote:I'm getting an error periodically when trying to enter a cart. Using the attachment branch.

Code: Select all

23:18:55: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error running function 'on_rightclick': ...inetest-ru-win32\bin\..\mods\minetest\carts\init.lua:746: attempt to index a nil value
23:18:55: ERROR[main]: stack traceback:

In thread 1450:
..\..\minetest\src\main.cpp:1749: main: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 1450:
#0  main
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  ServerMap::save)
(Leftover data: #3  ServerMap::saveBlock)
(Leftover data: #4  ItemStack::serialize)
Do you use 0.4.4-dev version of Minetest?

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

by PilzAdam » Post

Aslanex wrote:Hi, meseconrail stop really doesn't work. I've tried to put the mesecon everywhere but the cart won't stop. Please fix it. Thanks!
Mesecon mod had some changes in the API so I have to look over it a bit.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

PilzAdam wrote:
BrandonReese wrote:I'm getting an error periodically when trying to enter a cart. Using the attachment branch.

Code: Select all

23:18:55: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error running function 'on_rightclick': ...inetest-ru-win32\bin\..\mods\minetest\carts\init.lua:746: attempt to index a nil value
23:18:55: ERROR[main]: stack traceback:

In thread 1450:
..\..\minetest\src\main.cpp:1749: main: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 1450:
#0  main
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  ServerMap::save)
(Leftover data: #3  ServerMap::saveBlock)
(Leftover data: #4  ItemStack::serialize)
Do you use 0.4.4-dev version of Minetest?
I'm using 0.4.4 but not the latest. It was the latest as of a week or so ago. I think I fixed it with a little change to check for a nil value.

I replaced this:

Code: Select all

for i,item in ipairs(tmp) do
      if not item:is_player() and item:get_luaentity().name ~= "carts:cart" then
    table.insert(self.items, item)
      end
end
With this:

Code: Select all

for i,item in ipairs(tmp) do
   if item:is_player() ~= nil and item:get_luaentity() ~= nil then
      if not item:is_player() and item:get_luaentity().name ~= "carts:cart" then
    table.insert(self.items, item)
      end
    end
end
And it hasn't crashed yet. I love the carts. My kids love them also, I laid track between two cities and my kids just ride carts in between them all the time now.

User avatar
yohoho
Member
Posts: 13
Joined: Tue Nov 27, 2012 17:47

by yohoho » Post

Not sure if its been discussed but it seems the cart "stops" at seeming random going up or down a "slope".

I have been testing this mod and I like it but it has a few issues. One seems to be as mentioned above. I have a mine cart tunnel slope going down to my mines from the surface. The cart will continue down the slope a way but almost always stop somewhere midway with no apparent rhyme or reason. The tunnel is a simple stair basically (before stairs were added to minetest). I can't seem to find a "reason" for the apparent random stops. However so long as all rails are on same level it seems to work just fine except for occasional derail at corners.

Another issue is I have mesecons installed and it seems the built in mesecons features of cart mod just don't work.

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

by PilzAdam » Post

yohoho wrote:but it has a few issues.
Are you kidding? This is the most buggy mod I can imagine!
yohoho wrote:Another issue is I have mesecons installed and it seems the built in mesecons features of cart mod just don't work.
As I said above the mesecon API changed a bit and I have to update it. Dunno when I will do that.
The carts mod code makes the depressive because its so bad :-(

Josh
Member
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia

by Josh » Post

PilzAdam, i need the cart mod working for 0.4.4. The reason is im making an adventure map, i saw in this video:
http://www.youtube.com/watch?v=Wta7K7hG ... ature=plcp
that carts are now rideable. But when i go to craft the cart i dosen't work. Any help?

User avatar
yohoho
Member
Posts: 13
Joined: Tue Nov 27, 2012 17:47

by yohoho » Post

PilzAdam wrote:
yohoho wrote:but it has a few issues.
Are you kidding? This is the most buggy mod I can imagine!
I've seen worse lol

PilzAdam wrote:
yohoho wrote:Another issue is I have mesecons installed and it seems the built in mesecons features of cart mod just don't work.
As I said above the mesecon API changed a bit and I have to update it. Dunno when I will do that.
The carts mod code makes the depressive because its so bad :-(
Maybe someone (or multiple people) on the forums with some knowledge and skill can band together with you to re-write this mod to make it the best it can be? Seems "carts" is something almost everyone wants. I wish I could be of service but all I can do is offer some testing.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

yohoho wrote: Maybe someone (or multiple people) on the forums with some knowledge and skill can band together with you to re-write this mod to make it the best it can be? Seems "carts" is something almost everyone wants. I wish I could be of service but all I can do is offer some testing.
Maybe if someone fixed the entity duplication bug. I have like 6 chests full of carts.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

Post Reply

Who is online

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