News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Vehicle constraints

Started by Aquel, February 18, 2010, 06:18:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aquel

Quote from: martin on November 23, 2009, 08:49:59 PM
The latest addition: a 40ft container trailer. Double the size; double the goods....

Martin

Hello

I just finished a truck for simutrans I just would like to know how I can attach this trailer to my truck?
Thansk for the feedback.
Attached are the .png and .dat of the truck.

Cheers
Créateur de véhicule routier français: http://simutrans-france.fr.nf/doku.php?id=fr:vehicules_routiers_byaquel
Making French road vehicule a reality: http://simutrans-france.fr.nf/doku.php?id=en:vehicules_routiers_byaquel

Impossible n'est pas français!
Napoléon Bonaparte a écrit"Ce n'est pas possible, m'écrivez-vous : cela n'est pas français", en répondant à Jean Léonard, Comte Le Marois, qui lui faisait part de l'impossibilité de réaliser un projet.  Napoléon Bonaparte wrote: "It's not possible, you're telling me: it's not french", responding to Jean Léonard, Count Le Marois regarding the impossbility of making a project   [img]http://graphics.simutrans.com/albums/userpics/1000

martin

Hello Aquel,

First you need to download the trailer .pak file. It is inside the 40ft_container.zip file a few post before this one. Also png and dat file are included in the zip file. But you probably have downloaded it and found that out yourself.

Second, you need to edit your own Renault_Magnum_Sable.dat file to allow your truck to hook up with the trailer. Add the following line to the dat file:

Constraint[Next][n]=40ft_Container_Trailer


I took a look at the dat file in your post and add the line as shown:

Constraint[Next][0]=Renault_Magnum_Sable_Piece_Goods_Trailer_finished
Constraint[Next][1]=40ft_Container_Trailer
------------------------------------

Save the changes, recompile (using makeobj or pakbuilder, which you seem to be using to make pak files - from french board :-) ) the trucks .pak file using the edited .dat file.  Then copy the new truck .pak file and the trailer .pak file to your simutrans/pak128 folder and enjoy.

Aquel

#2
Quote from: martin on February 20, 2010, 02:46:41 PM
Hello Aquel,

First you need to download the trailer .pak file. It is inside the 40ft_container.zip file a few post before this one. Also png and dat file are included in the zip file. But you probably have downloaded it and found that out yourself.

Second, you need to edit your own Renault_Magnum_Sable.dat file to allow your truck to hook up with the trailer. Add the following line to the dat file:

Constraint[Next][n]=40ft_Container_Trailer


I took a look at the dat file in your post and add the line as shown:

Constraint[Next][0]=Renault_Magnum_Sable_Piece_Goods_Trailer_finished
Constraint[Next][1]=40ft_Container_Trailer
------------------------------------

Save the changes, recompile (using makeobj or pakbuilder, which you seem to be using to make pak files - from french board :-) ) the trucks .pak file using the edited .dat file.  Then copy the new truck .pak file and the trailer .pak file to your simutrans/pak128 folder and enjoy.

I will try and answer you as soon as possible but I don't think there should be any problems.
By the way another question... ;D
How do you make the light appear on the truck or buses during night time?
Coz I've tried all the color possible and it's not working.
When the night is falling I got nothing. :-[
Any help? ???


Edit 1:
Listen I just tried your trailer it's attaching no prblems but then graphically the result is quite strange.
One more things I cannot attach any more my trailer...
Any idea? ;D

Please find attach the *.png and *.dat of the vehicule and its trailer.
Créateur de véhicule routier français: http://simutrans-france.fr.nf/doku.php?id=fr:vehicules_routiers_byaquel
Making French road vehicule a reality: http://simutrans-france.fr.nf/doku.php?id=en:vehicules_routiers_byaquel

Impossible n'est pas français!
Napoléon Bonaparte a écrit"Ce n'est pas possible, m'écrivez-vous : cela n'est pas français", en répondant à Jean Léonard, Comte Le Marois, qui lui faisait part de l'impossibilité de réaliser un projet.  Napoléon Bonaparte wrote: "It's not possible, you're telling me: it's not french", responding to Jean Léonard, Count Le Marois regarding the impossbility of making a project   [img]http://graphics.simutrans.com/albums/userpics/1000

martin

First lights during nighttime. You have to use one of the special colors to make this work. Look here for all special colors:  http://graphics.simutrans.com/albums/userpics/10003/simucolors.png. Use "yellow light" R255,G255,B83 (hex: FFFF53) for headlights and "red light" R255,G33,B29 (hex: FF211D) for taillights.

Now let me try to explain how constraints work. Constraints in simutrans can be used in a few ways:

1. To keep a specific setup of vehicles. This is mostly used for multiple unit passengertrains (EMU's or DMU's).
Part A of the train is always followed by part B and then C     [__A__]-[__B__]-[__C__]     
Constraints in .dat file for A:
Constraint[prev][0]=none
Constraint[next][0]=B

Constraints in .dat file for B:
Constraint[prev][0]=A
Constraint[next][0]=C

Constraints in .dat file for C:
Constraint[prev][0]=B
Constraint[next][0]=none

2. To limit the number of trailers that may be put behind to a truck (also works for waggons/engines)
eq: [Truck]-[TrailerA]  or  [Truck]-[TrailerB]  or  [Truck]-[TrailerC]
Constraints go into .dat file for the truck:
Constraint[prev][0]=none
Constraint[next][0]=TrailerA
Constraint[next][1]=TrailerB
Constraint[next][2]=TrailerC

3. To limit the number of trucks that may be put in front of a trailer (also works for engines/waggons)
eq: [TruckA]-[Trailer]  or  [TruckB]-[Trailer]  or  [TruckC]-[Trailer]
Constraints go into .dat file for the trailer:
Constraint[prev][0]=TruckA
Constraint[prev][1]=TruckB
Constraint[prev][2]=TruckC
Constraint[next][0]=none

In your .dat form  you make use of the second type. In official pak128 the third type is used for trucks-trailers.

Another thing that is critical in constraints is the name you specify after Constraint[xxxx][y]=  It has to be exactly the same as the Name= statement in the dat file for the referenced vehicle. This the problem in your dat file why you can't attach your trailer anymore.

The following example is for type 2:
.dat file for Truck_A:
Name=Truck_A
Constraint[next][0]=Trailer_B
Constraint[next][1]=Trailer_C

.dat file for Trailer_B:
Name=Trailer_B

.dat file for Trailer_C:
Name=Trailer_C

Please try not to use spaces in vehicle names. Use underscores _ instead.

@ADMINS/MODS: Can one of you guys split this topic and move this to Help Requests... Thnx Martin

Aquel

#4
@Martin:

Thanks for the explaination.
I have been starting to implement it, but it is almost 1H30 in the morning and tom work start at 6am...
So better go to bed! ;D
I'll tell you tom how it ended.

Thanks again for the feedback!
Have a good night! ;)


Hello

The problem is not there!
Seems I can't create my tractor vehicle since I took of the trailer from the *.dat... ;D
Any help? ;D
It's getting off topic please go to this one if you have an answer: http://forum.simutrans.com/index.php?topic=4382.msg46059#msg46059
Please find the *.dat attached.
Many thanks in advance.

Créateur de véhicule routier français: http://simutrans-france.fr.nf/doku.php?id=fr:vehicules_routiers_byaquel
Making French road vehicule a reality: http://simutrans-france.fr.nf/doku.php?id=en:vehicules_routiers_byaquel

Impossible n'est pas français!
Napoléon Bonaparte a écrit"Ce n'est pas possible, m'écrivez-vous : cela n'est pas français", en répondant à Jean Léonard, Comte Le Marois, qui lui faisait part de l'impossibilité de réaliser un projet.  Napoléon Bonaparte wrote: "It's not possible, you're telling me: it's not french", responding to Jean Léonard, Count Le Marois regarding the impossbility of making a project   [img]http://graphics.simutrans.com/albums/userpics/1000