[Mod] Boost cart [boost_cart]

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Boost cart [boost_cart]

by ABJ » Fri Apr 24, 2015 08:52

Thank you very much lightonflux :)
Only problem? The commits needed for CiaranG's railcarts mod has mysteriously disappeared :'( But that's not your fault tho :)
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Boost cart [boost_cart]

by ABJ » Sun May 17, 2015 06:49

I am making my own version of this. Is it OK if I release? And what else do I have to do?

Image
Image
Image
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Sun May 17, 2015 07:25

Splizard wrote:We need upside down rails so we can make rollercoasters!

That would require a rotation function for the vertical axis.

ABJ wrote:I am making my own version of this. Is it OK if I release? And what else do I have to do?

You can release it whenever you want but I suggest to change more things. It's nonsense to have +/- the same mod 3 times on this forum.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Boost cart [boost_cart]

by ABJ » Sun May 17, 2015 08:53

Yes Krock that is just a small demo of what I'm planning for. And is it OK if I keep the same name? I want this mod to replace the default one and the crafting recipes are also same as I don't want to change.

TODO:
-Fancy gold/silver/glowing rails
-Maybe giving the cart a makeover?
-Changing this mod A LOT.

EDIT: And what do you think of this mod's current progress? Is it looking better or worse?
 

ABJ
Member
 
Posts: 2344
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ

Re: [Mod] Boost cart [boost_cart]

by ABJ » Mon May 18, 2015 08:38

Here it is!
Hicarts
It's very different from this mod. Notably in that it has collision detection :)
 

arifsaha
New member
 
Posts: 2
Joined: Sun Mar 29, 2015 14:10
GitHub: arifsaha

Re: [Mod] Boost cart [boost_cart]

by arifsaha » Mon May 18, 2015 20:49

Unfortunately I consistently experience server crashing whenever I right-click the cart. The log shows this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
May 18 14:34:20 2013lr minetestserver[11467]: 14:34:20: ACTION[ServerThread]: MYUSER right-clicks object 2: LuaEntitySAO at (-14,19,-64)
May 18 14:34:21 2013lr minetestserver[11467]: 14:34:21: ERROR[main]: ERROR: An unhandled exception occurred: /var/lib/minetest/.minetest/mods/boost_cart/init.lua:47: attempt to index field 'player_attached' (a nil value)
May 18 14:34:21 2013lr minetestserver[11467]: 14:34:21: ERROR[main]: stack traceback:
May 18 14:34:21 2013lr minetestserver[11467]: 14:34:21: ERROR[main]: #011/var/lib/minetest/.minetest/mods/boost_cart/init.lua:47: in function </var/lib/minetest/.minetest/mods/boost_cart/init.lua:37>
May 18 14:34:21 2013lr minetestserver[11467]: In thread 7f7b8d498880:
May 18 14:34:21 2013lr minetestserver[11467]: /builddir/build/BUILD/minetest-0.4.9/src/main.cpp:1860: int main(int, char**): Assertion '0' failed.
May 18 14:34:21 2013lr minetestserver[11467]: Debug stacks:
May 18 14:34:21 2013lr minetestserver[11467]: DEBUG STACK FOR THREAD 7f7b8d498880:
May 18 14:34:21 2013lr minetestserver[11467]: #0  int main(int, char**)
May 18 14:34:21 2013lr minetestserver[11467]: (Leftover data: #1  Dedicated server branch)
May 18 14:34:21 2013lr minetestserver[11467]: (Leftover data: #2  virtual void ServerMap::save(ModifiedState))
May 18 14:34:21 2013lr minetestserver[11467]: (Leftover data: #3  virtual void Database_SQLite3::saveBlock(MapBlock*))


Any thought?

Thanks!
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Fri Jun 05, 2015 18:36

Today is an update day!

arifsaha wrote:Unfortunately I consistently experience server crashing whenever I right-click the cart. The log shows this:
<snip>

Fixed.

New detector rails for mesecons, added by numberZero:

Image
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

uind_w
Member
 
Posts: 29
Joined: Sun Jul 19, 2015 13:10

Re: [Mod] Boost cart [boost_cart]

by uind_w » Tue Sep 29, 2015 11:12

I read "detector.lua" and find...
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   output = "boost_cart:detectorrail 6",
   recipe = {
      {"default:steel_ingot", "mesecon:mesecon", "default:steel_ingot"},
      {"default:steel_ingot", "group:stick", "default:steel_ingot"},
      {"default:steel_ingot", "mesecon:mesecon", "default:steel_ingot"},
   },

(Line 43-49)
"mesecon:mesecon" is should be "mesecons:mesecon"?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Tue Sep 29, 2015 16:22

uind_w wrote:"mesecon:mesecon" is should be "mesecons:mesecon"?

Thanks for pointing this out. I shouldn't use creative mode to test the new features :)
https://github.com/SmallJoker/boost_cart/commit/ddb6
The recipe will also work when "mesecons_alias" isn't activated.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
tomlukeywood
Member
 
Posts: 85
Joined: Sat Oct 10, 2015 13:13
IRC: tomlukeywood
In-game: tomlukeywood

Re: [Mod] Boost cart [boost_cart]

by tomlukeywood » Sat Oct 17, 2015 15:16

i get the error /home/tom/MinetestGame/bin../mods/carts_mod/init.lua:2: attempt to concatenate a nil value

:(

any ideas?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Boost cart [boost_cart]

by TenPlus1 » Sat Oct 17, 2015 17:03

tomlukeywood: rename carts_mod directory to just carts.
 

katsukitty
New member
 
Posts: 1
Joined: Thu Feb 26, 2015 22:47

Re: [Mod] Boost cart [boost_cart]

by katsukitty » Wed Nov 11, 2015 23:58

TenPlus1 wrote:tomlukeywood: rename carts_mod directory to just carts.


"2015-11-11 18:57:11: ERROR[Main]: ...e/katsu/Programs/minetest/bin/../mods/carts/init.lua:16: attempt to concatenate field 'modpath' (a nil value)"

I get the same error when it's named "carts". Possible bug?
 

Ivà
Member
 
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua

Re: [Mod] Boost cart [boost_cart]

by Ivà » Thu Nov 12, 2015 09:08

katsukitty wrote:"2015-11-11 18:57:11: ERROR[Main]: ...e/katsu/Programs/minetest/bin/../mods/carts/init.lua:16: attempt to concatenate field 'modpath' (a nil value)"

I get the same error when it's named "carts". Possible bug?


It should be boost_cart, as the title says.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Fri Nov 13, 2015 22:13

katsukitty wrote:I get the same error when it's named "carts". Possible bug?

Here's the early XMAS gift for everybody who can't rename mod directories correctly.
I hope this is an understandable error for everybody with this problem.

EDIT: Post #3100
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Boost cart [boost_cart]

by TenPlus1 » Sat Nov 14, 2015 07:51

Nicely done Krock... btw sorry for typing wrong folder name folks.
 

User avatar
Alienant1
Member
 
Posts: 69
Joined: Mon Jul 20, 2015 10:33
In-game: alienant1 or alienant2

Re: [Mod] Boost cart [boost_cart]

by Alienant1 » Sun Nov 29, 2015 19:15

is the power rail/mesecons compatibility now part of the standard download or do I still need to download separately?
Merry Christmas Everyone!!!
 

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

Re: [Mod] Boost cart [boost_cart]

by amadin » Mon Dec 21, 2015 13:36

Can you add stop cart by punching against the moving direction to last commit? I saw it in old commit.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Mon Dec 21, 2015 16:40

Alienant1 wrote:is the power rail/mesecons compatibility now part of the standard download or do I still need to download separately?

Sorry for the late reply. The mesecons compatibility is there with the standard download.

amadin wrote:Can you add stop cart by punching against the moving direction to last commit? I saw it in old commit.

It's already now possible to slow down the cart by punching in the opposite direction. Just move slowly (or press the back/down key) to make it stop.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

Re: [Mod] Boost cart [boost_cart]

by amadin » Mon Dec 21, 2015 17:56

It's already now possible to slow down the cart by punching in the opposite direction. Just move slowly (or press the back/down key) to make it stop.

If cart drive on power rails only it don't stop by punching in the opposite direction or pressing back key.

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

Laudrin
New member
 
Posts: 8
Joined: Mon Dec 21, 2015 10:23
IRC: Laudrin
In-game: laudrin

Re: [Mod] Boost cart [boost_cart]

by Laudrin » Mon Dec 21, 2015 18:24

Thank you Krock, for your awesome addition to the carts mod. It eliminates some of the restrictions. Now I can build a rail network in my world. :-)

I recognized that boost_cart rails have a slightly brighter texture then the original cart mod rails I build before installing your mod. Nothing serious, but is that an intentional choice?

Some suggestions if you should plan to develop more features: It would be great to have the ability to switch railroad junctions i. e. via mesecon singnal or digiline bus or something like that. And signals would be great, when the signal is red, a brake rail would stop the cart (not only decelerate) independent of its speed.
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Re: [Mod] Boost cart [boost_cart]

by benrob0329 » Mon Dec 21, 2015 18:25

Would forceloading the rails be possible?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Tue Dec 22, 2015 08:14

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

Yes. You can replace the "cart.png" texture and "cart.x" model.
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:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if ctrl and ctrl.up then
acc = acc + 0.5
end


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.

There are still some glitchy situations when there's high lag, so don't expect a smooth ride.
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.

benrob0329 wrote:Would forceloading the rails be possible?

It forceloads specific nodes, if they're not loaded yet. However, this does not work anytime.
https://github.com/SmallJoker/boost_car ... ns.lua#L38
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Laudrin
New member
 
Posts: 8
Joined: Mon Dec 21, 2015 10:23
IRC: Laudrin
In-game: laudrin

Re: [Mod] Boost cart [boost_cart]

by Laudrin » Tue Dec 22, 2015 16:22

Krock wrote:You can use sticky pistons to destroy the rails, so the cart will stop instantly (or maybe not?).


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.

Brake rails can turned on and off with mesecons already now, so a new type or rail would be required (buffer rail?).


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.

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.

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.


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.

Thanks for taking my suggestions into consideration! :-)
 

Laudrin
New member
 
Posts: 8
Joined: Mon Dec 21, 2015 10:23
IRC: Laudrin
In-game: laudrin

Re: [Mod] Boost cart [boost_cart]

by Laudrin » Wed Dec 23, 2015 00:19

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.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Wed Dec 23, 2015 07:42

Laudrin wrote:Can you give me a hint how it's done?

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

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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: [Mod] Boost cart [boost_cart]

by twoelk » Wed Dec 23, 2015 11:34

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.
 

Laudrin
New member
 
Posts: 8
Joined: Mon Dec 21, 2015 10:23
IRC: Laudrin
In-game: laudrin

Re: [Mod] Boost cart [boost_cart]

by Laudrin » Wed Dec 23, 2015 11:51

Krock wrote:The cart calculates its velocity each node, this means, it will decelerate and start moving backwards again (like it does on hills).


Yes, that was my problem, the cart would reverse direction instead of stopping.

- 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


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.

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:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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,
      },
   },


I changed the rail and crafting definition, too. That seems to work, I can craft the stop rails and place them on the ground.

Here's the part in the init.lua I added (without the print commands for debug output):

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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


But as I wrote sometimes it works, sometimes the cart won't stop even when the debug message tells me that the stop rail was detected and velocity set to 0.

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.


Thanks, I will look into it as soon as I fixed stopping and starting the cart.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] Boost cart [boost_cart]

by SaKeL » Tue Jan 12, 2016 23:20

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 :/
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Boost cart [boost_cart]

by Krock » Sun Jan 17, 2016 09:18

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

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.

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. :-/

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.

SaKeL wrote:i get stuck in the walls and floor when im driving and punching the cart

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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

Re: [Mod] Boost cart [boost_cart]

by amadin » Mon Jan 18, 2016 18:50

ATTENTION!!! Mod have bug: if you put cart and then disconnect and connect again - cart will not work.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 20 guests

cron