Kategorien
Dialog

Actor’s studio – Inform Example No. 221

Das Inform-Beispiel Nr. 221, nach Dialog portiert

%% Beispiel Nr. 221 der Inform Dokumentation
%% Eine Videokamera, die Ereignisse aufzeichnet 
%% und sie dann
%% mit einem Zeitstempel wieder abspielt.

(global variable (videostream []))
(global variable (time $))
~(memory is empty)

(global variable (camera mode $))

(setting $) (fail)

#idle 
(name *) Ruhemodus 
(dict *) ruhemodus ruhe
(setting *)
(* is #partof #camera)

#recording 
(name *) Aufnahme 
(dict *) aufnahme
(setting *)
(* is #partof #camera)

#replaying 
(name *) Wiedergabe 
(dict *) wiedergabe
(setting *)
(* is #partof #camera)

(style class @score)
	width: 20ch;
	float: right;

(intro)
    (now) (time 542)
    (now) (camera mode #idle)
    (try [look])
    
(redraw status bar)
	(status bar @status) {
        (time headline)
        (location headline)
	}

(time headline)
    (div @score) {
        (time $Time)
        Zeit: 
        (say time $Time)
    }

(say time $A)
    ($A divided by 60 into $C)
    ($A modulo 60 into $D)
    $C:(no space)
    (if) ($D < 10) (then)
        0(no space)
    (endif)
    $D

(after $Action)
    (camera mode #recording)
    ~($Action = [wait])
    ~($Action = [$ #camera $ $])
    (videostream $Video)
    (length of $Video into $Len)
    (if) ($Len < 48) (then)
        (time $T)
        (append [$T | [$Action]] $Video $New)
        (now) (videostream $New)
    (else)
        (now) (camera mode #idle)
        Der Speicher der Videokamera ist voll 
        und sie schaltet in den Ruhemodus.
    (endif)

(on every tick)
    (time $A)
    ($A plus 1 into $B)
    (now) (time $B)

(on every tick)
    (camera mode #replaying)
    (if) ~(memory is empty) (then)
        (videostream $Video)
        (reverse $Video $List)
        (now) (memory is empty)
        (report actions from list $List)
    (else)
        Du siehst nur Rauschen auf der Videokamera.
    (endif)

(report actions from list [$Action $Time | $Tail])
    (line)Um (say time $Time) Uhr hat die Kamera aufgezeichnet, als du dabei warst,
    (describe infinitive action $Action).
	(report actions from list $Tail)

(current player #player)
(#player is #in #actor_studio)

#actor_studio
(room *)
(name *)    Filmstudio(-s)
(* is maskulin)

#lucas
(male actor *)
(name *)    Lucas
(proper *)
(dict *)    lucas mann typ
(* is #in #actor_studio)
(appearance #lucas $ $)
    Lucas ist hier.

(prevent [tell #lucas to take $Obj])
    {
        ($Obj is #heldby $NPC)
        (Der $NPC) (hat $NPC) (den $Obj) schon.
    (or)
        ~(item $Obj)
        (Der $NPC) (kann $NPC) (den $Obj) nicht nehmen.
    }

(perform [tell #lucas to take $Obj])
    (let #lucas take $Obj)

(perform [tell #lucas to eat $Obj])
    (let #lucas eat $Obj)

(let $NPC eat $Obj)
    (if) ~(edible $Obj) (then)
        (fail)
    (endif)
    (if) (player can see $Obj) (then)
        (if) ~($Obj is #heldby $NPC) (then)
            \(Erst nimmt Lucas (den $Obj)\)(line)
            (now) ($Obj is #heldby $NPC)
        (endif)
		(narrate $NPC eating $Obj)
	(endif)
	(now) ($Obj is nowhere)

(narrate $NPC eating $Obj)
	(Der $NPC) (isst $NPC) (den $Obj).

#croissant
(item *)
(name *)    Croissant(-s)
(dict *)    croissant
(edible *)
(* is handled)
(* is neutrum)
(* is #in #actor_studio)

#camera
(item *)
(name *)    Videokamera
(dict *)    video kamera videokamera
(descr *)
        Die Videokamera ist momentan auf 
        (camera mode $Mode)
        (name $Mode) eingestellt.
(* is feminin)
(* is #in #actor_studio)
(* is handled)

(describe action [set $Obj to $Setting])
	(den $Obj) auf (name $Setting) einstellen

(understand infinitive [einstellen/stellen] as Verb [stell])

(unlikely [put $Obj #on $Dest])
	($Obj = #camera)

(understand [stell | $Words] as [set $Obj to $Setting])
    *(split $Words by [auf] into $Left and $Right)
    *(understand $Left as single object $Obj)
    *(understand $Right as single object $Setting)

(understand [stell ein | $Words] as [set $Obj to $Setting])
    *(split $Words by [auf] into $Left and $Right)
    *(understand $Left as single object $Obj)
    *(understand $Right as single object $Setting)

(refuse [set $Obj to $Setting])
    (just)
    ~($Setting is one of [#idle #recording #replaying])
    Das ist keine gültige Einstellung für (den $Obj).

(perform [set $Obj to $Setting])
    (now) (camera mode $Setting)
    Die Videokamera ist nun auf (name $Setting) eingestellt.
    (if) ($Setting is one of [#recording #idle]) (then)
        (now) ~(memory is empty)
    (endif)

%% Testen: "stell kamera auf aufnahme / x lucas / winke / lucas, iss croissant / stell kamera auf wiedergabe / z"
Kategorien
Dialog

Actaeon – Inform Example No. 302

Actaeon, das Inform-Beispiel Nr. 302, nach Dialog portiert

%% Beispiel Nr. 302 der Inform Dokumentation
%% Nehmen wir an, wir möchten in der Lage sein, einem NPC 
%% zu folgen, wenn er sich auf der Karte bewegt. Der Trick
%% ist, dass wir ihn referieren müssen, obwohl er nicht in
%% Sichtweite ist.

(global variable (last location of artemis was $))

(proper *(room $))

(current player #player)
(#player is #in #corinth)

#artemis
(female actor *)
(name *)    Artemis
(dict *)    frau dame artemis
(proper *)
(appearance * $ $)
    Artemis ist hier und überlegt, wohin sie als nächstes 
    gehen soll.
(* is #in #corinth)

#corinth
(room *)    
(name *)    Corinth
(from * go #south to #mycenae)
(from * go #east to #athens)
(from * go #southeast to #epidaurus)

#athens
(room *)   
(name *)    Athen
(from * go #northwest to #thebes)
(from * go #west to #corinth)

#epidaurus
(room *)
(name *)    Epidaurus
(from * go #northwest to #corinth)
(from * go #west to #mycenae)

#mycenae
(room *)
(name *)    Mycenae
(from * go #north to #corinth)
(from * go #south to #argos)
(from * go #east to #epidaurus)
(from * go #west to #olympia)

#olympia
(room *)
(name *)    Olympia
(from * go #east to #mycenae)
(from * go #south to #pylos)

#argos
(room *)
(name *)    Argos
(from * go #north to #mycenae)
(from * go #south to #sparta)

#thebes
(room *)
(name *)    Thebes
(from * go #southeast to #athens)
(from * go #northwest to #delphi)

#pylos
(room *)
(name *)    Pylos
(from * go #north to #olympia)
(from * go #east to #sparta)

#sparta
(room *)
(name *)    Sparta
(from * go #north to #argos)
(from * go #west to #pylos)

#delphi
(room *)
(name *)    Delphi
(from * go #southeast to #thebes)

(add #artemis to scope)

(on every tick)
    (#artemis is #in $Loc)
    (now) (last location of artemis was $Loc)
    (collect $Exit)
        *(from $Loc go $Exit to $)
    (into $ExitList)
    (randomly select $Chosen from $ExitList)
    (let #artemis go $Chosen)

(describe action [follow $Obj])
	(dem $Obj) folgen

(understand infinitive [folgen/verfolgen] as Verb [folg])

(understand [folg/verfolg | $Words] as [follow $Obj])
    *(understand $Words as single object $Obj)
    (animate $Obj)

(refuse [follow $NPC])
    (current room $Room)
    (just)
    {
        ($NPC is #in $Room)
        (Der $NPC) steht direkt vor dir.
    (or)
        ~(last location of artemis was $Room)
        Du bist ahnungslos, wo sich (der $NPC) 
        gerade befindet.
    }
    
(perform [follow $NPC])
    (current room $Room)
    (#artemis is #in $NextRoom)
    (from $Room go $Dir to $NextRoom)
    (try [go $Dir])

%% Testen: "z / folge artemis / g / g"
Kategorien
Dialog

Access – Inform Example No. 338

Das Inform-Beispiel Nr. 338, nach Dialog portiert

%% Beispiel Nr. 338 der Inform Dokumentation
%% Es gibt eine extrem kniffelige Tür zu der der Schlüssel fehlt
%% Der Spieler kann sie passieren, wenn er den Hut trägt

(singleton *(room $))

(current player #player)
(#player is #in #standing_room)

#standing_room
(room *)
(name *)    stehend(er) Raum
(* is maskulin)
(from * go #north through #door to #room_of_walking_upside_down)

#room_of_walking_upside_down
(room *)
(name *)    verkehrt(er) Raum
(* is maskulin)
(from * go #south through #door to #standing_room)

#door
(door *)
(lockable *)
(name *)	extrem kniffelig(e) Tür
(dict *)    extrem kniffelig tür
(* is feminin)

#hat
(item *)
(wearable *)
(name *)    gepunktet(er) Hut(-es) der kaum wahrnehmbaren Grenzüberschreitung
(dict *)    gepunktet hut kaum wahrnehmbar grenzüberschreitung
(* is #heldby #player)
(* is maskulin)
(singleton *)

(before [go $Dir])
    (#hat is #wornby #player)
    (just)

(#door blocks passage)
    (#hat is #wornby #player)
    (just) (fail)

%% Testen: "n / zieh hut an / n"
Kategorien
Dialog

Aarp-Gnosis – Inform Example No. 335

Aarp, das Inform Beispiel Nr. 335, nach Dialog portiert

%% Beispiel Nr. 335 der Inform Dokumentation
%% Nehmen wir an, wir hätten eine Ezyklopädie in unserem Spiel. 
%% Der Spieler kann das vollständige Werk mitnehmen, aber auch
%% nur Teile davon; legt er einen Teil davon auf denselben Platz
%% wie der Rest der Enzyklopädie, wird diese automatisch komplettiert;
%% Ist die Anzahl der Teile der Enzyklopädie kleiner als 2, wird diese
%% entfernt und falls sich wieder mindestens 2 Exemplare am gleichen
%% Platz befinden, dort wieder verortet.

(current player #player)
(#player is #in #library)

#library
(room *)
(name *)    Boise Memorial Bibliothek
(dict *)    bibliothek
(* is feminin)
(look *)
        Eine Betonschachtel, ungefähr zweinhalb mal viereinhalb Meter, 
        die das letzte bißchen Unterhaltung in dieser post-nuklearen 
        Notunterkunft beherbergt. Jemand mit makabrem Humor hat einen
        "LESE!"-Sticker an die Tür geheftet, als ob es noch andere Dinge
        zu tun gäbe, während man auf das Sinken der Geiger-Zähler wartet.

#shelf
(supporter *)
(item *)
(name *)    Regal(-s)
(dict *)    regal
(is fine where it is *)
(* is neutrum)
(* is handled)
(descr *)
        Ein abgenutztes Regal lehnt an der Südwand.
(* is #in #library)

(item $Obj)     *(collective $Obj)

(item $Obj)     *(volume $Obj)
       
($Obj is handled)       *(volume $Obj)
($Obj is maskulin)      *(volume $Obj)
(proper $Obj)           *(volume $Obj)

($ fits $)      (fail)

#encyclopedia
(name *)        
        (collect $Obj)
                *(volume $Obj)
                ($Obj fits *)
                ($Obj is #partof *)
        (into $List)
        (collect $Missing)
                *(volume $Missing)
                ($Missing fits *)
                ~($Missing is #partof *)
        (into $MissingList)
        (length of $List into $Here)
        (length of $MissingList into $Miss)
        (if) ($Miss = 0) (then)
                komplett(es)
        (endif)
        Werk der New Idahoan Enzyklopädie mit (dem $List)
        (if) ($Miss > 0) (then)
                \(ohne (der $MissingList)\)
        (endif)              

(dict *)        werk new idahoan lexikon 
(fsyn *)        enzyklopädie 
(collective *)
(* is neutrum)
(* is #on #shelf)
(* is handled)

(descr (collective $Obj))

(on every tick)
        *(collective $Obj)
        (collect $PartVol)
                *(volume $PartVol)
                ($PartVol has parent $Obj)
        (into $PartList)
        (length of $PartList into $Part)
        (if) ($Part = 1) (then)
                (nth $PartList 1 $Element)
                ($Obj has parent $Parent)
                (move $Element to $Parent)
                (now) ($Obj is nowhere)
                (locate new position of $Obj)
        (elseif) ($Part = 0) (then)
                (now) ($Obj is nowhere)
                (locate new position of $Obj)
        (endif)

(locate new position of $Collect)
        *(volume $Vol)
        ($Vol fits $Collect)
        ($Vol has parent $NewPar)
        (collect $Single)
                *(volume $Single)
                ($Single has parent $NewPar)
        (into $SameList)
        (length of $SameList into $Same)
        ($Same > 1)
        (move $Collect to $NewPar)
        (exhaust) {
                *(volume $NewVol)
                ($NewVol fits $Collect)
                ($NewVol has parent $NewPar)
                (now) ($NewVol is #partof $Collect)
        }
           
(move $Item to $Dest)
        {
                (supporter $Dest)
                (now) ($Item is #on $Dest)
        (or)
                (current player $Dest)
                (now) ($Item is #heldby $Dest)
        (or)
                (now) ($Item is #in $Dest)
        }

#a-aalto
(volume *)
(name *)        Teil(-s) A-Aalto
(dict *)        teil a-aalto
(* is #partof #encyclopedia)
(* fits #encyclopedia)

#aam-aardvark
(volume *)
(name *)        Teil(-s) AAM-Aardvark
(dict *)        teil aam-aardvark
(* is #partof #encyclopedia)
(* fits #encyclopedia)

#aarhus-aaron
(volume *)
(name *)        Teil(-s) Aarhus-Aaron
(dict *)        teil aarhus-aaron
(* is #partof #encyclopedia)
(* fits #encyclopedia)

#aarp-gnosis
(volume *)
(name *)        Teil(-s) AARP-Gnosis
(dict *)        teil aarp-gnosis
(* is #partof #encyclopedia)
(* fits #encyclopedia)

#gnu-zygote
(volume *)
(name *)        Teil(-s) Gnu-Zygote
(dict *)        teil gnu-zygote
(* is #partof #encyclopedia)
(* fits #encyclopedia)

(before [take/drop/remove $Obj])
        (volume $Obj)
        ($Obj has parent $Parent)
        {
                ($Obj is #partof $Parent)
                ($Parent has parent $Grandparent)
                (now) ($Obj is #in $Grandparent)
        (or)
                (now) ($Obj is #in $Parent)
        }

%% Testen: "nimm aarhus-aaron / schau auf regal / i / nimm aam-aardvark / schau auf regal / nimm gnu-zygote / schau auf regal / nimm aarp-gnosis / schau auf regal / i / leg werk ab / schau / nimm werk / nimm a-aalto / i"

 
Kategorien
Dialog

A&E – Inform Example No. 101

A&E, das Inform-Beispiel Nr. 101, nach Dialog portiert:

%% Beispiel Nr. 101 der Inform Dokumentation
%% Erschaffe eine Region (von Räumen), die den Zugang 
%% des Spielers blockieren, es sei denn er trägt den Pass bei sich. 

(current player #player)
(#player is #in #winding_street)

(room *(film-set $))

#winding_street
(room *)
(name *)    sich windend(e) Straße
(room header *) Sich windende Straße
(from * go #east to #duck_pond)
(from * go #north to #sloping_street)
(* is feminin)

#sloping_street
(room *)
(name *)    Straße
(room header *) Ansteigende Straße
(from * go #south to #winding_street)
(from * go #southeast to #duck_pond)
(from * go #east to #stately_lawn)
(from * go #northeast to #stately_home)
(* is feminin)

#duck_pond
(film-set *)
(name *)    Ententeich(-s)
(room header *) Am Ententeich
(from * go #west to #winding_street)
(from * go #northwest to #sloping_street)
(* is maskulin)

#stately_lawn
(film-set *)
(name *)    Rasenfläche
(room header *) Imposante Rasenfläche
(from * go #west to #sloping_street)
(from * go #north to #stately_home)
(* is feminin)

#stately_home
(film-set *)
(name *)    Haus(-es)
(room header *) Imposantes Haus
(from * go #southwest to #sloping_street)
(from * go #south to #stately_lawn)
(* is neutrum)

#garbage_can
(name *)    Mülltonne
(dict *)    tonne mülltonne
(container *)
(item *)
(* is feminin)
(* is #in #sloping_street)
(* is handled)
(fine where it is *)

#pass
(item *)
(name *)    Pass(-es)
(dict *)    pass
(* is #in #garbage_can)
(* is maskulin)
(* is handled)

(prevent [leave $Room $Dir])
    (from $Room go $Dir to $Dest)
    (film-set $Dest)
    (current player $Player)
    ~(#pass is #heldby $Player)
    Ein bulliger Studioangestellter blockiert deinen Weg und überzeugt dich, dass du dich besser woanders herumtreibst.

(after [leave $Room $Dir])
    (from $Room go $Dir to $Dest)
    (film-set $Dest)
    (par)
    (space 5)
    (bold)\*\*\* Erfolg! Du bist nun am Set von "Prouder and More Prejudiced" \*\*\*(unstyle)
    (game over)

%% Testen: "o / n / nimm pass / s / o". 

 

Kategorien
Allgemein

Borogove

Borogove ist eine Entwicklungsumgebung für Textadventures. Geschrieben ist das System von Juhana Leinonen als Webanwendung in Typescript. Damit setzt es einen neuen Standard, denn es arbeitet als Entwicklungsumgebung für Textadventures mittels Web-Werkzeugen völlig plattformunabhängig.

Von der Gestaltung her erinnert es an eine vereinfachte Version des Inform 7 Editors. Interessanterweise wird neben Inform 7 auch Inform 6 und Hugo unterstützt.

Außerdem hilft das System mit vorkonfigurierten Dateien mit oder ohne Vorple-Unterstützung den Autoren beim Start.

Die typischen Nachteile sind der Web-Umgebung geschuldet, wie etwa das Löschen der Quelldatei durch Neuladen der Seite, ohne vorheriges Speichern. Das ist aber schon der einzige Nachteil. Inform 7 kommt mit allen Standard-Erweiterungen, das Hinzufügen von eigenen Dateien wird über die Dateiverwaltung unkompliziert bewerkstelligt.

Linus Åkesson plant auch eine Unterstützung seines Dialog-Systems einzupflegen, einschließlich des interaktiven Debuggers. Dieser kann Quelländerungen zur Laufzeit in die Å-Machine integrieren, was bislang keinem System gelungen ist.

Das Potential dieses Systems ist herausragend, ich werde die Entwicklung gespannt weiter verfolgen.