How do I include files?

So…, I am new to this and wanted to include the zillib, for obvious reasons, so i searched up and told me to use <USE “files”>, didn’t work, so i used <INSERT-FILE “FILES”>, also didn’t work.
This is the errors:

./bin/zilf.exe -ip ./zillib ./shit.zil 
ZILF 0.9 built 11/08/2019 12:30:42
[error MDL0214] ./zillib\orphan.zil:38: GLOBAL: already defined: P-O-REASON
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:39: GLOBAL: already defined: P-O-CONT
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:41: DEFMAC: already defined: ORPHANING?
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:42: DEFMAC: already defined: ORPHANING-PRSI?
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:43: DEFMAC: already defined: ORPHANING-BECAUSE-MISSING?
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:45: DEFMAC: already defined: ORPHAN
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\orphan.zil:83: ROUTINE: already defined: HANDLE-ORPHAN-RESPONSE
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:561
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:17: ROUTINE: already defined: QUEUE
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:32: ROUTINE: already defined: DEQUEUE
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:48: ROUTINE: already defined: DEL-EVENT
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:56: ROUTINE: already defined: IQUEUE-CLEANUP
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:86: ROUTINE: already defined: RUNNING?
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:112: ROUTINE: already defined: CLOCKER
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] ./zillib\events.zil:136: ROUTINE: already defined: WAIT-TURNS
  in INSERT-FILE called at C:\Users\vicen\Desktop\zilshit\zillib\parser.zil:3083
  in INSERT-FILE called at ./shit.zil:3
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:5: DEFSTRUCT: already defined: PRONOUN
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:10: DEFINE: already defined: PRONOUN
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:17: DEFINE: already defined: FINISH-PRONOUNS
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:119: ROUTINE: already defined: THIS-IS-IT
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:126: ROUTINE: already defined: CONTENTS-ARE-IT
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pronouns.zil:140: DEFINE: already defined: PRONOUN-PROPSPEC
  in INSERT-FILE called at ./shit.zil:4
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:34: DEFMAC: already defined: PDO-NADJ
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:37: DEFMAC: already defined: PDO-NNOUN
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:40: DEFMAC: already defined: PDO-ADJ/TBL
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:43: DEFMAC: already defined: PDO-NOUN/TBL
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:46: DEFMAC: already defined: PDO-ACTION
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:57: ROUTINE: already defined: REFERS-PSEUDO?
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:76: DEFMAC: already defined: PDO-ADJ-REFERS?
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:80: DEFMAC: already defined: PDO-NOUN-REFERS?
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:92: ROUTINE: already defined: MATCH-PSEUDO
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:101: ROUTINE: already defined: MAKE-PSEUDO
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:135: GLOBAL: already defined: PSEUDO-LOC
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:137: OBJECT: already defined: PSEUDO-OBJECT
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\pseudo.zil:144: DEFINE: already defined: THINGS-PROPSPEC
  in INSERT-FILE called at ./shit.zil:5
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:9: GLOBAL: already defined: MAP-SCOPE-STATUS
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:14: DEFINE: already defined: SCOPE-STAGE
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:19: DEFMAC: already defined: SCOPE-STAGE?
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:29: DEFMAC: already defined: SCOPE-EXIT
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:76: ROUTINE: already defined: INVENTORY-SCOPE-STAGE
  in EVAL called at C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:75
  in MAPF called at C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:69
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:83: CONSTANT: already defined: SCOPE-STATE
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:85: CONSTANT: already defined: SCOPE-CURRENT-STAGES
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:86: GLOBAL: already defined: SCOPE-CURRENT-STAGE
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:89: GLOBAL: already defined: MAP-SCOPE-OPTIONS
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:91: DEFMAC: already defined: MAP-SCOPE
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:150: ROUTINE: already defined: MAP-SCOPE-INIT-STAGES-FROM-BITS
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:173: ROUTINE: already defined: MAP-SCOPE-START
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:191: ROUTINE: already defined: MAP-SCOPE-NEXT
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\scope.zil:210: ROUTINE: already defined: SCOPE-CRAWL
  in INSERT-FILE called at ./shit.zil:6
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:230: ROUTINE: already defined: YOU-MASHER
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:233: ROUTINE: already defined: POINTLESS
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:244: ROUTINE: already defined: NOT-POSSIBLE
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:248: ROUTINE: already defined: RHETORICAL
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:251: ROUTINE: already defined: BE-SPECIFIC
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:255: ROUTINE: already defined: SILLY
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:259: ROUTINE: already defined: TSD
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:263: DEFMAC: already defined: IF-PLURAL
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:266: ROUTINE: already defined: PRE-REQUIRES-LIGHT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:273: ROUTINE: already defined: V-LOOK
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:296: ROUTINE: already defined: DESCRIBE-ROOM
  in INSERT-FILE called at ./shit.zil:8
[warning MDL0502] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:324: DEFAULT-DEFINITION: duplicate default for section: DARKNESS-F
  in INSERT-FILE called at ./shit.zil:8
[warning MDL0502] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:339: DEFAULT-DEFINITION: duplicate default for section: DESCRIBE-OBJECTS
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:424: DEFMAC: already defined: UPPERCASE-CHAR
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:431: ROUTINE: already defined: PRINT-CAP-STR
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:444: ROUTINE: already defined: PRINT-CAP-OBJ
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:457: ROUTINE: already defined: PRINT-INDEF
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:466: ROUTINE: already defined: PRINT-DEF
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:471: ROUTINE: already defined: PRINT-CINDEF
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:482: ROUTINE: already defined: PRINT-CDEF
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:489: ROUTINE: already defined: DESCRIBE-CONTENTS
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:499: ROUTINE: already defined: INV-DESCRIBE-CONTENTS
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:568: ROUTINE: already defined: LIST-OBJECTS
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:654: ROUTINE: already defined: LIST-OBJECTS-PRINT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:701: DEFMAC: already defined: GAME-VERB?
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:716: ROUTINE: already defined: V-WALK
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:765: ROUTINE: already defined: V-ENTER
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:773: ROUTINE: already defined: DO-WALK
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:780: ROUTINE: already defined: DOOR-DIR
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:791: ROUTINE: already defined: OTHER-SIDE
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:796: ROUTINE: already defined: V-QUIT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:804: ROUTINE: already defined: V-EXAMINE
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:821: ROUTINE: already defined: V-LOOK-UNDER
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:828: ROUTINE: already defined: V-SEARCH
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:838: ROUTINE: already defined: V-INVENTORY
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:858: ROUTINE: already defined: V-TAKE
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:871: ROUTINE: already defined: TRY-TAKE
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:950: ROUTINE: already defined: TAKE-HOLDER
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:983: ROUTINE: already defined: BLOCKS-TAKE?
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:989: DEFMAC: already defined: COMMON-PARENT?
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:992: ROUTINE: already defined: COMMON-PARENT-R
  in INSERT-FILE called at ./shit.zil:8
[warning MDL0502] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1009: DEFAULT-DEFINITION: duplicate default for section: TAKE-CAPACITY-CHECK
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1025: ROUTINE: already defined: PRE-DROP
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1030: ROUTINE: already defined: V-DROP
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1037: ROUTINE: already defined: PRE-PUT-ON
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1042: ROUTINE: already defined: V-PUT-ON
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1077: ROUTINE: already defined: PRE-PUT-IN
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1082: ROUTINE: already defined: V-PUT-IN
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1126: ROUTINE: already defined: CONTENTS-WEIGHT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1134: ROUTINE: already defined: WEIGHT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1148: ROUTINE: already defined: V-WEAR
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1154: ROUTINE: already defined: V-UNWEAR
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1160: ROUTINE: already defined: V-EAT
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1169: DEFMAC: already defined: PRINT-GAME-BANNER
  in INSERT-FILE called at ./shit.zil:8
[error MDL0214] C:\Users\vicen\Desktop\zilshit\zillib\verbs.zil:1177: ROUTINE: already defined: V-VERSION
  in INSERT-FILE called at ./shit.zil:8
[fatal ZIL0001] ./shit.zil:8: too many errors, stopping

What do i do?

3 Likes

I’m not very good, but maybe you tried defining all those variables or routines? Off the top of my head…

Or possibly one of the files you used are clashing with the other files included.

Hard to tell, but I see two potential poblems:

  1. I guess you’re on windows (C:\Users\... is a tell) and there are a mix of directory delimiters. Windows use \, but you have / on a couple of places.
  2. It seems that the same files gets INSERTed multiple times. Check that, for example, verbs.zil only gets included once.
3 Likes

nope, i included it only once, btw do i need to include them while compiling?

in the compiler args

No, but they need to be in the search path (or included with path, absolute or relative).

Is it the ZilLib that’s shipped with the Zilf compiler?

well i included them in the compiler args and they are not in the path, and yes, it is the one shipped with zilf

1 Like

I can’t see what’s wrong, but I gonna show an example that maybe will help you. I have the following path structure:

--- Craverly eight
          |----- zillib
                    |----- events.zil
                    |----- orphan.zil
                    |----- parser.zil
                    |----- pronouns.zil
                    |----- pseudo.zil
                    |----- scope.zil
                    |----- template.zil
                    |----- verbs.zil
          |----- craverlyheights_zil.zil

The file craverlyheights_zil.zil begins like this:

"Craverly Heights by Ryan Veeder - A ZIL exercise by Henrik Åsman"

<CONSTANT GAME-TITLE "Craverly Heights">
<CONSTANT GAME-DESCRIPTION 
"An Interactive Fiction by Ryan Veeder|
Ported to ZIL by Henrik Åsman, with kind permission of the author.">

<VERSION XZIP>
<CONSTANT RELEASEID 2>
<CONSTANT IFID-ARRAY <PTABLE (STRING) "UUID://C2586C17-0345-47D0-BD9E-9B738628F425//">>

<SETG EXTRA-FLAGS
    (
    BACKSTAGE               ;"Room is a backstage room, default rooms are onstage."
    DEADBIT                 ;"Indicates if the person is dead (or alive)."
    GREETBIT                ;"Flag to handle greet words like HI and HELLO."
    )>

<ROUTINE GO ()
	;"Init clock to 12:00 if it is compiled to z3 <VERSION ZIP TIME>"
	<VERSION? (ZIP
		<SETG SCORE 12>
		<SETG MOVES 0>)>
    <CRLF>
    <INIT-STATUS-LINE>
    <V-VERSION>
    <CRLF>
    <PUTP PLAYER ,P?CAPACITY 50> ;"Default SIZE of an object is 5. This limits the inventory to 10 objects." 
    <SETG HERE ,HOSPITAL>
    <MOVE ,PLAYER ,HERE>
    <SETG MODE ,VERBOSE>         ;"Start game in VERBOSE, just like Inform7."
    <SETG SUSPECT ,PAULINE>
    <V-LOOK>
    <MAIN-LOOP>>

<INSERT-FILE "zillib/parser">

<ROUTINE CONTAINER-EMPTY? (O "AUX" (N 0))
    <MAP-CONTENTS (F .O)
        <SET N <+ .N 1>>>
    <COND (<==? .N 0> <RTRUE>)
          (ELSE <RFALSE>)>>

To compile this a use the command-line window (cmd) and position myself in the folder that contains the craverlyheights_zil.zil file. From there a issue these commands:

path\to\ZILF\zilf\Zilf.exe -w craverlyheights_zil.zil
path\to\ZILF\zilf\Zapf.exe craverlyheights_zil.zap

Done!

(Actually I usually make a bat-file that compiles and creates abbrevations that I can click on from the windows explorer, see example below.)

@echo off

..\..\..\..\Source\ZIL\ZILF\zilf-0.9.0-win-x64\bin\Zilf.exe -w zork_285.zil

..\..\..\..\Source\ZIL\ZILF\zilf-0.9.0-win-x64\bin\Zapf.exe -ab zork_285.zap

IF EXIST *.xzap IF EXIST *_freq.zap (
	del /F /Q *_freq.zap )
	
..\..\..\..\Source\ZIL\ZILF\zilf-0.9.0-win-x64\bin\Zapf.exe zork_285.zap

del /F /Q ..\zapf\*.zap
del /F /Q ..\zapf\*.xzap

move *.zap ..\zapf\
move *.dbg ..\zapf\

IF EXIST *.z5 (
	del /F /Q ..\bin\*.z5
	move *.z5 ..\bin\ )

pause
1 Like

ok, that might seem to work, btw i prefer make, i use msys2

The error message indicates what went wrong: the compiler was encountering more than one definition of the same globals, macros, routines, etc.

It looks like you may have had something like this:

<INSERT-FILE "orphan">
<INSERT-FILE "parser">
<INSERT-FILE "verbs">

That will cause problems, because parser.zil also inserts orphan.zil and verbs.zil.

Unlike the module and namespace systems in most modern programming languages, INSERT-FILE in ZIL doesn’t protect you against including the same file more than once. Every time the compiler encounters <INSERT-FILE "foo">, it opens foo.zil and processes everything inside, even if it’s already seen that file before. (USE avoids this, but the files have to be specially written to work with USE, and zillib wasn’t.)

In the ZILF library, parser.zil inserts every other library file, so those files were getting inserted twice – once directly by your main game file, and once indirectly by parser.zil.

The solution is to only <INSERT-FILE "parser"> and let it insert the rest of the library files itself.

4 Likes

I included everything exept stuff in the experimental folder, what files get included by others in the zillib folder?

Only the above quoted file.

1 Like

so that means that i need to include everything exept orphan and verbs?

No…

You only include the file parser.zil with the command <INSERT-FILE "parser">. That file will in its turn include the rest of the files that’s needed (orphan, pseudo, pronouns, scope, events and verbs). If the zillib-directory isn’t among your search paths you’ll have to specify it with the -ip switch.

Example:

zilf -ip path\to\zillib\ mygame.zil

mygame.zil should only include parser.zil from zillib/ .

2 Likes

now it says

.\zillib\verbs.zil:1178 undefined global or constant: GAME-BANNER
.\shit.zil:21 SETG: argument 1: no such variable: M-LOOK
.\shit.zil:26: FORM must start with an atom
  1. GAME-BANNER, ZilLib requires that you either define the constants GAME-TITLE and GAME-DESCRIPTION, or the constant GAME-BANNER.
<CONSTANT GAME-TITLE "My game">
<CONSTANT GAME-DESCRIPTION "An Interactive Fiction by John Smith">
  1. M-LOOK is a constant defined by library. My guess is that you are missing a comma in front of it or that you are using it wrong. If you post the line and some lines around it, it would be easier to say.

  2. Is a syntax-error. Maybe a missing <, >, ( or )? Easier if you post the line or maybe the whole routine around it.

2 Likes

well, turns out that the 2nd error is my fault, i tries to set a variable true but accidentally wrote M-LOOK instead of HE-KNOWS?.

here is the function that has the FORM error:

<ROUTINE RSHIT-F(RARG)
    <COND (<EQUAL? .RARG ,M-LOOK>
        <TELL "There is nothing, it's all just fucking shit, kys" CR>)
        (<,HE-KNOWS?>
        <TELL "Ye there is shit and some crap, and a door." CR>)>>
1 Like

HE-KNOWS? is a global variable, not a routine. Write:

<ROUTINE RSHIT-F(RARG)
    <COND (<EQUAL? .RARG ,M-LOOK>
        <TELL "There is nothing, it's all just fucking shit, kys" CR>)
        (,HE-KNOWS?
        <TELL "Ye there is shit and some crap, and a door." CR>)>>

And I think it will work.

2 Likes