The Help section wrote:For use anything ... and use on anything ..., the game can find out what the other object is by reading the #quest.use.object.name# string variable. This will return the real (unaliased) name of the object.
' "Whack Test"
' Created with QDK Pro 4.02
!include <stdverbs.lib>
define game <Whack Test>
asl-version <400>
gametype singleplayer
start <Mars>
game author <drfroth>
game info <Created with QDK Pro 4.02>
end define
define options
debug on
panes on
end define
define room <Mars>
look <|n|nO.K. Take all of the items (sorry, I did not put in the take all command from the last example). When you have done so, go up to encounter the alien. Try to use everything except the sword on him. When you are ready, use the sword on the Blaxxeroup. (monster, creature, alien also works).|n|nThis will support drag and drop as well as "use fish on monster."|n|nGood Luck>
up <Outer Space>
define object <Fish>
take
prefix <the>
displaytype <Object>
article <it>
gender <it>
end define
define object <Mudpie>
take
prefix <the>
displaytype <Object>
article <it>
gender <it>
end define
define object <Loincloth>
take
prefix <the>
displaytype <Object>
article <it>
gender <it>
end define
define object <Sword>
take
prefix <the>
displaytype <Object>
article <it>
gender <it>
use {
if here <Blaxxeroup> then {
msg <You stab Blaxxeroup right in the mouth and save Mars. Yippie.>
playerwin } else msg <You do not need to use that here.>
}
end define
end define
define room <Outer Space>
look <Blaxxeroup the evil alien hovers above Mars. You must destory him.>
down <Mars>
define object <Blaxxeroup>
alt <monster;alien;beast;creature>
look <Blaxxeroup looks mighty angry. You better do something about this before he destroys Mars.>
take msg <You can only take him out... not take him.>
displaytype <Character>
article <him>
gender <he>
use <Sword> {
msg <You stab Blaxxeroup right in the mouth and save Mars. Yippie.>
playerwin
}
use anything msg <You can not use the #quest.use.object.name#.>
end define
end define
define text <win>
Alright... Hope this helps.
end define
command <use #@object#> if property <#object#; weapon> then {
for each object in <#quest.currentroom#> if property <#quest.thing#; scared> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
show <block>
reveal <block>
}
}
else msg <You use your object or whatever would normally happen.>
end defineDr.Froth wrote:Sometimes the shortcuts we try to code in to keep us from having to copy and paste a few lines of code into several places end up creating more havoc and eating up more time in the end.
command <use #object# on #something#> exec <#quest.originalcommand#; norm>