Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ADRIFT to Inform conversion program

41 views
Skip to first unread message

Mark J. Tilford

unread,
Sep 29, 2005, 4:12:41 PM9/29/05
to
Available now at
ftp://mirror.ifarchive.org/if-archive/programming/adrift/taf2inf.tgz

(Requires perl)

Any comments would be appreciated. (Any help bundling this as a Windows
standalone would be greatly appreciated.)


--
------------------------
Mark Jeffrey Tilford
til...@ugcs.caltech.edu

Peter Mattsson

unread,
Sep 29, 2005, 6:55:16 PM9/29/05
to
Mark J. Tilford wrote:
> Available now at
> ftp://mirror.ifarchive.org/if-archive/programming/adrift/taf2inf.tgz
>
> (Requires perl)
>
> Any comments would be appreciated. (Any help bundling this as a Windows
> standalone would be greatly appreciated.)
>

The archive you've put up includes three symbolic links (English1.h,
English2.h, English3.h) to files on your hard drive (path
/home/tilford/src/inform/headers/englishx.h) but not the files
themselves. As a result, the inf files that are generated start with

!% +language_name=English2

and the compiler complains that it can't find it. I've fudged round the
problem by changing English2 to english (which picks up my own copy of
english.h) but the compiler is still throwing out various errors. Before
I start in on investigating them further, is your English2.h just the
usual english.h? (If so, what are english1.h and english2.h?)

Cheers,

Peter

Mark J. Tilford

unread,
Sep 29, 2005, 7:15:51 PM9/29/05
to

Arg.

English2.h is the normal english.h. English1.h and English3.h and first
and third person versions of it, respectively. (Though I haven't used
English3 that much, so it may have problems.)

Peter Mattsson

unread,
Sep 29, 2005, 8:49:41 PM9/29/05
to
Right. That's one possible error source out of the way. The errors I'm
getting now take one of the following forms:

1. At the end of some routines, the trailing ; gets left out. For
example, the translator generates routines like

[ ALR_YES var;
switch (var) { 0: print "yes indeed";
1: print "no unfortunately";
default: print "yes", var;
}
] <-- should be a ; here.

(At first glance, this seems happen if and only if the routine name
begins with ALR_.)

2. Some action routines seem to be left out (e.g. TalkToSub, UseSub).

3. Some constants are missing, notably "states" and "RandFrom" but
others too sometimes (e.g. "task28" in David Whyld's ASDFA).

3. In one game (ASDFA), an object is created called "nothing", i.e.

Item -> nothing "nothing"
with name 'nothing',
article "the",
itemdesc [ ; "You see nothing*.^^^^^^^^Oh, c'mon, you had to
see, (Style) S_ITAL, "that", (Style) S_UNITAL, " one coming!"; ],
has static scenery;

On compilation, this gives the error "Expected name for new object or
its textual short name but found nothing".

There are also a number of warnings. The translator generally provides a
longist list on unknown props, and there are a number of routines and
attributes defined in taflib.inf that are defined but not used. (I'm
guessing however, that this last is to be expected.)

Having said all the above, I have managed to get David Whyld's "The
Amazing Uncle Griswold" to compile, after fudging past the problems one
way of the other. The end result is fairly playable, but not finishable
(for whatever reason, you can't open the front door).

Hope this helps, and isn't too depressing...

Peter

Mark J. Tilford

unread,
Sep 29, 2005, 10:05:11 PM9/29/05
to
On Fri, 30 Sep 2005 01:49:41 +0100, Peter Mattsson <pe...@XYZZYmattssons.e7even.com> wrote:
>
> Right. That's one possible error source out of the way. The errors I'm
> getting now take one of the following forms:
>
> 1. At the end of some routines, the trailing ; gets left out. For
> example, the translator generates routines like
>
> [ ALR_YES var;
> switch (var) { 0: print "yes indeed";
> 1: print "no unfortunately";
> default: print "yes", var;
> }
> ] <-- should be a ; here.
>
> (At first glance, this seems happen if and only if the routine name
> begins with ALR_.)

That's a bug in my ALR translation routines. Fixed.

> 2. Some action routines seem to be left out (e.g. TalkToSub, UseSub).

You'll need to add those routines manually if you need them.

> 3. Some constants are missing, notably "states" and "RandFrom" but
> others too sometimes (e.g. "task28" in David Whyld's ASDFA).

Fixed.

> 4. In one game (ASDFA), an object is created called "nothing", i.e.


>
> Item -> nothing "nothing"
> with name 'nothing',
> article "the",
> itemdesc [ ; "You see nothing*.^^^^^^^^Oh, c'mon, you had to
> see, (Style) S_ITAL, "that", (Style) S_UNITAL, " one coming!"; ],
> has static scenery;
>
> On compilation, this gives the error "Expected name for new object or
> its textual short name but found nothing".

I put in code to reserve words with special meaning to Inform or taflib to
prevent taf2inf from using them as object names, but 'nothing' wasn't one
of them. If you need to, you can add it to the line
map { get_inform_name ($_, 1, 1); } (qw/Object Item Room Class ...

> There are also a number of warnings. The translator generally provides a
> longist list on unknown props, and there are a number of routines and
> attributes defined in taflib.inf that are defined but not used. (I'm
> guessing however, that this last is to be expected.)

The unknown props are a fixed bug. I actually put in some pointless
references to most functions (see suppressor), but some slipped through.

> Having said all the above, I have managed to get David Whyld's "The
> Amazing Uncle Griswold" to compile, after fudging past the problems one
> way of the other. The end result is fairly playable, but not finishable
> (for whatever reason, you can't open the front door).

taf2inf puts all the tasks it couldn't figure out into (filename).tsk.
You'll have to paste that code into the appropriate parts. The called
by lines will tell you which parts it could figure out (marked in the code
by !! EXEC task28 or the like); the unparsed lines will tell you which
parts it couldn't figure out.

> Hope this helps, and isn't too depressing...
>
> Peter

Actually, this is a far better result than I hoped for. Despite the lack
of documentation, somebody managed to get a runnable program within a few
hours of the announcement. taf2inf was never intended as a complete in
itself converter (ADRIFT is just too different in its design from any
other system); it was meant to do as much of the automatic work as
possible before a hand polishing.

Krister Fundin

unread,
Sep 30, 2005, 8:20:42 AM9/30/05
to

"Mark J. Tilford" <til...@ugcs.caltech.edu> skrev i meddelandet
news:slrndjp7fn....@ralph.earthlink.net...

> On Fri, 30 Sep 2005 01:49:41 +0100, Peter Mattsson
> <pe...@XYZZYmattssons.e7even.com> wrote:
>
>> There are also a number of warnings. The translator generally provides a
>> longist list on unknown props, and there are a number of routines and
>> attributes defined in taflib.inf that are defined but not used. (I'm
>> guessing however, that this last is to be expected.)
>
> The unknown props are a fixed bug. I actually put in some pointless
> references to most functions (see suppressor), but some slipped through.
>

As for the unused functions and attributes, a "System_file" directive in
that
"taflib.inf" file should remove the warning messages (assuming that this is
some kind of library file used in all games).

-- Krister Fundin

Mark J. Tilford

unread,
Sep 30, 2005, 10:12:39 AM9/30/05
to

I considered doing that, but there are a few replacement routines I store
in taflib.

Krister Fundin

unread,
Oct 1, 2005, 6:32:40 AM10/1/05
to

"Mark J. Tilford" <til...@ugcs.caltech.edu> skrev i meddelandet
news:slrndjqeql....@ralph.earthlink.net...

> On Fri, 30 Sep 2005 12:20:42 GMT, Krister Fundin <fun...@yahoo.com> wrote:
>>
>> As for the unused functions and attributes, a "System_file" directive in
>> that
>> "taflib.inf" file should remove the warning messages (assuming that this
>> is
>> some kind of library file used in all games).
>
> I considered doing that, but there are a few replacement routines I store
> in taflib.
>

Ok. I suppose you could put those in a separate file, but you know better
than me what works best in your program.

-- Krister Fundin

JL

unread,
Oct 8, 2005, 6:37:41 PM10/8/05
to
On september I coded in Python a script called amf2inf. Since the AMF files
do not contain all the information, and since my program was just a fast
experiment, the result was far from complete (only the rooms, the objects
and the intro ; everything not translated was left commented in the INF
code), but it was funny nevertheless.

-- JL


"Krister Fundin" <fun...@yahoo.com> a écrit dans le message de news:
cBt%e.35021$d5.1...@newsb.telia.net...

Mark J. Tilford

unread,
Oct 8, 2005, 11:12:51 PM10/8/05
to
On Sun, 9 Oct 2005 00:37:41 +0200, JL <j...@nospam.fr> wrote:
>
>
> On september I coded in Python a script called amf2inf. Since the AMF files
> do not contain all the information, and since my program was just a fast
> experiment, the result was far from complete (only the rooms, the objects
> and the intro ; everything not translated was left commented in the INF
> code), but it was funny nevertheless.
>
> -- JL
>

I also did a module parser (parse-amf.pl); I think I handled the full
module format.

Mark J. Tilford

unread,
Oct 15, 2005, 10:12:52 AM10/15/05
to
On Thu, 29 Sep 2005 20:12:41 GMT, Mark J. Tilford <til...@ugcs.caltech.edu> wrote:
> Available now at
> ftp://mirror.ifarchive.org/if-archive/programming/adrift/taf2inf.tgz
>
> (Requires perl)
>
> Any comments would be appreciated. (Any help bundling this as a Windows
> standalone would be greatly appreciated.)
>

New release in incoming.

0 new messages