OpenTTD 1.0.5 does not supports Autopilot 3.0+

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
OpenM
Engineer
Engineer
Posts: 14
Joined: 03 Apr 2010 23:37

OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by OpenM »

After I actualize version of my OpenTTD servers i've got a problem with autopilot script. In console I see a additional character (red marker):
console wrote:Autopilot engaged
Starting new game: 'testing'
(...)
â*** testuser has joined the game (Client #3)
â[All] testuser: chat test
â[All] testuser: chat test2
â[All] testuser: IRC doesn't work :(
Propably these changes is the reason for problem with additional character:
changelog from 1.0.5 wrote:- Fix: Chat/console messages got sometimes messed up due to LTR names in RTL translations and vice-versa [FS#3746] (r21006, r21004)
Anybody knows how to adapt AP+ to ignore this character? This broke all of AP+ scripts (commands, callback, IRC...) and injures my servers.
The problem occurs only when AP+ getting information from the chat (other informations like companies data are without additional character).
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by Rubidium »

It's Autopilot that doesn't support OpenTTD 1.0.5.

In any case, autopilot should just filter the text direction characters out of the strings. I have no idea how to do this, though I've suggested starting OpenTTD with a script that removes the text direction characters with sed but I've not seen that being implemented.

For the rest I've got no clue how to fix autopilot; "fixing" OpenTTD means re-introducing the bug that is fixed by adding these text direction characters.
Whos
Engineer
Engineer
Posts: 74
Joined: 25 May 2009 10:20

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by Whos »

Maybe first let's see what was changed in new version in the chat.

Probably a some characters was added, and autopilot copy these accidentally. I'm sure that we could convert the script to run under 1.0.5. Undoubtedly it's only one character there, where it should not.
OpenM
Engineer
Engineer
Posts: 14
Joined: 03 Apr 2010 23:37

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by OpenM »

Please, it is important for me. Anyone help?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by Zuu »

Perhaps change autopilot to first trim the lines before processing them?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
OpenM
Engineer
Engineer
Posts: 14
Joined: 03 Apr 2010 23:37

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by OpenM »

Easy to say. I don't know where I must find suitable line. If the authors will show what exactly has been changed ("before" and "after"), it would be easier. Autopilot just taking too more information from game, where was appeared additional character.
Contact autopilot -> game is correctly.
Game -> autopilot is broken.
Propably by one character.

I appeal to authors to show exactly changes to the code in the game.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by Lord Aro »

AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
OpenM
Engineer
Engineer
Posts: 14
Joined: 03 Apr 2010 23:37

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by OpenM »

Yes, thank you very much. I'll try to adapt Autopilot for code changes. :? .
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by Zuu »

I took a quick look at the source code and I can tell you that there is a comment line:

Code: Select all

						# Get this far, and we have exactly one line of output from the server.
Looking at the context, the line is probably stored in $linestr. Here's some more code to provide you also with the context:

Code: Select all

				foreach linestr [split [string map {"\r" {} } $out_buffer] "\n"] {
					# You'll get at least one empty from the split
					if {$linestr != {} } {
						regexp -nocase {^(\[\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\])\s+(.*)} $linestr line timestamp linestr
						set line [split $linestr]
						# Get this far, and we have exactly one line of output from the server.
						# Now we have fun with ifs and cases!
						if {[string first {dbg: } $linestr] == 0} {

As a side note, I don't know TCL at all, so in order to trim $linestr I would need to lookup how to do that in TCL, something I leave for you to do.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by dihedral »

Sorry i was not around to reply at the time you asked for help....

From my perspective, I will refuse to continue fixing and adding support for autopilot, and consider it a dead project merely kept alive as there is no suitable replacement.

I am working on a replacement project, which however will not support the current stable releases of OpenTTD.
I hope to get the project to a usable state before the next stable is release, could possibly take a few weeks longer though :-)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by planetmaker »

There's a fix available within the newest trunk revision of ap+: http://dev.openttdcoop.org/projects/autopilot
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: OpenTTD 1.0.5 does not supports Autopilot 3.0+

Post by dihedral »

the fix renders that version of autopilot incompatible with earlier versions of OpenTTD ;-)
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 28 guests