The new guy is back with yet another problem. This time, my head is somewhat flatter from banging it against the wall. This time I'm going to use reverse logic. I'm going to 'assume' that if you guys show me how to do the easy stuff then I won't have any problems learning the hard stuff.
Here's my present problem. I have a knapsack sitting on a hill. When I pick up the knapsack my game score is supposed to increase by 3 points. But, of course it is not increasing.
Here's the logic I'm using:
When I 'gain' the knapsack I check to see if a flag 'packfound' is not set or on. If it is not on then I increment my game score by 3 points and then I turn on the flag 'packfound'. I've enclosed my code. Could someone be kind enough to help out.
' "The Enchanted Forest"
' Created with QDK Pro 4.03
!include <net.lib>
!include <stdverbs.lib>
!include <standard.lib>
!include <typelib.qlb>
define game <The Enchanted Forest>
asl-version <400>
gametype singleplayer
start <Enchanted Forest>
game author <Ron Gaudet>
game version <1.00 (Beta)>
game copyright <©2008 by Ron Gaudet [Freeware]>
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 that (thanks to QDK) you enjoy what I believe to be the latest and greatest version of this adventure.|n |nSincerely,|n |n Ron Gaudet|n|n-- Press any key to continue. -- >
wait <>
clear
}
afterturn inc <turns>
command <>
command <>
command <>
command <>
verb <>
verb <>
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 menu <Hint>
$Exploring local Area
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 the game areas, type 'help' and press 'enter'. To help solve some of the area's puzzles, please type 'hint' and press the 'Enter' key at any time during the game.|n|nTo begin your quest without further instructions, type 'start' (upper or lower case) and press the 'Enter' key.>
indescription <You are at>
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. As far as you can see, in any direction, the forest is surrounded by very high and steep mountains. From the top of the hill there are narrow paths heading in many different directions but they are all too overgrown to travel down. Your only choice of travel is the road leading down the hill and far to the east where you can barely see a small building.>
indescription <You are at the:>
east <End Of The Road>
down <End Of The Road>
place <the; end of the road>
script do <CountRooms>
action <>
define object <knapsack>
alt <pack; backpack>
look <A knapsack is pack is a backpack. You can put things in it and wear it on your back in order to ease the load you are carrying.>
take
gain {
if not flag <packfound> then
inc <score; 3>
flag on <packfound>
}
speak <You must be kidding me!>
prefix <A>
displaytype <Object>
article <it>
gender <it>
container
open <With the pack open you can use it to carry many more thing.>
close
add
remove
type <wearable>
type <TLTobject>
type <TLTcontainer>
type <TLTcontainer>
type <TLTclosable>
type <TLTcoat>
properties <sizeLimit=100; weightLimit=100; sizeLimit=100; weightLimit=100>
action <>
end define
end define
define room <End Of The Road>
indescription <You are at the:>
west <High Hill>
script do <CountRooms>
end define
define room <inven room>
end define
define procedure <CountRooms>
if not property <#quest.currentroom#; entered> then {
inc <score; 1>
property <#quest.currentroom#; entered>
}
end define