My Train Mod

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

My Train Mod

by jordan4ibanez » Fri Jan 16, 2015 07:53

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 » Fri Jan 16, 2015 09:39

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: 5883
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: My Train Mod

by rubenwardy » Fri Jan 16, 2015 10:10

Awesome. Will that be like the Minecraft train mod?

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

It's nice that you're back.
 

User avatar
cHyper
Member
 
Posts: 842
Joined: Fri May 06, 2011 08:49
Location: Austria
GitHub: cHyper-0815OL
IRC: cHyper
In-game: cHyper cHyper_0815
 

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

Re: My Train Mod

by ExeterDad » Fri Jan 16, 2015 12:28

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: 1350
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine
 

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Fri Jan 16, 2015 18:02

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: 659
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

Re: My Train Mod

by addi » Fri Jan 16, 2015 19:19

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

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sat Jan 17, 2015 03:14

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 » Sat Jan 17, 2015 03:33

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: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sat Jan 17, 2015 03:49

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
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: My Train Mod

by ExeterDad » Sat Jan 17, 2015 04:02

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

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sat Jan 17, 2015 04:39

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

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

Re: My Train Mod

by Krock » Sat Jan 17, 2015 08:07

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: 923
Joined: Wed Sep 24, 2014 17:47
Location: Bigsby Texas
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: My Train Mod

by Nathan.S » Sat Jan 17, 2015 15:24

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: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sat Jan 17, 2015 22:39

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
 

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

Re: My Train Mod

by TG-MyinaWD » Sun Jan 18, 2015 02:31

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 » Sun Jan 18, 2015 02:52

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
Location: New Hampshire U.S.A
In-game: ExeterDad
 

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

Re: My Train Mod

by philipbenr » Sun Jan 18, 2015 20:12

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

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sun Jan 18, 2015 20:33

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 » Sun Jan 18, 2015 21:55

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: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sun Jan 18, 2015 22:06

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: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Re: My Train Mod

by jordan4ibanez » Sun Jan 18, 2015 23:20

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
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: My Train Mod

by ExeterDad » Sun Jan 18, 2015 23:38

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
 

Next

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests