The International Simutrans Forum

 

Author Topic: How to attach Scania R620 trailers to another truck in .dat file?  (Read 9811 times)

0 Members and 1 Guest are viewing this topic.

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
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! :)

Offline The Hood

  • Devotees (Inactive)
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #1 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)

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #2 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...

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #3 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...

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #4 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

Offline The Hood

  • Devotees (Inactive)
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #5 on: February 05, 2010, 07:02:33 PM »
Or you could just ask for the sources from the person who made the trailers...

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #6 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

Offline martin

  • Web Team
  • Devotees (Inactive)
  • *
  • Posts: 66
  • Languages: EN, NL, DE
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #7 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

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #8 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.

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #9 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!

« Last Edit: February 11, 2010, 06:35:48 PM by Aquel »

Offline The Hood

  • Devotees (Inactive)
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #10 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... :(

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #11 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 ;)

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #12 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

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #13 on: March 09, 2010, 01:19:12 PM »
Just don't put any Constraint[Next] line in there.

Offline Zeno

  • ENASSA Designer
  • Devotees (Inactive)
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #14 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.

Offline Aquel

  • *
  • Posts: 314
  • Jai Ho!
Re: How to attach Scania R620 trailers to another truck in .dat file?
« Reply #15 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