Compiling errors, help for a beginner

Hey everyone, I’m new here, nice to meet this beautiful community!

I am writing my first IF, but I’m having issues with the compiler, so if anyone is willing to help I’d be grateful!!
I followed this guide PunyInform: Installing the tools and compiling a game – Vintage is The New Old to compile an .inf file exported from Trizbort, where I built the game world. But I get errors from the compiler, see attached picture.

the .inf content are as follows:

!% -~S
!% $OMIT_UNUSED_ROUTINES=1
!% $ZCODE_LESS_DICT_DATA=1

! The very first lines of the main source code file for a game can
! contain compiler options, like the lines above. -~S disables
! strict error checking. This is otherwise used in z5 and z8 games by
! default. While useful for debugging, it adds ~10 KB to the story file
! size and it makes the game slower.
! $OMIT_UNUSED_ROUTINES=1 makes the compiler remove all routines which
! aren't used. This can save some space.
! $ZCODE_LESS_DICT_DATA=1 removes an empty data byte for every dictionary word.

Constant Story "Lucid Dreams 1 - v0.2.0";
Constant Headline "^By A Trizbort User^^^";

! Uncomment ONE of the two following lines, to show either time or score/turns
! Leaving both commented out makes the library bigger.
!Constant STATUSLINE_TIME; Statusline time;
Constant STATUSLINE_SCORE; Statusline score;

! Comment out to keep track of score
! The value is what will be shown as the score on statusline in z3
Constant NO_SCORE = 0;

! Customize the statusline in z5+ (will have no effect in z3)
!Constant OPTIONAL_SL_NO_SCORE;
!Constant OPTIONAL_SL_NO_MOVES;

! Uncomment to add optional features to PunyInform
!Constant DEBUG;
!Constant DIALECT_US ! Affects OPTIONAL_ENGLISH_NUMBER
!Constant CUSTOM_ABBREVIATIONS;
!Constant CUSTOM_PLAYER_OBJECT = myPlayerObj;
Constant OPTIONAL_NO_DARKNESS;
!Constant OPTIONAL_ALLOW_WRITTEN_NUMBERS;
!Constant OPTIONAL_EXTENDED_METAVERBS;
!Constant OPTIONAL_EXTENDED_VERBSET;
!Constant OPTIONAL_FLEXIBLE_INVENTORY;
!Constant OPTIONAL_LANGUAGE_NUMBER;
!Constant OPTIONAL_LIST_TOGETHER;
!Constant OPTIONAL_PRINT_SCENERY_CONTENTS;
!Constant OPTIONAL_SCORED;
!Constant OPTIONAL_FULL_SCORE; ! Comment out NO_SCORE when uncommenting this
!Constant OPTIONAL_FULL_DIRECTIONS;
!Constant OPTIONAL_SIMPLE_DOORS;
!Constant OPTIONAL_SHIP_DIRECTIONS;
!Constant OPTIONAL_GUESS_MISSING_NOUN;
!Constant OPTIONAL_MANUAL_SCOPE;
!Constant OPTIONAL_MANUAL_REACTIVE;
!Constant OPTIONAL_ORDERED_TIMERS;
!Constant OPTIONAL_PROVIDE_UNDO;
!Constant OPTIONAL_REACTIVE_PARSE_NAME;
!Constant RUNTIME_ERRORS = 0; ! 0, 1 or 2. 0 = smallest file, 2 = most info

! Define any library constants you need here, like MAX_SCORE, AMUSING_PROVIDED,
! MAX_CARRIED, SACK_OBJECT,  etc.

Constant INITIAL_LOCATION_VALUE = Ingressodellaproprieta;

Include "globals.h";

! Define your attributes, common properties and global variables here, if any

! Define the entry point routines you need here, like Amusing, DarkToDark etc.

! Uncomment to add PunyLib extensions
!Include "ext_menu.h";
!Include "ext_flags.h";
!Include "ext_talk_menu.h"; ! Note: Also include ext_flags.h to allow use of flags
!Include "ext_quote_box.h";
!Include "ext_cheap_scenery.h";

Include "puny.h";

! Uncomment to add PunyLib extensions
!Include "ext_waittime.h";

Object  Ingressodellaproprieta "Ingresso della proprietà"
  with  description
            "Sei al confine tra casa tua e il mondo esterno: alle tue spalle c'? il cancello, davanti ai tuoi piedi il vialetto in discesa che conduce al piazzale davanti casa, proseguendo poi lungo il lato sinistro dell'edificio fino al cortile sul retro. Alla tua destra, circa un metro pi? in basso, inizia il giardino che arriva fino al piazzale.",
        n_to Piazzale,
   has  light;

Object ->  Cancello "Cancello"
  with  name 'Cancello',
        description "Cancello";

Object  Piazzale "Piazzale"
  with  description
            "",
        n_to Discesa,
        s_to Giardino,
        e_to Ingresso,
        w_to Ingressodellaproprieta,
   has  light;

Object ->  Aiuolafiorita "Aiuola fiorita"
  with  name 'Aiuola' 'fiorita',
        description "Aiuola fiorita";

Object ->  Piantadaifiorirossi "Pianta dai fiori rossi"
  with  name 'Pianta' 'dai' 'fiori' 'rossi',
        description "Pianta dai fiori rossi";

Object ->  Murettodicemento "Muretto di cemento"
  with  name 'Muretto' 'di' 'cemento',
        description "Muretto di cemento";

Object ->  Pietradimontagna "Pietra di montagna"
  with  name 'Pietra' 'di' 'montagna',
        description "Pietra di montagna";

Object  Discesa "Discesa"
  with  description
            "",
        n_to Cortileerboso,
        s_to Piazzale,
   has  light;

Object ->  Finestrella "Finestrella"
  with  name 'Finestrella',
        description "Finestrella";

Object ->  Finestra "Finestra"
  with  name 'Finestra',
        description "Finestra";

Object  Ingresso "Ingresso"
  with  description
            "",
        n_to Corridoiodiconfine,
        s_to Piazzale,
        e_to Soffitta,
        w_to Corridoio,
   has  light;

Object  Cortileerboso "Cortile erboso"
  with  description
            "",
        n_to Orto,
        s_to Discesa,
        e_to Dietrocasa,
        w_to Cortile,
   has  light;

Object ->  Alberomaestoso "Albero maestoso"
  with  name 'Albero' 'maestoso',
        description "Albero maestoso";

Object ->  Noci "Noci"
  with  name 'Noci',
        description "Noci";

Object  Dietrocasa "Dietro casa"
  with  description
            "",
        s_to Scantinato,
        e_to Corridoiodiconfine,
        w_to Cortileerboso,
   has  light;

Object ->  Portadellacantina "Porta della cantina"
  with  name 'Porta' 'della' 'cantina',
        description "Porta della cantina";

Object ->  Chiavistello "Chiavistello"
  with  name 'Chiavistello',
        description "Chiavistello";

Object ->  Bancodalavoro "Banco da lavoro"
  with  name 'Banco' 'da' 'lavoro',
        description "Banco da lavoro";

Object ->  Attrezzi "Attrezzi"
  with  name 'Attrezzi',
        description "Attrezzi";

Object ->  Oliolubrificante "Olio lubrificante"
  with  name 'Olio' 'lubrificante',
        description "Olio lubrificante";

Object  Cortile "Cortile"
  with  description
            "",
        e_to Cortileerboso,
   has  light;

Object ->  Cane "Cane"
  with  name 'Cane',
        description "Cane";

Object ->  Catena "Catena"
  with  name 'Catena',
        description "Catena";

Object ->  Pioppo "Pioppo"
  with  name 'Pioppo',
        description "Pioppo";

Object  Scantinato "Scantinato"
  with  description
            "",
        n_to Dietrocasa,
        s_to Stanzino,
   has  light;

Object ->  Finestra2 "Finestra"
  with  name 'Finestra',
        description "Finestra";

Object ->  Portadellacantina2 "Porta della cantina"
  with  name 'Porta' 'della' 'cantina',
        description "Porta della cantina";

Object  Stanzino "Stanzino"
  with  description
            "",
        n_to Scantinato,
        w_to Discesa,
   has  light;

Object ->  Finestrella2 "Finestrella"
  with  name 'Finestrella',
        description "Finestrella";

Object  Corridoio "Corridoio"
  with  description
            "",
        n_to Soggiorno,
        e_to Ingresso,
        w_to Cucina,
   has  light;

Object ->  Portadellacucina "Porta della cucina"
  with  name 'Porta' 'della' 'cucina',
        description "Porta della cucina";

Object  Cucina "Cucina"
  with  description
            "",
        s_to Corridoio,
   has  light;

Object ->  Chiaveossidata "Chiave ossidata"
  with  name 'Chiave' 'ossidata',
        description "Chiave ossidata";

Object  Soggiorno "Soggiorno"
  with  description
            "",
        s_to Corridoio,
   has  light;

Object ->  Specchio "Specchio"
  with  name 'Specchio',
        description "Specchio";

Object ->  Cestodeigiochi "Cesto dei giochi"
  with  name 'Cesto' 'dei' 'giochi',
        description "Cesto dei giochi";

Object ->  Computer "Computer"
  with  name 'Computer',
        description "Computer";

Object ->  Mobile "Mobile"
  with  name 'Mobile',
        description "Mobile";

Object ->  Portadelsoggiorno "Porta del soggiorno"
  with  name 'Porta' 'del' 'soggiorno',
        description "Porta del soggiorno";

Object ->  Spadadiplastica "Spada di plastica"
  with  name 'Spada' 'di' 'plastica',
        description "Spada di plastica";

Object  Orto "Orto"
  with  description
            "",
        n_to Campagna,
        s_to Cortileerboso,
        e_to Corridoiodiconfine,
   has  light;

Object  Campagna "Campagna"
  with  description
            "",
        s_to Orto,
   has  light;

Object ->  Capanna "Capanna"
  with  name 'Capanna',
        description "Capanna";

Object  Corridoiodiconfine "Corridoio di confine"
  with  description
            "",
        n_to Orto,
        s_to Ingresso,
        w_to Dietrocasa,
   has  light;

Object  Giardino "Giardino"
  with  description
            "",
        n_to Piazzale,
   has  light;

Object ->  Alberosecco "Albero secco"
  with  name 'Albero' 'secco',
        description "Albero secco";

Object  Soffitta "Soffitta"
  with  description
            "",
        n_to Stanzino2,
        s_to Ingresso,
        w_to Terrazzo,
   has  light;

Object ->  Portadellostanzino "Porta dello stanzino"
  with  name 'Porta' 'dello' 'stanzino',
        description "Porta dello stanzino";

Object  Stanzino2 "Stanzino"
  with  description
            "",
        s_to Soffitta,
   has  light;

Object ->  Scatolone "Scatolone"
  with  name 'Scatolone',
        description "Scatolone";

Object ->  Paccoregalo "Pacco regalo"
  with  name 'Pacco' 'regalo',
        description "Pacco regalo"
  has open container;

Object -> ->  Robotpreferito "Robot preferito"
  with  name 'Robot' 'preferito',
        description "Robot preferito";

Object  Terrazzo "Terrazzo"
  with  description
            "",
        e_to Soffitta,
   has  light;

[Initialise;
	print "^^And so the story begins...^^";
];

1 Like

PunyInform doesn’t include darkness by default, so you’ll need to comment out this line from your code:
Constant OPTIONAL_NO_DARKNESS;

EDIT: To be clearer, the tutorial you link to was written a couple of years ago when PunyInform still defaulted to including the light attribute (used by the room in the example code). That has since changed, and recent versions of the library start with the OPTIONAL_NO_DARKNESS constant defined. If you remove or comment out that line, PunyInform will include the light attribute and so the old example code will compile successfully.

3 Likes

It worked! Thank you so much. But the line Constant OPTIONAL_NO_DARKNESS; actually comes from the sample file minimal.inf that comes with PunyInform, shouldn’t that be addressed?

2 Likes

The issue is really with the tutorial you’re following rather than the current version of PunyInform; all that’s happened is that the library has changed the way it deals with the concept of light and dark since that tutorial was written.

If the tutorial was written today, the code in Step 4 would be the same as the current minimal.inf, i.e. including the OPTIONAL_NO_DARKNESS constant, but omitting the light attribute when defining the Library object. By default, PunyInform will treat every room as lit and therefore the light attribute is unnecessary (and undefined).

Alternatively, you can choose to comment out OPTIONAL_NO_DARKNESS and PunyInform will set up the light attribute. You will now need to assign the light attribute appropriately in your game, otherwise rooms will be dark by default. However, this means you can now have puzzles in your game that depend on the player having a light source, etc.

2 Likes

Glad you got good help!

Just to add an idea of what you can do when you get compiler errors:

The compiler complained about the light attribute. If you look up the light attribute in the quickref document that’s included with the PunyInform distribution, you see this:

image

Or you could look at the appendix for attributes in the manual, and you get the same information. If you just search for “light” you find it soon enough as well.

1 Like

Benvenuto su Intfiction, Davide !

I confirm what “r_f” has explained, and add that the documentation has a sizeable section, with a well-written table, about the optionals, (pp. 26-29) whose can be easily used as a convenient quick reference.

Saluti,
dott. Piergiorgio

1 Like

Thanks for explaining that! I am slowly becoming familiar with all the available material

Ciao Piergiorgio, grazie!

yes, in fact I still have to study the full documentation, I needed to have a development system in place as soon as possible so I can have something to play with and keep the creativity and interest alive. Time is scarce these days…