' Quest 4.1 ASL Template
define game <Exit Demo>
asl-version <410>
gametype singleplayer
game version <1.0>
game author <MaDbRiT>
game copyright <© 2009 AGB>
game info <Demo.>
start <library>
description {
do <Describe_Proc>
}
end define
define room <library>
prefix <the>
properties <northto=the |cl|bstoreroom.|xb|cb; southto=z; westto=z; eastto=z>
north <storeroom>
end define
define room <storeroom>
prefix <the>
properties <northto=z; southto=the |cl|blibrary.|xb|cb; westto=the |cl|bboilehouse.|xb|cb; eastto=z>
south <library>
west <boilerhouse>
end define
define room <boilerhouse>
prefix <the>
properties <eastto=the |cl|bstoreroom.|xb|cb; southto=z; northto=z; westto=z>
east <storeroom>
end define
define procedure <Describe_Proc>
set string <Proc_indescription;$gettag(#quest.currentroom#;indescription)$>
if is <#Proc_indescription#;> then {
msg <|nYou are in $gettag(#quest.currentroom#;prefix)$ |b|cl#quest.currentroom#.|cb|xb|xn>
}
else {
msg <|n#Proc_indescription#$gettag(#quest.currentroom#;prefix)$ |b|cl#quest.currentroom#.|cb|xb|xn>
}
msg <|n>
set string <My_Exits;You can go...>
if (#(quest.currentroom):northto#<>z) then {
set <My_Exits;#My_Exits# |n|i|crNorth |cb|xito #(quest.currentroom):northto#>
}
if (#(quest.currentroom):southto#<>z) then {
set <My_Exits;#My_Exits# |n|i|crSouth |cb|xito #(quest.currentroom):southto#>
}
if (#(quest.currentroom):eastto#<>z) then {
set <My_Exits;#My_Exits# |n|i|crEast |cb|xito #(quest.currentroom):eastto#>
}
if (#(quest.currentroom):westto#<>z) then {
set <My_Exits;#My_Exits# |n|i|crWest |cb|xito #(quest.currentroom):westto#>
}
if not ( #My_Exits# = You can go...) then {
msg <#My_Exits#>
}
end define
define text <intro>
Enter intro text here
end define
define text <win>
Enter win text here
end define
define text <lose>
Enter lose text here
end define
Print "You may go:"
For each exit in "#quest.currentroom#"
Change the contents of numeric variable "i" to "$instr(#quest.thing#;.)$"
Decrement "i"
Change the contents of string "room" to "$left(#quest.thing#;%i%)$"
Increment "i" by "2"
Change the contents of string "exit" to "$mid(#quest.thing#;%i%)$"
Print "#exit# to #(room):prefix# [NO NEW LINE]"
Select Case "#exit#" {
Case "north" : Print "#(room):north#"
Case "south" : Print "#(room):south#"
Case "east" : Print "#(room):east#"
Case "west" : Print "#(room):west#"
Case "northeast" : Print "#(room):northeast#"
Case "southeast" : Print "#(room):southeast#"
Case "northwest" : Print "#(room):northwest#"
Case "southwest" : Print "#(room):southwest#"
Case "up" : Print "#(room):up#"
Case "down" : Print "#(room):down#"
Case "out" : Print "#(room):out#"
} }
Because Quest can only have one variable in a property read (eg. #(variable):property# NOT #(variable1):(variable2)#) ...
$objectproperty(object name; property name)$
Returns the value of the specified property of the specified object. Returns "!" and reports an ASL error if the specified object or property does not exist. This function is obsolete as it is equivalent to using #object:property# - see Reading Properties for more information.
description {
msg <|b#(quest.currentroom):alias#|xb|n>
msg <#(quest.currentroom):look#|n>
for each exit in <#quest.currentroom#> {
set numeric <i; $lengthof(#quest.thing#)$ - $instr(#quest.thing#;.)$>
set string <s; $right(#quest.thing#; %i%)$>
msg <|b$capfirst(#s#)$:|xb |cl#(quest.thing):to#|cb>
}
}
}