New user needs lots of help.
rgaudet
01 Sept 2008, 00:38I just purchased QDK Pro and I'm anxious to get going on it but I'm having some problems. My first problem is how to add points to the game 'score' each time I enter each room for the first time and that time only. I imagine it entails assigning flags, checking them and changing them. Would someone please give me some help with this 

Elexxorine
07 Sept 2008, 18:22ok, the built in feature for helping to do stuff when entering a room for the first time isn't working yet as far as I know, but it's easy to make it yourself. OK as it seems you want this for every room in the game, have the script in a procedure. Make a new procedure and call it whatever you want. In it have an 'if' if property of an object kind. Set the object to '#quest.currentroom#' and the property to something like 'entered', click the 'not' button. In the 'then' put to increment a value. Have the value as 'score' and add 1 or how ever many you want per room. Then put in to set a property of an object, once again the object is '#quest.currentroom#' and use the same property as before. Set up a status variable, numeric, call it 'score'. Next in the settings for scripts to run when you enter a room (should be in game settings/properties), make it run the procedure. If you don't want a room to do this, there's an option in the room settings to over-ride the general rule (it's a tick box or something, not sure).
Hope that helps, if you've any more problems feel free to ask more.
Hope that helps, if you've any more problems feel free to ask more.
rgaudet
13 Sept 2008, 18:39Thanks for the help. I'm starting to understand QDK but still not sure of everything. When I try your solution I get a couple of errors. I'll try it all again from scratch and see what happens. I know it's going to be something simple when I finally get it right. 

Elexxorine
13 Sept 2008, 22:14If it's still not working, post your asl on here. Open notepad and use it to open your .asl file, then copy it here, or add your asl as an attachment.
rgaudet
14 Sept 2008, 20:11Below is the ASL for my game. I got it to add to the score when I enter a room but it adds to the score each time I enter a room instead of just the first time. Thanks, in advance, for the help.
' "The Enchanted Forest"
' Created with QDK Pro 4.03
!include <stdverbs.lib>
define game <The Enchanted Forest>
asl-version <400>
gametype singleplayer
start <Enchanted Forest>
game author <Ron Gaudet>
game version <1.00 (Beta)>
game info <Created with QDK Pro 4.03>
default fontname <Fixedsys>
default fontsize <2>
startscript {
msg <|nThe 'Enchanted Forest' is a very enlarged and modernized version of the first game written for a computer. This game was known as "Adventure" and also as "Colossal Cave". The original game, the associated game creating software and numerous improvements were provided through the hard work and imaginative thinking of Will Crowther, Don Woods, David Platt, David Malmberg, Robert Masenten, David Kinder and many others. These people are certainly the pioneers of all computer gaming. Thanks all.|n|nI hope you enjoy this adventure.|n |nSincerely,|n |n Ron Gaudet|n|n-- Press any key to continue. -- >
wait <>
clear
}
command <>
command <>
verb <>
define variable <score>
type numeric
value <0>
display <score ! out of 1907 points>
end define
define variable <turns>
type numeric
value <0>
display nozero <turns !>
end define
end define
define options
debug on
panes on
abbreviations on
end define
define room <Enchanted Forest>
prefix <the>
look <|nYou are standing in a clearing in a very large forest. Around you is a dense jumble of high, closely-spaced trees and large,thick bushes. There seems to be no direction in which you can travel. However, looks CAN be deceiving for somewhere, nearby, are two huge and complex cave networks where many have found great fortunes in treasure and gold, though it is rumored that some who enter the caves are never seen again. Your goal is to find, enter and explore the caves and to return as much treasure as possible to the safety of the 'pump-house': which you will find in the forest. If the treasure is left any place else above ground, it will surely be stolen by the forest creatures. The caves are dangerous, mysterious and magical places. You will face many puzzling and perilous challanges as you explore them. It is also rumored that the surrounding forest is enchanted and that many strange things happen here. Before trying to enter the caves, you should first explore the forest and try to find anything and everything that may be of help inside these caves.|n|nTo receive more instructions, at any time in the game, about how to explore this area, please type 'help' (upper or lower case) and press the 'Enter' key.|n|nTo begin your quest without further instructions, type 'start' (upper or lower case) and press the 'Enter' key.>
command <start> {
clear
goto <High Hill>
}
end define
define room <High Hill>
look <|nYou are quickly engulfed in a thick cloud of dark green haze from which you are unable to see. You seem to be floating slowly through a long tunnel within the green cloud. After some time, the haze clears and you find yourself standing on a dirt road at the top of a very high hill. Around you spreads the large enchanted forest. From the top of the hill there are narrow paths heading in many different directions. The road leads down the hill and far to the east where you can barely see a small building.>
indescription <You are on the:>
east <End Of The Road>
script {
do <CountRooms>
do <RoomCounted>
}
action <>
end define
define room <End Of The Road>
indescription <You are at the:>
west <High Hill>
script {
do <CountRooms>
do <RoomCounted>
}
end define
define procedure <CountRooms>
if not property <quest.currentroom; entered> then inc <score; 1>
end define
define procedure <RoomCounted>
if not property <"quest.current.room; entered> then property <quest.currentroom; entered>
end define
' "The Enchanted Forest"
' Created with QDK Pro 4.03
!include <stdverbs.lib>
define game <The Enchanted Forest>
asl-version <400>
gametype singleplayer
start <Enchanted Forest>
game author <Ron Gaudet>
game version <1.00 (Beta)>
game info <Created with QDK Pro 4.03>
default fontname <Fixedsys>
default fontsize <2>
startscript {
msg <|nThe 'Enchanted Forest' is a very enlarged and modernized version of the first game written for a computer. This game was known as "Adventure" and also as "Colossal Cave". The original game, the associated game creating software and numerous improvements were provided through the hard work and imaginative thinking of Will Crowther, Don Woods, David Platt, David Malmberg, Robert Masenten, David Kinder and many others. These people are certainly the pioneers of all computer gaming. Thanks all.|n|nI hope you enjoy this adventure.|n |nSincerely,|n |n Ron Gaudet|n|n-- Press any key to continue. -- >
wait <>
clear
}
command <>
command <>
verb <>
define variable <score>
type numeric
value <0>
display <score ! out of 1907 points>
end define
define variable <turns>
type numeric
value <0>
display nozero <turns !>
end define
end define
define options
debug on
panes on
abbreviations on
end define
define room <Enchanted Forest>
prefix <the>
look <|nYou are standing in a clearing in a very large forest. Around you is a dense jumble of high, closely-spaced trees and large,thick bushes. There seems to be no direction in which you can travel. However, looks CAN be deceiving for somewhere, nearby, are two huge and complex cave networks where many have found great fortunes in treasure and gold, though it is rumored that some who enter the caves are never seen again. Your goal is to find, enter and explore the caves and to return as much treasure as possible to the safety of the 'pump-house': which you will find in the forest. If the treasure is left any place else above ground, it will surely be stolen by the forest creatures. The caves are dangerous, mysterious and magical places. You will face many puzzling and perilous challanges as you explore them. It is also rumored that the surrounding forest is enchanted and that many strange things happen here. Before trying to enter the caves, you should first explore the forest and try to find anything and everything that may be of help inside these caves.|n|nTo receive more instructions, at any time in the game, about how to explore this area, please type 'help' (upper or lower case) and press the 'Enter' key.|n|nTo begin your quest without further instructions, type 'start' (upper or lower case) and press the 'Enter' key.>
command <start> {
clear
goto <High Hill>
}
end define
define room <High Hill>
look <|nYou are quickly engulfed in a thick cloud of dark green haze from which you are unable to see. You seem to be floating slowly through a long tunnel within the green cloud. After some time, the haze clears and you find yourself standing on a dirt road at the top of a very high hill. Around you spreads the large enchanted forest. From the top of the hill there are narrow paths heading in many different directions. The road leads down the hill and far to the east where you can barely see a small building.>
indescription <You are on the:>
east <End Of The Road>
script {
do <CountRooms>
do <RoomCounted>
}
action <>
end define
define room <End Of The Road>
indescription <You are at the:>
west <High Hill>
script {
do <CountRooms>
do <RoomCounted>
}
end define
define procedure <CountRooms>
if not property <quest.currentroom; entered> then inc <score; 1>
end define
define procedure <RoomCounted>
if not property <"quest.current.room; entered> then property <quest.currentroom; entered>
end define
Elexxorine
14 Sept 2008, 22:17Repalce:
define procedure <CountRooms>
if not property <quest.currentroom; entered> then inc <score; 1>
end define
define procedure <RoomCounted>
if not property <"quest.current.room; entered> then property <quest.currentroom; entered>
end define
With:define procedure <CountRooms>
if not property <#quest.currentroom#; entered> then inc <score; 1>
end define
define procedure <RoomCounted>
if not property <#quest.current.room#; entered> then property <#quest.currentroom#; entered>
end define
You can put the two procedures into one btw:define procedure <CountRooms>
if not property <#quest.currentroom#; entered> then {
inc <score; 1>
property <#quest.currentroom#; entered>
}
end define
rgaudet
16 Sept 2008, 19:03Well, I was right. The answer was simple. Many thanks! However, I found that using the game's GUI didn't always produce the correct format in the ASL File. I ended up copying your solution directly to the ASl file and then it worked as expected. Curious? This brings on another PIA question. I'm Trying to add a knapsack/pack object ( which will carry other objects) to the game but the GUI gives me no options/tabs to add size or weight carrying limits to the pack for objects that I may try to put into the the pack. These tabs (options) are present in an older QDK game that I looked at. Any ideas out there about what I'm doing wrong or not doing? I'm using QDK Pro (release 4.03). In fact this older game I checked has a lot more tabs and options for objects than are in my release of QDK.
Elexxorine
16 Sept 2008, 22:25It may have been using the Typelib. Which added containers, and such. It's not been updated for Quest 4 as it's now redundant, but you can prolly add it anyway to make up for gaps in Quest and just use the Typelib. Have a search on the internet for it, not sure if there's a link to it here. Also it may have been this one: http://members.aol.com/chaspulliam/cql.html
You can make a container system yourself but best to do it in ASL not QDK.
You can make a container system yourself but best to do it in ASL not QDK.