object type action - make object unusable
James2
04 May 2006, 18:56Tying to get object type actions to work:-
which makes object unusable when 'coin' used on slot
Any thoughts ?
James
' "object type action test"
' Created with QDK 3.53 - UNREGISTERED VERSION
define game <object type action test>
asl-version <350>
gametype singleplayer
start <one room>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
startscript {
property <penny; value=1>
property <10p; value=10>
}
end define
define type <coin>
value
action <use in slot> msg <putting #object# in slot>
end define
define synonyms
end define
define room <one room>
look <take penny/10p then use on slot (both are object type coin)|n|nget |n You can't use that here. !!!!|n|nwhich appears to be object unusable ???|n>
define object <slot>
look <a slot machine needs 10p>
end define
define object <penny>
take
type <coin>
end define
define object <10p>
take
type <coin>
end define
end define
which makes object unusable when 'coin' used on slot
Any thoughts ?
James
Cryophile
05 May 2006, 18:13define type <coin>
value
action <use in slot> msg <putting #object# in slot>
end define
"use in slot"?
In order to use "use in slot" or "use on slot", or whatever it should be, you would need a global command to do so. Try this:
command <use #@coin# on slot> doaction <#coin#; use in slot>
for the example above of the "use in slot" action.
James2
05 May 2006, 20:31Thanks for the info, that works
What should the 'action' in the coin type def be if I wish to impliment the player 'using' the coin on the slot (ie doing it graphically in the i/f) ?
What should the 'action' in the coin type def be if I wish to impliment the player 'using' the coin on the slot (ie doing it graphically in the i/f) ?
paul_one
05 May 2006, 23:23I don't think there's any difference with using the drag and drog graphical way to normal text typing.
James2
06 May 2006, 18:55fair enough, but what would I type in as the object type action name so that it will be performed when the graphical (or manual) 'use' command is given. I've tried the command form 'use #@coin# on slot' (and various other conbinations) as the action name but nothing seams to work.
Arbutus
07 May 2006, 20:00
' "object type action test"
' Created with QDK Pro 3.53
define game <object type action test>
asl-version <350>
gametype singleplayer
start <one room>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
startscript {
property <penny; value=1>
property <10p; value=10>
}
command <use #@coin# on slot> if type <#coin#; coin> then doaction <#coin#; use> else msg <You cannot use the #@coin# in the slot.>
end define
define type <coin>
value
action <use> msg <putting $thisobject$ in slot>
end define
define synonyms
end define
define room <one room>
look <Take the penny or 10p, then 'use' or 'use it on slot'. Both are object of type 'coin'. Slug is not of the type coin so it does not work on the slot.>
define object <slot>
look <a slot machine needs 10p>
end define
define object <penny>
take
type <coin>
end define
define object <10p>
take
type <coin>
end define
define object <slug>
take
end define
end define
James2
07 May 2006, 21:01thanks, that an another idea of solving the problem & you've included a check.
Arbutus
08 May 2006, 19:21And if you want to make the coin unusable after it is used, then:
HIDE: makes an object invisible and inaccessible to the player.
define type <coin>
value
action <use> {
msg <You put the $thisobject$ in the slot.>
hide <$thisobject$>
msg <Machine does something.>
}
end define
HIDE: makes an object invisible and inaccessible to the player.