Vehicle constraints February 18, 2010, 06:18:07 am Quote from: martin – on November 23, 2009, 08:49:59 pmThe latest addition: a 40ft container trailer. Double the size; double the goods....MartinHelloI 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 Quote Selected
Vehicle constraints Reply #1 – 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_TrailerI 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_finishedConstraint[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. Quote Selected
Vehicle constraints Reply #2 – March 07, 2010, 01:26:34 pm Quote from: martin – on February 20, 2010, 02:46:41 pmHello 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_TrailerI 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_finishedConstraint[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... 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? Please find attach the *.png and *.dat of the vehicule and its trailer. Quote Selected Last Edit: March 07, 2010, 01:37:36 pm by Aquel
Vehicle constraints Reply #3 – March 09, 2010, 08:25:52 pm 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 p****engertrains (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]=noneConstraint[next][0]=BConstraints in .dat file for B:Constraint[prev][0]=AConstraint[next][0]=CConstraints in .dat file for C:Constraint[prev][0]=BConstraint[next][0]=none2. 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]=noneConstraint[next][0]=TrailerAConstraint[next][1]=TrailerBConstraint[next][2]=TrailerC3. 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]=TruckAConstraint[prev][1]=TruckBConstraint[prev][2]=TruckCConstraint[next][0]=noneIn 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_AConstraint[next][0]=Trailer_BConstraint[next][1]=Trailer_C.dat file for Trailer_B:Name=Trailer_B.dat file for Trailer_C:Name=Trailer_CPlease 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 Quote Selected
Re: Vehicle constraints Reply #4 – March 11, 2010, 07:54:26 pm @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! I'll tell you tom how it ended.Thanks again for the feedback!Have a good night! HelloThe problem is not there!Seems I can't create my tractor vehicle since I took of the trailer from the *.dat... Any help? It's getting off topic please go to this one if you have an answer: http://forum.simutrans.com/index.php?topic=4382.msg46059#msg46059Please find the *.dat attached.Many thanks in advance. Quote Selected Last Edit: March 13, 2010, 07:08:12 pm by Aquel