[0.11.19] RoadTrain MOD (aka Trailers)

Topics and discussion about specific mods
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

[0.11.19] RoadTrain MOD (aka Trailers)

Post by Cheata »

RoadTrain

A mod for adding Trailers to factorio
roadtrain.png
roadtrain.png (200.12 KiB) Viewed 20358 times
The main focus of this mod was to add a way to manage and control trailers for vehicles to factorio, although there is a stock trailer provided it should be a simple matter for other modders to create trailers and simply link in this interface to control them

latest version roadtrain1.0.1
Old Versions
Changelog
Current features
- allows vehicles to tow trailers

To use:
-Hop into a vehicle designated as a towing vehicle and a 3 button interface will appear in the top left:
-- click attach to connect a trailer within range of the rear of the vehicle or vehicle train
-- click detach to disconnect the last trailer from the vehicle or vehicle train
-- click detach all to disconnect all trailers in the train from each other and the lead vehicle
-By default this mod is set to allow the car to tow and adds a "stock" trailer
-Trying to enter a non-drivable vehicle will cause to to leave the vehicle
- Trying to enter a vehicle that is not the lead vehicle in the train will force the player into the lead vehicle
-If you install the bulldozer mod then the car is disabled as a towing vehicle and the bulldozer is added as one.
-you can Specify which vehicles are allowed to tow by adding the vehicle name to the whitelist "towbar" located in the config.lua (dont forget the commas)
example

Code: Select all

change the line 
towbar={["car"]=true,["trailer"] = true}
to 
towbar={["car"]=true,["trailer"] = true,["tank"]=true}
will allow the tank to tow trailers
- You can Specify which vehicles can be towed by adding the vehicle name to the whitelist "towable" located in the config.lua (dont forget the commas)

Code: Select all

change the line 
towable={["trailer"] = true}
to 
towable{["trailer"] = true,["tank"]=true}
will allow the other vehicles (on the towbar list) to tow the tank
- You can designate a vehicle as trailer only (non drivable) by adding the vehicle name to the whitelist "trailer" located in the config.lua (dont forget the commas)

Code: Select all

change the line 
trailer={["trailer"] = true}
to 
trailer{["trailer"] = true,["tank"]=true}
tanks will no longer be drive-able and act as trailers only (thats just silly)
-if you wish to disable the stock trailer provided with the mod change the line

Code: Select all

usestock=true
to

Code: Select all

usestock=false
Should work with most mods
Multi-player untested

TO DO
- better texture pack for the trailer
- collision detection for towed vehicles
- proper articulation (or better follow script) for trailers

At the moment this is a working release, it can however use a lot of work. In particular I could use some help with the following things
- texture pack for stock trailer (cause I clearly suck at drawing), not terribly urgent as other modder's can create their own trailers while the main focus of this mod is a way to control those trailers.
- collision detection for towed vehicles. Currently the only way i could find for "towing" a vehicle was to use the .teleport(pos) method to move the towed objects with the driven object this of course bypasses all the games built in collision detection and the math involved in detecting and reacting to those collision is a little beyond me and probably not so useful until the trailer follow scripts can be updated to be more realistic
-proper articulation for trailers or at the very least a better algorithm to calculate how they should behave when following the towing vehicle. once again the math involved in this is a little beyond me at the moment so any help would be appreciated

Please post any bug reports, feature requests, balance suggestions, updates etc to my GitHub https://github.com/Cheata/roadtrain

Modders who want to add this mod to their packs or create there own trailers using this control interface heres what you need to know
- There is a remote interface for this mod it can be checked for using

Code: Select all

remote.interfaces["roadtrain"]
- The methods that can be called from this interface are as follows

Code: Select all

settowbar(vehicle.name,true/false) -- method settowbar takes 2 varibles the name of the vehicle(Lua/entity) and true to indicate it can tow or false to indicate it can't. no return variable 

Code: Select all

settowable(vehicle.name,true/false) -- method settowable takes 2 varibles the name of the vehicle(Lua/entity) and true to indicate it can be towed or false to indicate it can't. no return variable 

Code: Select all

settrailer(vehicle.name,true/false) -- method setrailer takes 2 varibles the name of the vehicle(Lua/entity) and true to indicate it is a trailer (and cant be driven) or false to indicate it isn't (can be driven). no return variable 

Code: Select all

addtocargo(vehicle,item,count) -- method addtocargo takes 3 varibles, the vehicle(Lua/entity) , the item being added to the inventory, and the number of that item. true is returned if the addition was successful, false if not
If you are going to use the settowbar, settowable, or settrailer methods then it is recommend that you do so onLoad and onInit at the earliest, otherwise you may run into problems where the control file for the trailer has not been loaded and the interface cant be found.

I would also recommend adding

Code: Select all

? "roadtrain" > 1.0.0
or 
"roadtrain" > 1.0.0
to the dependences in your .json file (i think im beginning to state the obvious here)

When creating your own trailers please keep in mind the following
- At the moment all trailers must be of type="car"
- The distance the trailer sits from the vehicle is hard coded for the time being so making your trailer collision area too large will cause the towing vehicle to "get stuck"
- The above point also means that different sized textures will not necessarily look as intended (i.e. may have large gaps between vehicle and trailer or overlap) it is recommended that you build your trailer as it should look not to match how it will look in this mod, eventually the towing distance will hopefully be determined by the texture size and render correctly. So if you build your texture packs to look correct under the current version they may not look right under later versions


phew thats a lot of info
enjoy :D
Last edited by Cheata on Mon Apr 13, 2015 12:49 pm, edited 1 time in total.
Degraine
Filter Inserter
Filter Inserter
Posts: 282
Joined: Wed Aug 13, 2014 10:49 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Degraine »

Interesting! Although the lack of a proper graphic for the trailers really kind of kills its appeal, unfortunately.
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by MasterBuilder »

Degraine wrote:Interesting! Although the lack of a proper graphic for the trailers really kind of kills its appeal, unfortunately.
I concur. This sounds amazing but the green blob kills the immersion for me.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Cheata »

MasterBuilder wrote:
Degraine wrote:Interesting! Although the lack of a proper graphic for the trailers really kind of kills its appeal, unfortunately.
I concur. This sounds amazing but the green blob kills the immersion for me.
yes it dose. and as i have stated i suck at graphics, as such i'm looking for someone to create some graphics for this mod ( and the bulldozer mod), but then the main focus of this mod is not to add good looking trailers to the game but to create an interface to allow other modders to create working trailers.

if you really want to use the mod but don't like the trailer you can always turn it off and set the cars to be towable (instructions for this are included in the first post). this allows you to create a chain of cars ;)
katyal
Fast Inserter
Fast Inserter
Posts: 208
Joined: Wed Nov 12, 2014 8:42 pm
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by katyal »

You should get in touch with Yuoki, he's made some excellent graphics for his own mods as well as a few for other mods, he even created some graphics for flyers and left it up to others to implement them as a mod.
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Cheata »

katyal wrote:You should get in touch with Yuoki, he's made some excellent graphics for his own mods as well as a few for other mods, he even created some graphics for flyers and left it up to others to implement them as a mod.
thanks

i might look into that
iame6162013
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 09, 2014 7:44 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by iame6162013 »

Ohhhh I need this... I need this a lot...
Stryder88
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Apr 07, 2015 10:11 pm
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Stryder88 »

i would love this mod but when installed it gave error of trailer.png not found any ideas ad to what its talking about
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Cheata »

Stryder88 wrote:i would love this mod but when installed it gave error of trailer.png not found any ideas ad to what its talking about
yep the trailer.png in the graphics/icons folder has a capital T on it.. this has been fixed on my github but it hasent been pushed through in a release yet.

ill just update the existing version with that fix now hang on a sec.................


Ok, either go into your copy of the mod and change the Trailer.png to trailer.png or

re download the current version which should now be fixed (remember to remove you existing copy first so it doesn't get mixed up)

at the moment i'm looking at getting some better graphics for the trailer so ill release a new version once thats sorted
User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Cheata »

New Version roadtrain1.0.1

Graphical Update

That is all
DaxtaBold
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Apr 14, 2016 12:46 pm
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by DaxtaBold »

The mod is outdated.
First: i cant start the game. I get the message: factorio error in assignid id huge explosion
after i fix it (change huge to medium) i can start the game but if i load my safe, i get this message: __roadtrain__/control.lua6: LuaRemote doesn't contain key addinterface
I cant fix it.
Please update your mod, i need trailers.
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Koub »

DaxtaBold wrote:The mod is outdated.
Do you think so ? :)
2016-04-14 16_08_20-Factorio Forums • Post a reply.jpg
2016-04-14 16_08_20-Factorio Forums • Post a reply.jpg (13.1 KiB) Viewed 10615 times
(You're in the "obsolete mods" part of the forum, and it is stated in the title that the mod was made for 0.11.19))
Koub - Please consider English is not my native language.
DaxtaBold
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Apr 14, 2016 12:46 pm
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by DaxtaBold »

i'm sorry,
maybe you see my english is not the best and i dont know what the latest version Factiorio have. :)
(Yes, i bought the game on steam)

I want create a new base but i need many many items.
I need something like a trailer a truck.
Do someone have any ideas or can someone fix this mod ?
I will be very thankful
Darloth
Fast Inserter
Fast Inserter
Posts: 118
Joined: Sun Jun 08, 2014 3:57 pm
Contact:

Re: [0.11.19] RoadTrain MOD (aka Trailers)

Post by Darloth »

It's possible to update mods, but it is a lot of work.

For what you say you want, there are easier solutions.

Why do you need many many items? Is the trunk of the car not enough item space for you? I've honestly never filled it.

It might be easier to mod yourself a new car, with more storage space. There's a truck graphic somewhere that I believe is free to use, if you wanted to put in effort and make it an actual releasable mod, maybe other people would use it also!

Alternatively, get FARL, and you can have a train which lays tracks as it's going and pulls them up behind itself as it goes, and I guarantee that can carry enough for anything you might want.
Post Reply

Return to “Mods”