[Mod] Boost cart [boost_cart]

Re: [Mod] Boost cart [boost_cart]

Postby Krock » Fri Nov 23, 2018 8:55 pm

goldcrest42 wrote:Is there a list on the wiki anywhere which clarifies what keys the control bits refer to?

https://github.com/minetest/minetest/bl ... #L157-L393
Specifically: https://github.com/minetest/minetest/bl ... s.txt#L181

Open the advanced setting dialogue in the main menu and change "keymap_sneak" to "KEY_SHIFT". Or wait for version 5.0 where the fix will most likely be included.
Krock
Developer
 
Posts: 4227
Joined: Thu Oct 03, 2013 7:48 am
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

Postby goldcrest42 » Thu Dec 13, 2018 2:32 pm

A (somewhat belated) thanks for that, Krock. I will wait for 5.0.

I also realised, a bit after I posted, what LMB and RMB were.. I'm slow!
goldcrest42
New member
 
Posts: 8
Joined: Sat Sep 29, 2018 5:46 pm
GitHub: claretty

Re: [Mod] Boost cart [boost_cart]

Postby v-rob » Sun Dec 23, 2018 5:41 am

So, since the pull request for get_rotation and set_rotation was merged, will you use this to change the cart's pitch when 5.0 comes out? As it is, only the cart models made for boost cart work properly. Any other model won't rotate when moving up hills.

//////////////////////////////////////////////////

Anyway, about hitching carts (yes, I know I'm persistent :-P): You were talking about a video hidden on Youtube for hitching carts. I found two possible candidates of what you might be talking about.

The first one is of the last rendition of the trains mod by jordan4ibanez, which, although glitchy, did include basic cart hitching. Here are three links:
The video itself: https://www.youtube.com/watch?v=rBvKqzT ... e=youtu.be
The forum topic: viewtopic.php?f=9&t=11027&hilit=my+train+mod
The source code: https://github.com/jordan4ibanez/trains

This mod seems to hitch things by defining a leader cart and making all carts in the lineup follow that leading cart by setting their velocity to it.

The other video is here: https://vimeo.com/156622682. I found this one in the railnet mod topic by the author. This has no accompanying code, so I can only guess as to how it worked. The hitcher seems to move the cart forward until it hits another cart, whereupon it hitches.

So, from these, I think that the best way to proceed (and this is just an idea) is to make some sort of cart hitcher craftitem/tool that hitches two carts together if the carts are right next to each other. These would be stored in an attachment table that would probably look something like this:

Code: Select all
attachments = {
    front = cart_id_here or "",
    back = another_cart_id or "",
    leader = true/false
}

The cart id's would be an id given to each boost cart randomly, such as a large number, or something extremely hacky, like tostring(self) (That would be one of the most hacky solutions ever ;-)) The leader would be the cart in the front of the train and would only change if a cart is hitched in front of the leader.

From here, all changes to the leader would make changes to the rest of the train. Only the leader would be affected by punches, speed changes, start/stop/brake/mese rails.

If a rail is broken or a cart was removed from the center of the train, breaking the chain, one of three things could happen (I'm not sure which is best): The carts one the side without the leader should either automatically be assigned a new leader, keep their attachments but not get a new leader and a new leader would have to be assigned by hitching another cart, or lose all their attachments and become a bunch of normal, unattached carts. The carts on the side of the broken chain with the leader should keep moving like normal.

//////////////////////////////////////////////////

Anyway, this is just a concept, and may be nothing like your ideas, if you have any at all. If you ever feel like making actual hitching, I'd be willing to help in whatever way I could since I know how hard it is to program a large thing like this alone. (I do hope you decide to do it soon, because it's unbelievably fun to ride a line of carts around, even if it is a laggy, buggy mod from 2015).
v-rob
Member
 
Posts: 619
Joined: Thu Mar 24, 2016 3:19 am
GitHub: v-rob

Re: [Mod] Boost cart [boost_cart]

Postby Krock » Sun Dec 23, 2018 6:19 pm

I am well aware of the new rotation feature in Minetest 5.0.0-dev but I'd like to make use of this feature as soon the remaining bugs are solved. Afterwards I'd love to add an API to register carts - maybe one mod will extend boost_cart with an oversized train model ;) - I wouldn't worry much about the motion jerkyness. For psudo-diagonal rails it would be possible to tweak the yaw interpolation a bit.

Hitching carts sound great, look nice but for performance reasons and the attachment system which currently sucks, I'm not keen on implementing this feature anytime soon. That would be up to extension mods - where I hope that I can provide API functions they need for it.
Krock
Developer
 
Posts: 4227
Joined: Thu Oct 03, 2013 7:48 am
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

Postby redblade7 » Wed Mar 13, 2019 9:26 am

Just a note that under v5, you can't remove carts (or other MTG mods) from the directory when installing boost_cart or you will have random crashes. Both carts and boost_cart must be in the directory.

See: viewtopic.php?f=6&t=22340&p=345960
redblade7
Member
 
Posts: 240
Joined: Sun Feb 15, 2015 7:14 am
In-game: redblade7 redblade7_owner

Re: [Mod] Boost cart [boost_cart]

Postby Krock » Sat Mar 16, 2019 2:39 pm

@redblade7: Do not modifiy minetest_game unless you want to develop. Otherwise it will become very hard to update to a newer version (conflict with modified/removed files).
boost_cart can and should be installed like a regular mod. It will overwrite the default carts in the relevant places.
Krock
Developer
 
Posts: 4227
Joined: Thu Oct 03, 2013 7:48 am
GitHub: SmallJoker



Return to Mod Releases



Who is online

Users browsing this forum: Bing Bot [Bot] and 0 guests