My Train Mod

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

My Train Mod

by jordan4ibanez » Post

I'll rewrite this eventually
https://github.com/jordan4ibanez/trains




Original Mod Post:

Code: Select all

[b]Test it[/b] - Do not build anything across the 0 node on the x or z I am currently fixing that
Check up on this regularly, I update this a lot (Revision 0020 currently)
[url=https://www.dropbox.com/s/4o9vjxzsns24dxg/trains0020.tar.gz?dl=0]tar.gz[/url]
[url=https://www.dropbox.com/s/optvh3umijeiyxw/trains0020.zip?dl=0].zip[/url]

I am currently creating a multi entity train mod, here is a video of the current state:
http://youtu.be/B5PP8k8KcIo

The main focus of this mod is so that you can haul a lot of stuff across great distances, transport things and generally have a great time. All of the trains and cars will be able to hook together and will work as one singular entity. There will also be weight to the cars and torque to the train, so you will be forced to hook together engines to pull the cars.

I am going to have:
Planned Things

-Steam trains with and without a tender
-Minecarts
-Storage cars


Possible Things
-Water stations that automatically refill your water
-Coal stations which automatically refill your tender
-Mining bore car which attaches to the front of the train
-Passanger cars
-Liquid cars
-Flatbed cars for storing vehicles from other mods if there are any
-A crane
-A caboose


I'm still working on bugs (ie serialization, or if only one part of the train spawns, which will force load chunks) and making the cars more modular, maybe I'll even work it into an API (unlikely though).
This will take quite a long time to get done, so if anyone can create meshes that would be awesome!
Last edited by jordan4ibanez on Sat Jul 16, 2016 10:30, edited 13 times in total.

TriBlade9
Member
Posts: 89
Joined: Fri Sep 05, 2014 09:35

Re: My Train Mod

by TriBlade9 » Post

This is quite an awesome mod! I can't wait to see how it turns out. That pink engine looks amazing. :P
How exactly did you get the entities to act as one and calculate the rotation correctly?

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: My Train Mod

by rubenwardy » Post

Awesome. Will that be like the Minecraft train mod?

https://www.youtube.com/watch?v=DaLOASx7Lrc

It's nice that you're back.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

u34

Re: My Train Mod

by u34 » Post

+1 good work ...

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: My Train Mod

by ExeterDad » Post

Oh I sure hope you keep this up! I just showed my kids the video. They are SUPER excited about this!
Hell... I'm excited!

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: My Train Mod

by maikerumine » Post

+1 Very nice work!!!
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

TriBlade9 wrote:This is quite an awesome mod! I can't wait to see how it turns out. That pink engine looks amazing. :P
How exactly did you get the entities to act as one and calculate the rotation correctly?
Tables and IDs! And for rotation see the code below.
rubenwardy wrote:Awesome. Will that be like the Minecraft train mod?

https://www.youtube.com/watch?v=DaLOASx7Lrc

It's nice that you're back.
Yes. That was the inspiration for it actually. I wanted to do this mod a few years back but I was too inexperienced. The main difference between that mod and mine is that:
1.) ALL engines and wheels will be animated based on speed
2.) Due to the way mine works, there won't be issues with the way train's models not facing the correct direction due to the way that the direction is calculated

This is the calculations, it positions the engine in between the two trucks and sets the yaw based on them. This will work whether the train is going backwards or forwards.

Code: Select all

--pos
local pos1  = train_table[self.id][1].object:getpos()
local pos2  = train_table[self.id][2].object:getpos()
local cpos  = self.object:getpos()
local pos   = {x=(pos2.x+pos1.x)/2, y=cpos.y, z=(pos2.z+pos1.z)/2}
self.object:setpos(pos)
--yaw
local vec = {x=pos2.x-pos1.x, y=0, z=pos2.z-pos1.z}
local yaw = math.atan(vec.z/vec.x)+math.pi/2
if pos2.x < pos1.x then
	yaw = yaw + math.pi
end
self.object:setyaw(yaw)
And thank you! With my new diet and increased knowledge I'll be able to pump out some truly incredible mods, but don't quote me. :P
cHyper wrote:+1 good work ...
Thank you!
ExeterDad wrote:Oh I sure hope you keep this up! I just showed my kids the video. They are SUPER excited about this!
Hell... I'm excited!
Just wait until the train is complete and pulls a few cars, then you'll be truly excited, haha.
maikerumine wrote:+1 Very nice work!!!
Thank you!

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: My Train Mod

by addi » Post

wow! just missing words to describe how amazing this is.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

addi wrote:wow! just missing words to describe how amazing this is.
Thank you!

Also, here is a new video:
http://youtu.be/bqPDE2Xdgbs

The added features are:
-Trucks keep an even distance from each other
-Trucks force load a 5x5 area so that they can be autonomous
-Everything looks a little better

TriBlade9
Member
Posts: 89
Joined: Fri Sep 05, 2014 09:35

Re: My Train Mod

by TriBlade9 » Post

jordan4ibanez wrote:
addi wrote:wow! just missing words to describe how amazing this is.
Thank you!

Also, here is a new video:
http://youtu.be/bqPDE2Xdgbs

The added features are:
-Trucks keep an even distance from each other
-Trucks force load a 5x5 area so that they can be autonomous
-Everything looks a little better
Wow! You're making a lot of progress fast.
However, the turning doesn't look quite as nice as the last one.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

TriBlade9 wrote:
jordan4ibanez wrote:
addi wrote:wow! just missing words to describe how amazing this is.
Thank you!

Also, here is a new video:
http://youtu.be/bqPDE2Xdgbs

The added features are:
-Trucks keep an even distance from each other
-Trucks force load a 5x5 area so that they can be autonomous
-Everything looks a little better
Wow! You're making a lot of progress fast.
However, the turning doesn't look quite as nice as the last one.
That's because I didn't add additional space to the trucks to fit the model, lets see if I can post a quick video of it adjusted in a bit

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: My Train Mod

by ExeterDad » Post

This is gonna be awesome! *jumping up and down*

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

The distance between trucks is now adjustable so here's a video of smoother turning:
http://youtu.be/LFyndP3OIL8

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

Re: My Train Mod

by Krock » Post

jordan4ibanez wrote:The distance between trucks is now adjustable so here's a video of smoother turning:
http://youtu.be/LFyndP3OIL8
Whoa, that's great! I hope you can use a better texture soon.
Also change the object params, so it collides with other objects :)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: My Train Mod

by Nathan.S » Post

Great work, this looks amazing.
Two questions, is the code on github or available to download at all, and are you planing on setting up switches?
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

Nathan.S wrote:Great work, this looks amazing.
Two questions, is the code on github or available to download at all, and are you planing on setting up switches?
Thank you very much!
Not yet, this code is way to young to be usable or even testable. When I work out all the bugs I will put it up for download.

Also, here's a new video:
http://youtu.be/B5PP8k8KcIo

TG-MyinaWD
Member
Posts: 356
Joined: Thu May 08, 2014 21:22
GitHub: Maddie-Myina
IRC: Maddie-Myina
In-game: .
Location: Far Eden

Re: My Train Mod

by TG-MyinaWD » Post

Now this will go great for New York :D also great amazing bygone awesome.

Might be an very useful if had passenger cart Fit players. maybe 10 or even 25. depending how many seats. Also I see in the near Future an "The Poler Express" map.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.

User avatar
Lukester
Member
Posts: 16
Joined: Thu Nov 06, 2014 23:53
In-game: LukeOnEnergy

Re: My Train Mod

by Lukester » Post

This mod looks amazing. I can't wait until its 100% complete. Keep up the good work. :)

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: My Train Mod

by ExeterDad » Post

Yeah! What he said ^^

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: My Train Mod

by philipbenr » Post

+1 I am loving this. I hope that this does get far enough to be useable very soon.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

Test it - Do not build anything across the 0 node on the x or z I am currently fixing that
Also this is just currently a mine cart
.tar.gz
.zip

EDIT
Alright, it's ready to be tested

User avatar
Lukester
Member
Posts: 16
Joined: Thu Nov 06, 2014 23:53
In-game: LukeOnEnergy

Re: My Train Mod

by Lukester » Post

I tested it and it needs a lot of work before being released to the public. Keep up the good work though. Heres the vid https://www.youtube.com/watch?v=t2Et3p0 ... e=youtu.be

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

Lukester wrote:I tested it and it needs a lot of work before being released to the public. Keep up the good work though. Heres the vid https://www.youtube.com/watch?v=t2Et3p0 ... e=youtu.be
Did the file you downloaded say 0015 or 0016?

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Post

Hey guys, here's a new video of the current state of the new code:
http://youtu.be/6li-79p5hlA

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: My Train Mod

by ExeterDad » Post

jordan4ibanez wrote:Hey guys, here's a new video of the current state of the new code:
http://youtu.be/6li-79p5hlA
Thanks for the vid! Yeah... those buggers can move!
Question. As development moves on, do you think it will be possible for train cars to follow behind the engine? If so... it will be epic. It's certain my kids will have me making models of their favorite trains. We go rail fanning all the time. They are huge enthusiasts.

They have hundreds, maybe even a thousand or more bucks invested in their HO scale train sets. You may be saving me a ton of cash! LOL

Post Reply

Who is online

Users browsing this forum: rudzik8 and 14 guests