A new way to create CYOA and export them to various formats

TAVERN can almost certainly be implemented for old 16-bit and 8-bit systems (it is designed to be possible), although in that case it might be better to implement it in the assembly language for that system (and take advantage of the unique features of that system) rather than compiling the reference implementation; this C implementation isn’t designed for 8-bit and 16-bit computers. (Anyone who does wish to port it may find har.c useful if they wish to use a different storage format for the other computers.)

I hope soon (perhaps within the next week) I will write a simple and working choice based adventure for TAVERN (I intend to even start today actually). Once I have it, I will post it on this intfiction forum.

I have now made a simple CYOA in TAVERN. Here is the code:[code]INCLUDE bookadv.inc

INTRO| \z
This is a example of TAVERN Book Adventure.
This example game is public domain.
\n\n
If you can reach the centre of the map then you win.
|

START-PAGE NE

<<<PAGE NW
PT| You are at the northwest corner of the map.|

| East| N
| South| W
PAGE>>>

<<<PAGE N
PT| You are at the north edge of the map.|

| West| NW
| East| NE
| South| FIN
PAGE>>>

<<<PAGE NE
PT| You are at the northeast corner of the map.|

| West| N
| South| E
PAGE>>>

<<<PAGE W
PT| You are at the west edge of the map.|

| East| FIN
| North| NW
| South| SW
PAGE>>>

<<<PAGE E
PT| You are at the east edge of the map.|

| West| FIN
| North| NE
| South| SE
PAGE>>>

<<<PAGE SW
PT| You are at the southwest corner of the map.|

| East| S
| North| W
PAGE>>>

<<<PAGE S
PT| You are at the south edge of the map.|

| West| SW
| East| SE
| North| FIN
PAGE>>>

<<<PAGE SE
PT| You are at the southeast corner of the map.|

| West| S
| North| E
PAGE>>>

<<<PAGE FIN
PT| \z
Congratulation\n
You win!!!
\n\n
Type QUIT to quit or RESTART to try again
|
PAGE>>>
[/code]

Currently there is no support for variables and so on, but this may be added later on. I also fixed some mistakes in TAVERN, and added the file “bookadv.inc” (which this file uses; “TAVERN Book Adventure” is the include file used for CYOA, with the filename “bookadv.inc”).

I’ve begun to work on a perl based script to convert my textallion syntax to your TAVERN one. It works, sort of, but there are still some manual adjustements to do before being able to compile it a correct TAVERN file. First, the syntax is quite strict, with closing elements like PAGE>>>. There is probably a correct way to handle this in perl, but I’m not good enough. I’ll find a way, but some errors will probably remain (I’ll add a PAGE>>> closing before a new one start). Also paragraphs requires “PT| description |”. Again, this is not an easy task to automate.

When there is an error, the compiler is not very verbose, only one word for context, no number line:

~/bin/tavernc < sample_tavern.txt > sample_tavern.tav
FATAL: Word not defined: There

maybe it would be easier to debug with more elements? (if it’s possible)

There is another problem, because a paragraph can only be this way:

  PT| first paragraph. \n Second paragraph.|

>| First choice: | 2 
>| other choice: | 5 

And not this way:

  PT| first paragraph. |

  PT| Second paragraph.|

>| First choice: | 2 
>| other choice: | 5 

In the last example, only the second paragraph will be displayed. So for this kind of thing, I don’t know how to parse paragraphs like this my my source code:

First paragraph. 

Second paragraph.

- First choice: 2
- other choice: 5

You are right, and I have fixed it so that now it includes line numbers in the fatal error messages (if applicable). If multiple input files are loaded, it will specify multiple line numbers (with the innermost file line number listed at first). (Note: Sometimes the error is actually on the previous line if it has already read the line break from that line.)