News:

SimuTranslator
Make Simutrans speak your language.

Wrong constraints

Started by Václav, May 25, 2013, 08:39:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Václav

May it be that it is not game bug, but only my mistake in dat files. But really I don't see difference (in comparison with older trains - that can be downloaded from the same topic, in messages above) that would cause such problems.

I have developed some trains for pak96.comic and in case of Arctica and Polarica game shows wrong constraints and recently also does not allow building train unit of Arctica with greater length than 6 cars - because after SecondaryMiddle car can be added only SecondaryBack car - but in dat file is written that there should be option between MainMiddle car and SecondaryBack car. And this bug appeared after version 6523.

Before 6523 game only shows wrong constraints (like many versions before, that was corrected).



Due to set constraints game should show only MainFront car - and other cars should be showed after buying of MainFront car. But game shows also MainMiddle car of Arctica and Middle car of Polarica together to MainFront cars of both trains.

And in case of Arctica ... the first four cars are bought, and then MainMiddle (together with SecondaryMiddle) car should be available ... but only SecondaryBack car is available to buy.

Ohh, my post number 2800

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Dwachs

You have a lot of spaces (' ') after some of the constraints. Remove them and everything works.
Parsley, sage, rosemary, and maggikraut.

Václav

Thanks.

I think this may be good extension request for makeobj - to use something like PHP's trim before own compiling.

PHP's function trim eliminates chosen signs from the beginning or from end of chosen string. It means those spaces may be deleted ... and all would be fine.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

Ters

It is part of a proposed patch for makeobj that adds support for inline comments. The trouble is that not only makeobj reads these files, so any change to the file format requires coordination with these other tools.

(It could be an idea to formally define the format, as some aspects depend on implementation details, but that would require support for both strict and lenient parsing for a long time to come.)

DirrrtyDirk

Quote from: Václav on May 25, 2013, 05:32:16 PM
to use something like PHP's trim before own compiling.

Some text editors also have options doing that for you when saving the file.
  
***** PAK128 Dev Team - semi-retired*****

Václav

I know ... even PSPad. I did it then.


But nobody can watch all.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní