define object <desk>
alt <drawer>
examine <A good solid wooden desk - none of your Ikea stuff!!>
prefix <the>
article <it>
gender <it>
type <TLTcontainer>
type <TLTcontainer>
type <TLTclosable>
properties <listHeader=In the drawer you find; closedDesc=The desk drawer is closed; isOpenDesc=The desk drawer is open.>
action <desk_open> if not property <desk; #&closed#> then msg <In the desk drawer you see a tattered and rather mildewed copy of a computer manual.>
end define
define object <manual>
take {
msg <You now possess a tattered and rather mildewed copy of a computer manual.>
give <manual>
}
type <TLTreadable>
type <TLTcontainable>
properties <isIn=desk>
end define
' "Game Name"
' Created with QDK Pro 3.52
!include <Typelib.qlb>
define game <Game Name>
asl-version <350>
gametype singleplayer
start <Start Room>
game author <Your Name>
game version <1.0>
game copyright <© 2004 ...>
game info <Enter any additional information about this game here.>
end define
define synonyms
end define
define room <Start Room>
look <Description Goes Here>
define object <desk>
alt <drawer>
examine <A good solid wooden desk - none of your Ikea stuff!!>
prefix <the>
article <it>
gender <it>
type <TLTcontainer>
type <TLTclosable>
properties <listHeader=In the drawer you find; closedDesc=The desk drawer is closed; isOpenDesc=The desk drawer is open.>
action <desk_open> if not property <desk; #&closed#> then msg <In the desk drawer you see a tattered and rather mildewed copy of a computer manual.>
end define
define object <manual>
type <TLTobject>
type <TLTreadable>
type <TLTcontainable>
properties <isIn=desk>
action <take> {
msg <You now posess a rather tattered and mildewed copy of a computer manual.>
give <manual>
}
end define
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 defineI've had the same problem in my first game that I'm currently writing (and planning to release). Why should we have to write a custom command just to pick up objects that we want to have other scripts with. That's pointless. I know how to write a custom command, but I don't think that we should have to!
here's the code you offered re-written as an action - try it and you'll see it works as required.
While on the subject of closeables, I was wondering how to deal with a door. I assume the same door has to be defined in both rooms since it exists in both so if it's opened in one room it has to be opened in the other etc.?
' "door example"
' Created with QDK Pro 3.52
!include <Typelib.qlb>
define game <door example>
asl-version <350>
gametype singleplayer
start <hallway>
game author <Al (MaDbRiT)>
game info <Created with QDK Pro 3.52>
end define
define synonyms
end define
define room <hallway>
prefix <the>
define object <halldoor>
alias <door>
alt <door>
type <TLTclosable>
action <opened> {
create exit north <hallway; lounge>
create exit south <lounge; hallway>
property <loungedoor; not closed>
}
action <closed> {
create exit north <hallway; >
create exit south <lounge; >
property <loungedoor; closed>
}
end define
end define
define room <lounge>
prefix <the>
define object <loungedoor>
alias <door>
alt <door>
type <TLTclosable>
action <opened> {
create exit north <hallway; lounge>
create exit south <lounge; hallway>
property <halldoor; not closed>
}
action <closed> {
create exit north <hallway; >
create exit south <lounge; >
property <halldoor; closed>
}
end define
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end defineThat's all well and fine Al, but how to write an alternitive script?
define room <East End of Corridor>
west <Long Corridor>
description <You are at the east end of the long corridor.|nThere is a desk here.>
define object <desk>
alt <drawer; desk drawer>
look <A good solid wooden desk - none of your Ikea stuff!!>
examine <A good solid wooden desk - none of your Ikea stuff!!>
prefix <the>
article <it>
gender <it>
type <TLTcontainer>
type <TLTclosable>
properties <listHeader=In the drawer you find; closedDesc=The desk drawer is closed; isOpenDesc=The desk drawer is open.>
action <desk_open> if not property <desk; #&closed#> then msg <In the desk drawer you see a tattered and rather mildewed copy of a computer manual.>
end define
define object <manual>
type <TLTobject>
type <TLTreadable>
type <TLTcontainable>
properties <isIn=desk>
action <take> {
msg <You now posess a rather tattered and mildewed copy of a computer manual.>
give <manual>
}
end define
end define
Just on your email address -you told me to email you about something a week ago. I did, and got no reply!
Anonymous wrote:To get a normally takeable object you just need to click the 'regular object' check box under typelib's 'Basics' tab. If however you want to do something else (like print your custom message) the trick is to write a replacement 'take' action for the object - and thus override typelib's default take action.
I finally got started messing around with containables and containers and I too, am having the problem where the game does not see the object once it's placed in something else. I clicked the 'regular object' box but there seems to be no change.
I'm practicing in a test game format where it's not really a game. I have a room full of scripts and objects that are there for practice purposes only. In this room, I have a containable car and a frog. I can put the frog in the car. I can see the frog in the car but even after the 'regular object' box is checked, I continue to get the same response that the game cannot see it anywhere.
Do I have to break down and actually do some coding or can I manipulate it in QDK?
' Created with QDK Pro 3.52
!include <Typelib.qlb>
define game <>
asl-version <350>
gametype singleplayer
start <start>
game info <Created with QDK Pro 3.52>
end define
define synonyms
end define
define room <start>
look <start room>
define object <car>
type <TLTcontainer>
properties <not takeable>
end define
define object <frog>
type <TLTobject>
type <TLTcontainable>
end define
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define