squirrel_export.awk producing "empty" files

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
evilstreak
Engineer
Engineer
Posts: 3
Joined: 08 Jul 2009 13:51

squirrel_export.awk producing "empty" files

Post by evilstreak »

I tried to add a new method into the AI API (AITown.IsCity, which returns the value of town.larger_town), ran ./squirrel_export.sh (whilst in the src/ai/api/ directory) and it produced almost empty files in all cases (except for ai_controller.hpp.sq which the script skips).

The actual contents look like this:

Code: Select all

$ cat ai_town.hpp.sq 
/* $Id$ */
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */

#include "*/"
When I manually run the awk script against a single file I get the same output as above (i.e. the problem is in the awk script, not in the shell script, though I think there is an unrelated error in the shell script that I'll try to provide a patch for).

This is on Mac OS X 10.5.7 and awk is version 20040207
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: squirrel_export.awk producing "empty" files

Post by Rubidium »

There are many flavours of 'awk'. Probably you don't have a flavour that supports everything we use.

Not much I can do about because I don't have Mac OS X (nor a Mac) or your version, don't even have a clue what flavour of 'awk' it is.
evilstreak
Engineer
Engineer
Posts: 3
Joined: 08 Jul 2009 13:51

Re: squirrel_export.awk producing "empty" files

Post by evilstreak »

Using gawk (easily installed via MacPorts) did the trick.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: squirrel_export.awk producing "empty" files

Post by Rubidium »

I've made it more clear that squirrel_export needs gawk; it seems to be the only flavour of awk that actually supports everything we want to do.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 15 guests