command <call #@obj#> {
msg <#obj#_call>
set numeric <curr_want; $objectproperty(#obj#_call; want)$>
}
command <call #someone#> {
if exists <#someone#> and property <#someone#; call> then {
msg <whatever scripts you want to execute if it is someone you can call that exists in the game, go in here.>
}
else msg <Call who?|n>
}
define function <realname>
set string <tempname;$parameter(1)$>
set string <realname; >
if exists <#tempname#> then set <realname;#tempname#>
if (#realname#=) then set string <realname;$getobjectname(#tempname#; game)$>
return <#realname#>
end defineset string <obj; $realname(#obj#)$>' "TEST"
' Created with QDK 3.52
define game <TEST>
asl-version <350>
gametype singleplayer
start <hall>
game author <MaDbRiT>
game info <Created with QDK 3.52>
command <call #obj#> {
set string <obj; $realname(#obj#)$>
if action <#obj#;called> then {
doaction <#obj#;called>
}
else {
msg <A nice lady tells you the phone you tried to call is unavailable.>
}
}
end define
define synonyms
end define
define function <realname>
set string <tempname;$parameter(1)$>
set string <realname; >
if exists <#tempname#> then set <realname;#tempname#>
if (#realname#=) then set string <realname;$getobjectname(#tempname#; game)$>
return <#realname#>
end define
define room <hall>
look <The hall.>
west <bar>
end define
define room <bar>
look <The bar.>
east <hall>
define object <Boris>
alias <bartender>
prefix <the>
action <called> {
msg <From the earpiece come Boris's cultured tones - "Naff off I'm busy!">
}
end define
define object <Claudia>
alias <dancer>
prefix <the>
end define
define object <Henry>
action <called> {
msg <From the earpiece comes Henry's high pitced voice - "Oooh, hello sailor!">
}
end define
define object <Jenny>
end define
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end defineI don't understand why you don't just use $getobjectname()$ straight away, instead of using the first if... surely even if the object wasn't alias'ed (or the alias is the objects real name) it would return the objects name anyway
Actions: Actions are script commands that you associate with an object, room or object type. In our "edible" example above we would add an action called "eat" to our object type. We might then add a Custom Command which would accept "eat #@object#", and then its script would run #object#'s "eat" action. This would then allow any edible object to be eaten - and if we needed a particular object to do something special when eaten, we could simply override our default "eat" action from our "edible" type by adding a different "eat" action to our particular object.