' Demonstruction to show hot/cold taps giving warm water.
define game <Hot Cold>
asl-version <400>
gametype singleplayer
start <start>
game version <1a>
game author <Tr0n²>
verb <turn off : turn_off> msg <You can't turn that.>
verb <turn on; turn : turn_on> msg <You can't turn that.>
end define
define room <start>
alias <Bathroom>
prefix <the>
define object <tap>
alias <Taps>
alt <hot tap;cold tap;taps;water;hot water;cold water>
prefix <the>
look {
msg <A pair of decorative handles surround the tap itself..|nYou feel quite pleased that you were able to buy them at half price!>
if not ( #tap:hot##tap:cold# = 00 ) then {
msg <You see |xn>
select case <#tap:hot##tap:cold#> {
case <01> _
msg <cold |xn>
case <11> _
msg <warm |xn>
case <10> _
msg <hot |xn>
}
msg <water flowing from the tap..>
}
else msg <The tap drips softly into the plug hole.>
}
action <turn_on> {
set string <turning.temp; $tap.turn.proc$>
if not ( #turning.temp# = BLANK ) then {
debug <$tap.turn(tap; #turning.temp#; 1)$>
}
}
action <turn_off> {
set string <turning.temp; $tap.turn.proc$>
if not ( #turning.temp# = BLANK ) then {
debug <$tap.turn(tap; #turning.temp#; 0)$>
}
}
properties <hot=0;cold=0>
end define
end define
define function <tap.turn.proc>
' process command to get the command and see if it's hot/cold
' and returns hot/cold/blank
set string <turning.ret; BLANK>
if ( $instr(#quest.command#;hot)$ > 1 ) then _
set string <turning.ret; hot>
if ( $instr(#quest.command#;cold)$ > 1 ) then _
set string <turning.ret; cold>
if ( #turning.ret# = BLANK ) then {
msg <Sorry - do you mean hot or cold water?>
enter <turning.ret>
select case <#turning.ret#> {
case <hot;cold> _
msg <Ok.>
case <warm> {
msg <Do *YOU* have a warm water tap?>
set string <turning.ret; BLANK>
}
case else {
msg <Sorry, a #turning.temp# tap isn't here!>
set string <turning.ret; BLANK>
}
}
}
return <#turning.ret#>
end define
define function <tap.turn>
' usage: $tap.turning(object; <hot/cold>; <1/0>)$
set string <tt.object; $parameter(1)$>
set string <tt.dir; $parameter(2)$>
set numeric <tt.onoff; $parameter(3)$>
if ( %tt.onoff% = 1 ) then _
set string <tt.on.off; on> _
else _
set string <tt.on.off; off>
if ( $objectproperty(#tt.object#; #tt.dir#)$ = %tt.onoff% ) then _
msg <You try to turn it some more, but nothing happens..> _
else {
msg <You turn the #tt.dir# tap #tt.on.off#.>
property <#tt.object#; #tt.dir#=%tt.onoff%>
}
end definedefine object <sinktaps>
alias <Sink Taps>
alt <hot tap;cold tap;taps;sink tap;sink taps;water;hot water;cold water;hot sink tap;cold sink tap>
prefix <the>
look {
msg <A pair of decorative handles surround the tap itself which match the bath..|nYou feel quite pleased that you were able to buy the bath taps at half price with these.>
if not ( #sinktaps:hot##sinktaps:cold# = 00 ) then {
msg <You see |xn>
select case <#sinktaps:hot##sinktaps:cold#> {
case <01> _
msg <cold |xn>
case <11> _
msg <warm |xn>
case <10> _
msg <hot |xn>
}
msg <water flowing from the tap..>
}
else msg <The tap drips softly into the plug hole.>
}
action <turn_on> {
set string <turning.temp; $tap.turn.proc$>
if not ( #turning.temp# = BLANK ) then {
debug <$tap.turn(sinktaps; #turning.temp#; 1)$>
}
}
action <turn_off> {
set string <turning.temp; $tap.turn.proc$>
if not ( #turning.temp# = BLANK ) then {
debug <$tap.turn(sinktaps; #turning.temp#; 0)$>
}
}
properties <hot=0;cold=0>
end define
Sonny wrote:Tron,
I have seemed to run into a problem with the script below.
verb <turn off : turn_off> msg <You can't turn that.>
verb <turn on; turn : turn_on> msg <You can't turn that.>
It seems that because I am using these Verbs above I can no longer turn anything else on. As an example I can turn on a TV or a Radio if I use SWITCH ON or some other configuration but I can not Turn the TV or Radio using the Turn On commands. (I've tried doing basic Turn On and Flag Set etc, but nothing works.)
Quest does support containers now, which should allow you to put objects in, and pull them out of, other objects.A) Do I need to do a custom command to take an object from and object. I can't seem to be able to take and Object from an Object now? (and if I can it doesn't show in the inventory).
In QDK it's "put an object into the players inventory" I believe (something close to, no doubt).B) What Code or script do I use for "Inventory" (like I want to put something into Inventory or remove from the Inventory) and no I'm talking in QDK not the player by typing Pick Up, INV etc