Page 3 of 15
Posted: 04 Sep 2006 15:18
by Brianetta
Unlikely. If autopilot recognises nothing at all, then it does nothing, but the game should cotinue to run. The game is quitting, without autopilot telling it to. I won't know why until tonight, when I get in.
Of course, if it really is broken, then I might have to expedite the release of autopilot 2...
Posted: 04 Sep 2006 16:33
by Picknicker
Brianetta wrote:Unlikely. If autopilot recognises nothing at all, then it does nothing, but the game should cotinue to run.
Yes, but autopilot (Expect) starts openttd and sice MiniIN -r6027 crash openttd probably after start over autopilot. Without autopilot works this version of openttd perfectly
I think, autopilot or Exept is not the problem. Why crasht openttd suddenly after start over autopilot......
cu
Picknicker
Posted: 04 Sep 2006 16:41
by richk67
OK - just to be absolutely clear:
DO NOT USE r6027. Any games saved with r6027 WILL NOT WORK.
Please download the latest SVN and compile it. It has the most sync with trunk, and bug fixes.
Are you trying to start your server with a particular game? Have you tried creating a new .cfg file? (since at r6027 old TGP was removed and at r6028 new TGP was synced from trunk - both of these changed the settings saved in the .cfg file)
My bet is you have an old .cfg that is no longer compatible, and that MiniIN is dying in dedicated mode because it is trying to access info that is not in the .cfg.
Posted: 04 Sep 2006 17:48
by Picknicker
richk67 wrote:OK - just to be absolutely clear:
DO NOT USE r6027. Any games saved with r6027 WILL NOT WORK.
Please download the latest SVN and compile it. It has the most sync with trunk, and bug fixes.
Yes i know, current i use MiniIN-r6362.
without autopilot MiniIN-r6362 works great.
Only a start with autopilot work not.
version
<= r5838 works with autopilot,
version
>= r6027 works not with autopilot.
richk67 wrote:
Are you trying to start your server with a particular game? Have you tried creating a new .cfg file? (since at r6027 old TGP was removed and at r6028 new TGP was synced from trunk - both of these changed the settings saved in the .cfg file)
My bet is you have an old .cfg that is no longer compatible, and that MiniIN is dying in dedicated mode because it is trying to access info that is not in the .cfg.
I start server with a new game - no savegame. The cfg was firstly from old version, now i have deleted old cfg file. But it does not work yet with autopilott & new cfg file.
Posted: 05 Sep 2006 13:05
by Carnalito
Greetings. Im new om theese forums, and i saw this little script of yours, COOL!
I've tried to get it running without luck so far. Im using Expect 5.21 for Windows and this is what happens;
E:\TTD>expect autopilot.txt
bad option "equal": must be compare, first, index, last, length, match, range, t
olower, toupper, trim, trimleft, trimright, wordend, or wordstart
while executing
"string equal "$arg1" "load" "
(file "autopilot.txt" line 52)
What does this mean?
Any help would be appriciated!
Posted: 05 Sep 2006 13:16
by Carnalito
Ok those lines were obviously for the loadgame option, removed them and this comes up;
E:\TTD>expect autopilot2.txt
Starting new game
exp_spawn ./openttd -c openttd.cfg -D
*** AUTOPILOT ENGAGED ***
syntax error in expression "true"
while executing
"while true {
if $recount_trigger {
set auto_flag 1
exp_send "echo recount clients\n"
set recount_trigger false
}
expect {
..."
(file "autopilot2.txt" line 74)
Posted: 05 Sep 2006 13:32
by glx
autopilot doesn't work with windows version of OpenTTD, because there's no real console.
Posted: 05 Sep 2006 13:40
by Brianetta
As glx says. You can try rewriting or rebuilding openttd such that it's a console application (which it is on every other supported platform) or running it on any other platform.
The next version will actually give a proper error message about this if run in Windows.
Posted: 05 Sep 2006 13:41
by Carnalito
Ummm so an autopilot when running Windows is just out of the question ?
Posted: 05 Sep 2006 16:10
by DaleStan
With the prebuilt binaries, yes.
With a VC debug binary, or a release binary built from properly modified source, it shouldn't be a problem.
Posted: 05 Sep 2006 16:48
by Carnalito
So is there a remote chance for a mortal like me to sort this out ?
This function is just too uber to miss out

Posted: 05 Sep 2006 21:49
by Brianetta
Probably not, unless you're competent in C. The trouble stems from the console code. There's some precompiler code that checks to see whether the target platform is win32, and if it is, it compiles in some code that creates a new window for the dedicated console. This window cannot be read by Expect, and this is the root of the problem.
I've talked to a couple of the devs about this, and they say it's something to do with the way the Visual C makes a project - overarching and wide definitions of a project, such as "console application" and "GUI application." It seems that a program which is both is not made easy. GUI applications aren't given standard input and output, which is why this extra window is opened up.
Whether removing this precompiler code and compiling it under some different environment (perhaps gcc under Cygwin?) will get rid of the problem, I have no idea. I'm not a C programmer (well, not since about 1995) and I have never used a Windows based C environment. Perhaps if somebody here with the relevant experience wants to look at it, there could be an autopilot for Windows servers. Until then, I'm afraid there's very little chance of being able to put something together.
Posted: 05 Sep 2006 22:17
by Carnalito
That makes me a saaaaad panda

Posted: 06 Sep 2006 17:02
by MiG
Me too. Like most of us I've been playing this game for aeons, and only recently I was introduced to OpenTTD and internet multiplay.
Would love to have the autopause function on Win32 because occasionally the last player forgets (and next thing we know we're twenty years further)...
Posted: 06 Sep 2006 18:47
by Brianetta
Another approach, of course, is to patch the game so that it has its own autopause.
Posted: 07 Sep 2006 18:57
by glx
I made a patch to convert windows version of OpenTTD into a console app and I think it should work with autopilot.
There is one UNSOLVABLE problem with it: a console popup and close before the game window if run from explorer (with double-click).
It's a bit annoying, but there's no other way if you want a "real" console.
EDIT: I tried with autopilot and it works (needed to do small changes

)
To run it, install ActiveTcl and run "tclsh autopilot.txt" from a command shell (in openttd dir of course

)
Posted: 07 Sep 2006 22:17
by Brianetta
Interesting. I don't have a Windows dev environment, so if you'd test it with Expect I'd be grateful.
Posted: 08 Sep 2006 00:59
by glx
I've added a modified autopilot.txt in my previous post.
Posted: 08 Sep 2006 07:56
by Carnalito
So how do i use this .diff thing ?
Do i need to compile it or something?
Posted: 08 Sep 2006 07:59
by Brianetta
glx wrote:I've added a modified autopilot.txt in my previous post.
I see you changed the \n to \r after each command that the autopilot sends. Was that necessary? If so, I shall modify the new version appropriately. I'd have thought that the actual correct behaviour in Windows would be to send both.
Any reason why you changed the expect_out array index from 0 to 1 and added parentheses?
That's handled rather differently in 2.0 in any case.