The International Simutrans Forum

PakSets and Customization => Pak128 => Pak128 Add-ons and Graphics => Topic started by: Aquel on February 04, 2010, 05:59:25 pm

Title: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on February 04, 2010, 05:59:25 pm
Hello

I'm Aquel, I'm currently trying to make some french trucks for Simutrans.
Currently I've done 2: the Renault Magnum and the Renault Premium. both with .dat and .png file they're still on beta test.

My question is, can I attach trailers from the Scania R620 Topline on my truck?
If yes what should I modify in the .dat file?

Some people I've been trying to do but couldn't manage to make it work.
Link: http://forum.simutrans.com/index.php?topic=4005.240

Any help is welcomed! ;D

Attached file is .PNG and .DAT of the truck I'm talking about.

Cheers! :)
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: The Hood on February 04, 2010, 06:23:34 pm
You need to use something like the example from pak128.Britain I've attached below.

The thing doing the business is the line

Constraint[Next][0]=xxx

in the tractor unit, and the line

Constraint[Prev][0]=yyy

in the trailer.

If no Constraint lines are supplied, then it will link with any other vehicle.  I suspect therefore that the problem is in the dat file for the Scania trailers: if they have a Constraint[Prev], then your truck will not couple with it.  The only solution is to add

Constraint[Prev][N]=Renault_Magnum_Truck

to the dat file of the trailer, where N is a number 0,1,2,3, etc (starting with 0, but if 0 is taken, then use 1, etc)
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: DirrrtyDirk on February 04, 2010, 07:51:33 pm
Some trailers have constraints, some don't. I don't know how VS wants to handle this...
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: VS on February 04, 2010, 08:09:42 pm
Martin said he will work on truck replacements (which he did!), and I gave him carte blanche regarding constraints. I think he didn't finish that, though...
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on February 05, 2010, 05:27:54 pm
Hello People! :)

Thanks for your feedback.
Unfortunalty that means I'll have to make my own trailer which I really didn't wanted to, too lazy and short on time for this ;D ...
Well at least I'll have an excuse for making crazy art on the trailers!!! ???

Anyway thanks again for your "enlightning" answers. ;D

Cheers
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: The Hood on February 05, 2010, 07:02:33 pm
Or you could just ask for the sources from the person who made the trailers...
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on February 10, 2010, 06:01:37 pm
Or you could just ask for the sources from the person who made the trailers...

That's a good answer
but then the next question is who is it??
Anyone knows?

I have some work to do so cannot make it for now.
Thanks again for your feedback.

Cheers
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: martin on February 10, 2010, 08:43:50 pm
The Scania trucks don't have constraints in their .dat files. The restrictions are set in the .dat files for the trailers. There's not much I can do about that right now. I'm planning on reorganizing the constraints, but need to look further into that. Besides that the constraints can only be set to trucks in the official pak128 set.
I had an idea a long time ago to implement categories to be used in relation to constraints, but that never got implemented. That would have made it easier to hook up new trucks to existing trailers...

I've put some (new) trailers in this thread: http://forum.simutrans.com/index.php?topic=3241.0  which you could use for testing with your trucks...

Martin
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: VS on February 10, 2010, 09:35:37 pm
Since we're talking about truck/trailer constraints... there was an interesting idea in Czech forum about these. Essentially you would have a "joiner" (?), to which you would restrict trucks and trailers from each side. These objects would represent the different mechanisms used to connect trucks and trailer. The upside is that you get more freedom with constraints - you apply them to trailers and trucks, but there is the "translation layer" so you never lock particular trucks to particular trailers.
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on February 11, 2010, 06:28:53 pm
Namastéji!

@Martin: Thank you so much for the trailers!
I will test the truck as soon as I can.
By the way here are the .PNG file of the truck (Bonus pink Magnum I just have to find a use for it...) I made also a black one but it seems it was too darker... just have a look at it and tell me.
I have to make the dat file for it.

@VS: I don't get it? Does it means you will be able to attach any trailers?

Thanks again for help!

Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: The Hood on February 11, 2010, 07:07:25 pm
@VS

That is a very cunning idea - would implement straight away for freight trains in pak128.Britain if we weren't already limited to 24 vehicles per convoy in standard... :(
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: VS on February 11, 2010, 07:19:15 pm
Aquel: it was only an idea.

The Hood: it remains yet to be seen if it's as good as suggested ;)
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on March 07, 2010, 01:20:33 pm
The Scania trucks don't have constraints in their .dat files. The restrictions are set in the .dat files for the trailers. There's not much I can do about that right now. I'm planning on reorganizing the constraints, but need to look further into that. Besides that the constraints can only be set to trucks in the official pak128 set.
I had an idea a long time ago to implement categories to be used in relation to constraints, but that never got implemented. That would have made it easier to hook up new trucks to existing trailers...

I've put some (new) trailers in this thread: http://forum.simutrans.com/index.php?topic=3241.0  which you could use for testing with your trucks...

Martin

Sorry for late question.
hope you did not diseapear too soon.
Can you tell me in the *.dat what do I have to change to make my truck accept any kind of trailer?
I tried to put nothing:
Constraint[Prev][0]=none

Constraint[Next][0]=

But then I cannot attach anything...
You know the way to make it?

Thanks
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: DirrrtyDirk on March 09, 2010, 01:19:12 pm
Just don't put any Constraint[Next] line in there.
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Zeno on March 09, 2010, 02:12:16 pm
Yep, don't put that line and it will accept any trailer. But trailers will need your truck as [prev] constraints (or no prev constraints at all) to allow the truck to pull them. That is, both trailer and truck must be coded accordingly.
Title: Re: How to attach Scania R620 trailers to another truck in .dat file?
Post by: Aquel on March 11, 2010, 07:55:54 pm
@DirrrtyDirk
@zeno:

Thanks for the feedbazck guys.
Actually in another topic Martin answered almost my question: http://forum.simutrans.com/index.php?topic=4659.new#new
It's too late to see it but I'll try to make it tom and post you the result.
Cheers ;D