[Mod] Boost cart [boost_cart]

User avatar
Krock
Developer
 
Posts: 4226
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Fri Nov 23, 2018 20:55

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.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

goldcrest42
New member
 
Posts: 8
Joined: Sat Sep 29, 2018 17:46
GitHub: claretty

Re: [Mod] Boost cart [boost_cart]

by goldcrest42 » Thu Dec 13, 2018 14:32

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!
Beware of programmers with soldering irons!
 

User avatar
v-rob
Member
 
Posts: 618
Joined: Thu Mar 24, 2016 03:19
Location: Right behind you.
GitHub: v-rob

Re: [Mod] Boost cart [boost_cart]

by v-rob » Sun Dec 23, 2018 05:41

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).
 

User avatar
Krock
Developer
 
Posts: 4226
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Sun Dec 23, 2018 18:19

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.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests