[Mod] Boost cart [boost_cart]
- benrob0329
- Member
- Posts: 1341
- Joined: Thu Aug 06, 2015 22:39
- GitHub: Benrob0329
- IRC: benrob0329
- In-game: benrob03
- Location: Michigan
- Contact:
Re: [Mod] Boost cart [boost_cart]
Would forceloading the rails be possible?
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Yes. You can replace the "cart.png" texture and "cart.x" model.amadin wrote:Can you add different texture inside and outside cart? I want replace texture with wheels like in minecart.
Can you set contorl by keys (up, down), like in minecraft, or how can i do this by itself?.
The `down´ key decelerates the cart, so it's easy to add the `up´ key to accelerate the cart.
https://github.com/SmallJoker/boost_car ... t.lua#L232
You may try adding the following under the handbrake function:
Code: Select all
if ctrl and ctrl.up then
acc = acc + 0.5
end
There are still some glitchy situations when there's high lag, so don't expect a smooth ride.Laudrin wrote:I recognized that boost_cart rails have a slightly brighter texture <snip> Nothing serious, but is that an intentional choice?
Some suggestions <snip>: <snip> switch railroad junctions
<snip> when the signal is red, a brake rail would stop the cart (not only decelerate) independent of its speed.
The old textures were not useful after the direction choice feature, so I replaced them to give them a better look.
You can use sticky pistons to destroy the rails, so the cart will stop instantly (or maybe not?).
Brake rails can turned on and off with mesecons already now, so a new type or rail would be required (buffer rail?).
The "forced" switch is a good idea. Mesecon signal on junction = push cart in the opposite direction.
If you know Lua and how to use GitHub, I would like to see a pull request. Otherwise it may take a while until I add new features.
It forceloads specific nodes, if they're not loaded yet. However, this does not work anytime.benrob0329 wrote:Would forceloading the rails be possible?
https://github.com/SmallJoker/boost_car ... ns.lua#L38
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: [Mod] Boost cart [boost_cart]
Hm, I already experimented with those, but as you said, that would mean the rail track would be destroyed and I'd have to repair it manually.Krock wrote:You can use sticky pistons to destroy the rails, so the cart will stop instantly (or maybe not?).
Unfortunately brake rails are too unreliable where exactly the cart will stop (at first I tried to slow down the cart via brake rails so it will stop on a longer part of the track containing powered rails, but sometimes the cart would stop on the brake rails, sometimes it won't slow down enough and pass the brake and the powered rails) and I cannot restart the cart via button / powered rails.Brake rails can turned on and off with mesecons already now, so a new type or rail would be required (buffer rail?).
Maybe best would be a start/stop rail. When not connected to a power source / powered mesecon the cart would stop (instant brake rail), when powered the rails would act like a powered rail.
I already browsed the code, but I'm neither familiar with Lua nor GitHub. I'll try to understand how programming/modding for Minetest is done in Lua and if I'd succeed I attach / send the code for further testing. :-) But please don't expect results too soon from someone new to Lua like me.The "forced" switch is a good idea. Mesecon signal on junction = push cart in the opposite direction.
If you know Lua and how to use GitHub, I would like to see a pull request. Otherwise it may take a while until I add new features.
Thanks for taking my suggestions into consideration! :-)
Re: [Mod] Boost cart [boost_cart]
Krock, I created a new kind of rail ("stop rail") which should stop the cart when not powered via mesecon, and accelerate it when powered. Acceleration works fine, but I only can find a way to set an amount of deceleration for the rail, not to stop the cart completely via function or directly setting the carts velocity to zero.
Can you give me a hint how it's done?
If the stop rail works, it can be used to build signals which will stop the cart immediately when signalling red/stop and start them again as soon as the signal turns green/go.
Can you give me a hint how it's done?
If the stop rail works, it can be used to build signals which will stop the cart immediately when signalling red/stop and start them again as soon as the signal turns green/go.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Using the acceleration and deceleration feature is a good start but not the best solution. The cart calculates its velocity each node, this means, it will decelerate and start moving backwards again (like it does on hills).Laudrin wrote:Can you give me a hint how it's done?
What I would do is:
- Adding a new meta int "cart_stop" to the new stop rail node
- Checking the meta value near here
- Changing acceleration `acc´ and velocity `vel´ array all to zero and the velocity update flag `update.vel´ to `true´ when the integer "cart_stop" equals 1
The problem will be the cart starting. It does not know in which direction it was driving before -> valvulated by velocity.
However, also this can be solved by getting the cart yaw and defining its direction that way.
I hope this explanation was partwise understandable.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: [Mod] Boost cart [boost_cart]
was playing with the freeze mod some time ago that had a similar problem.
I experimented with teleporting the player/object a zero distance to eleminate any velocity.
btw never got working the way I had hoped.
so with carts, how about the rail detecting the passing cart and teleporting it back to the center of the node and while doing so over riding any direction and velocity information. might have something of a snapback effect on a fast cart on a laggy server though. :-D
you might have the special rail store the movement information for future use if needed.
I experimented with teleporting the player/object a zero distance to eleminate any velocity.
btw never got working the way I had hoped.
so with carts, how about the rail detecting the passing cart and teleporting it back to the center of the node and while doing so over riding any direction and velocity information. might have something of a snapback effect on a fast cart on a laggy server though. :-D
you might have the special rail store the movement information for future use if needed.
Re: [Mod] Boost cart [boost_cart]
Yes, that was my problem, the cart would reverse direction instead of stopping.Krock wrote:The cart calculates its velocity each node, this means, it will decelerate and start moving backwards again (like it does on hills).
Did what you recommended, testing for hours with various variants of the code try to work out lua programming with the tutorials and looking at your mod and other mod's code.- Adding a new meta int "cart_stop" to the new stop rail node
- Checking the meta value near init.lua line 219
- Changing acceleration `acc´ and velocity `vel´ array all to zero and the velocity update flag `update.vel´ to `true´ when the integer "cart_stop" equals 1
Even with restarting minetest, removing the rails and building them anew I get different results. Sometimes it works: The cart will stop on the stop rail and start again (even in the right direction) when punching the mesecon button connected to the rails. But sometimes the cart will just slow down a bit and then accelerate again, passing the stop rail. :-/
I duplicated the power rail's code and texture, renamed the texture and changed it's color, and replaced parts of the code as follows:
Code: Select all
after_place_node = function(pos, placer, itemstack)
if not mesecon then
minetest.env:get_meta(pos):set_int("cart_stop", "1")
end
end,
mesecons = {
effector = {
action_on = function(pos, node)
minetest.env:get_meta(pos):set_int("cart_stop", "0")
boost_cart:boost_rail(pos, 2)
end,
action_off = function(pos, node)
minetest.env:get_meta(pos):set_int("cart_stop", "1")
end,
},
},
Here's the part in the init.lua I added (without the print commands for debug output):
Code: Select all
local stop_mod = tonumber(minetest.get_meta(pos):get_int("cart_stop"))
if stop_mod and stop_mod >= 1 then
acc = 0
for _,v in ipairs({"x","y","z"}) do
vel[v] = 0
update.vel = true
end
end
Thanks, I will look into it as soon as I fixed stopping and starting the cart.The problem will be the cart starting. It does not know in which direction it was driving before -> valvulated by velocity.
However, also this can be solved by getting the cart yaw and defining its direction that way.
- SaKeL
- Member
- Posts: 743
- Joined: Tue Apr 14, 2015 18:39
- GitHub: JurajVajda
- IRC: SaKeL
- In-game: SaKeL
Re: [Mod] Boost cart [boost_cart]
i get stuck in the walls and floor when im driving and punching the cart (not sure if punching it is the reason), is this known issue ? Only logout/login helps to un-stuck myself again :/
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
That's what the cart should do when it can't find the next rail - it resets to the last known position. However, this seems not to work everytime.twoelk wrote:how about the rail detecting the passing cart and teleporting it back to the center of the node and while doing so over riding any direction and velocity information
If the cart moves too fast, it can "skip" a node - it does not check it if it's a rail or not. Using this method, the cart should move a bit smoother. However, the downside is that you might need two or even three nodes until the cart reads one of them when driving on them.Laudrin wrote:Even with restarting minetest, removing the rails and building them anew I get different results. Sometimes it works: The cart will stop on the stop rail and start again (even in the right direction) when punching the mesecon button connected to the rails. But sometimes the cart will just slow down a bit and then accelerate again, passing the stop rail. :-/
Yes, sometimes it doesn't reset the cart position. I haven't found a way to fix this yet. Early versions of boost_cart had more bugs in that area - make sure you have the latest version from GitHub.SaKeL wrote:i get stuck in the walls and floor when im driving and punching the cart
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: [Mod] Boost cart [boost_cart]
ATTENTION!!! Mod have bug: if you put cart and then disconnect and connect again - cart will not work.
Re: [Mod] Boost cart [boost_cart]
That bug was fixed :) Enjoy your railways! Works nice for me.ATTENTION!!! Mod have bug: if you put cart and then disconnect and connect again - cart will not work.
Re: [Mod] Boost cart [boost_cart]
I've tried adding it afterKrock wrote:amadin wrote:You may try adding the following under the handbrake function:Code: Select all
if ctrl and ctrl.up then acc = acc + 0.5 end
Code: Select all
if ctrl and ctrl.down and math.abs(vel.x + vel.z) > 1.2 then
acc = acc - 1.2
end
Thanks.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
No, you added it correctly. To make the difference bigger, try changing the value to 1 instead of 0.5:222 wrote:and I'm not seeing a difference. Did I put it in the wrong place?
Code: Select all
acc = acc + 1
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: [Mod] Boost cart [boost_cart]
Decided to try this mod because the base carts mode was too buggy and so far have like it. I have found two possible issues; I have a rather large square mine under my base and wanted to use rails to easily get up and down. he going down isn't the issue but going up is the issue. I currently have boost rails every other rail but just using the power of the boost rails to move the cart forward its only able to climb ~24 block before is slows down too much and heads back down. The only reason i can gather that the cart slows down is that dir.y gets too large, a dir.y value of 3 or greater will negate any acc from the boost rails.
the other issue is that this code:
still throws a nil exception. the fix you recently made on github to line 27 of the init file will fix it. What is odd is that i have mesecons installed but the detector rail is not available.
the other issue is that this code:
Code: Select all
if mesecon then
boost_cart:signal_detector_rail(vector.round(pos))
end
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Thanks for the report. This bug was fixed in the most recent commit: 7d6132luewind wrote:still throws a nil exception. the fix you recently made on github to line 27 of the init file will fix it. What is odd is that i have mesecons installed but the detector rail is not available.
If it still doesn't work after this commit, check if you enabled the mod "mesecons" or reinstall the complete modpack if required.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- ExeterDad
- Member
- Posts: 1717
- Joined: Sun Jun 01, 2014 20:00
- In-game: ExeterDad
- Location: New Hampshire U.S.A
Re: [Mod] Boost cart [boost_cart]
Today it just occurred to me that the arrow keys are not working for me. I assumed it was a laptop thing. I tried with a real keyboard as well. I can not use the arrows to turn at crossings, nor can I brake with the down arrow key. I tried on our server and also in singleplayer.
Minetest does see my arrow keys as I can toggle through command history in chat. That said... is it possible the new chat could be affecting this for boost carts? Can anyone replicate this behavior? Or am I missing something?
Love the mod by the way.
Minetest does see my arrow keys as I can toggle through command history in chat. That said... is it possible the new chat could be affecting this for boost carts? Can anyone replicate this behavior? Or am I missing something?
Love the mod by the way.
HOMETOWN -Our little server. Keep the HOMETOWN chatter @ http://hometownserver.com - Our server map: http://media.hometownserver.com
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Using Lua it's not possible to check the <- ^ v -> arrow keys, thus you must use A and D to switch the rails.ExeterDad wrote:Today it just occurred to me that the arrow keys are not working for me.
Surely it works in the chat, because it's a client side thing ;)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- ExeterDad
- Member
- Posts: 1717
- Joined: Sun Jun 01, 2014 20:00
- In-game: ExeterDad
- Location: New Hampshire U.S.A
Re: [Mod] Boost cart [boost_cart]
Thanks Krock. I completely misunderstood. I took it as literal that the < ^ v > keys were used in this mod. Can't believe I never thought to try the WASD keys *headsmack
I'll check it out later when we play again.
I'll check it out later when we play again.
HOMETOWN -Our little server. Keep the HOMETOWN chatter @ http://hometownserver.com - Our server map: http://media.hometownserver.com
-
- Member
- Posts: 49
- Joined: Fri Dec 12, 2014 21:32
- In-game: Jesseman1 or Plant_Operator
- Location: My huge fortress or power plant.
Re: [Mod] Boost cart [boost_cart]
Quick question: I've never updated a mod before, so is the link found on the first page changed with every update, or do I need to scroll through the list of replies to find it?
- ExeterDad
- Member
- Posts: 1717
- Joined: Sun Jun 01, 2014 20:00
- In-game: ExeterDad
- Location: New Hampshire U.S.A
Re: [Mod] Boost cart [boost_cart]
The links in his first post are linked to his GitHub. Those kind of links are the latest code.
HOMETOWN -Our little server. Keep the HOMETOWN chatter @ http://hometownserver.com - Our server map: http://media.hometownserver.com
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Update time
There is now a slightly modified version of this boost_cart mod in the official minetest_game. Thus, you will most likely not need this mod anymore after the release of Minetest 0.4.15.However, there are some differences:
Mesecons
When enabled, they are used to turn the acceleration of power- and brake-rails on and off. In the MTG (minetest_game) version you won't be able to turn them off again: all rails have a pre-defined acceleration value, which cannot be changed per node (yet).
Additional rails
The start/stop and detector rails, which depend on mesecons, are only available in this mod. They will result in unknown nodes when disabling boost_cart.
Other..
Also the people people who use a different subgame can still use carts without the effort to copy & paste the carts mod out of MTG. All subgames which contain the default mod (= almost all of them) are fully supported.
Latest changes (in boost_cart)
New rail textures, the T junction rails now show the default choosen direction, when no key is pressed to move the cart in the opposite direction.
Don't forget to report bugs and ask questions - bring the development along!
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
-
- Member
- Posts: 316
- Joined: Sun Feb 15, 2015 07:14
- IRC: redneonglow redblade7
- In-game: redblade7 redblade7_owner
Re: [Mod] Boost cart [boost_cart]
There is a big problem with the included carts mod now: you can't punch a side to change the direction, it just keeps going and going until you pick it up. So on my server I moved carts out of games/minetest_game/mods while leaving boost_cart there.
There is a bug a player discovered: /home does not work when you are inside a cart.
There is a bug a player discovered: /home does not work when you are inside a cart.
-redblade7, admin of: THE CREATIVE GARDENS (creative), THE VALLEYS (sandbox), and THE DIGITAL FARMS (farming/hunger/shops)
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: [Mod] Boost cart [boost_cart]
Because I can. \o/ABJ wrote:Hey why the change?
I tested this with the latest version of MTG's carts on a Windows in-development build and couldn't reproduce this issue. Please download/pull the newest version from GitHub and try again.redblade7 wrote:you can't punch a side to change the direction, it just keeps going and going until you pick it up.
/teleport does not work then aswell. Mods that use attachments like beds, boats and planes have the same behaviour. It would mess up these mods when the players would be force teleported, thus this is not a bug and logically won't be fixed.redblade7 wrote:/home does not work when you are inside a cart.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
-
- Member
- Posts: 316
- Joined: Sun Feb 15, 2015 07:14
- IRC: redneonglow redblade7
- In-game: redblade7 redblade7_owner
Re: [Mod] Boost cart [boost_cart]
MTG's powered rails without mesecons power plants are as fast as your powered rails with mesecons power plants. So there's no "in-between speed" for rail systems already built.Krock wrote:I tested this with the latest version of MTG's carts on a Windows in-development build and couldn't reproduce this issue. Please download/pull the newest version from GitHub and try again.redblade7 wrote:you can't punch a side to change the direction, it just keeps going and going until you pick it up.
-redblade7, admin of: THE CREATIVE GARDENS (creative), THE VALLEYS (sandbox), and THE DIGITAL FARMS (farming/hunger/shops)
Who is online
Users browsing this forum: No registered users and 13 guests