[Mod] Boost cart [boost_cart]

User avatar
Krock
Developer
 
Posts: 4371
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
Member
 
Posts: 10
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: 684
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: 4371
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>
 

User avatar
Miniontoby
Member
 
Posts: 198
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [Mod] Boost cart [boost_cart]

by Miniontoby » Sat Jul 20, 2019 11:50

Can you do that rails that is placed not connect with the other rails that be near the rails .

I mean that you can set on witch direction the rails should connect
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

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

Re: [Mod] Boost cart [boost_cart]

by Krock » Sat Jul 20, 2019 12:23

Miniontoby wrote:I mean that you can set on witch direction the rails should connect

The rail connections are calculated by Minetest, thus I cannot change anything there. Although it's possible to register multiple kinds of rails, like so:
Code: Select all
boost_cart:register_rail("boost_cart:rail2", {
   description = "Rail 2",
   tiles = {
      "carts_rail_straight.png", "carts_rail_curved.png",
      "carts_rail_t_junction.png", "carts_rail_crossing.png"
   },
   groups = boost_cart:get_rail_groups({ rail = 2 })
})

This will allow you to place two different kinds of rails next to each other without having a connection. But there's yet no way to switch from one rail type to another while driving.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Miniontoby
Member
 
Posts: 198
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [Mod] Boost cart [boost_cart]

by Miniontoby » Thu Jul 25, 2019 07:09

Does this now works? viewtopic.php?p=172788#p172788
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

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

Re: [Mod] Boost cart [boost_cart]

by Krock » Thu Jul 25, 2019 17:16

Miniontoby wrote:Does this now works? viewtopic.php?p=172788#p172788

Sorry? That's a showcase of the mod's capabilities. The only thing you need is a simple mod to register more rails.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

ThorfinnS
Member
 
Posts: 138
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Mod] Boost cart [boost_cart]

by ThorfinnS » Thu Oct 17, 2019 21:02

Must not have been an issue before 5.1, but now I'm getting a fatal loading moreores and boost_cart.
Code: Select all
2019-10-17 15:56:31: ERROR[Main]: ModError: Failed to load and run script from C:\games\mt\latest\bin\..\mods\boost_cart\init.lua:
2019-10-17 15:56:31: ERROR[Main]: C:\games\mt\latest\bin\..\mods\boost_cart/rails.lua:24: attempt to index field 'moreores:copper_rail' (a nil value)
2019-10-17 15:56:31: ERROR[Main]: stack traceback:
2019-10-17 15:56:31: ERROR[Main]:    C:\games\mt\latest\bin\..\mods\boost_cart/rails.lua:24: in main chunk
2019-10-17 15:56:31: ERROR[Main]:    [C]: in function 'dofile'
2019-10-17 15:56:31: ERROR[Main]:    C:\games\mt\latest\bin\..\mods\boost_cart\init.lua:33: in main chunk
2019-10-17 15:56:31: ERROR[Main]: Check debug.txt for details.
2019-10-17 15:56:31: ACTION[Main]: Server: Shutting down


For what it's worth, the gits we're using are:
Code: Select all
https://github.com/SmallJoker/boost_cart.git
https://notabug.org/TenPlus1/moreores.git


Or is it that the migration of copper to mtg is not complete?
 

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

Re: [Mod] Boost cart [boost_cart]

by Krock » Fri Oct 18, 2019 08:10

The official moreores repository can be found here: https://github.com/minetest-mods/moreores
However, the following commit broke boost_cart: https://github.com/minetest-mods/moreor ... t/d0a1798b

Bug fixed in https://github.com/SmallJoker/boost_car ... t/ae33bd7a.
>> 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: No registered users and 9 guests