Can't 'wear' anything
rgaudet
17 Sept 2008, 19:01Well, the new guy with lots of questions is back. I have created a knapsack/pack that I want to wear and which will allow me to store other objects in it. I can get the pack and drop it but when I say 'wear the pack', I'm told that I cannot wear the pack. Also, sometimes (depending on how I set up things), it will allow me to wear the pack but will not let me drop the pack unless I first 'take off the pack', which it won't allow me to do. I really need someone to tell me how I go about doing these things. I have included 'typelib.qlb' into my ASL file but it doesn't seem to help things.
In short, I want to be able to get the pack, drop the pack, wear the pack and not wear 'take off' the pack.Help

In short, I want to be able to get the pack, drop the pack, wear the pack and not wear 'take off' the pack.Help




Thanatos
19 Sept 2008, 01:56Isnt wearing the pack a bit excessive? Isn't simply having the pack good enough?
davidw
19 Sept 2008, 06:02It's a perfectly reasonable thing to do, Thanatos. Wearing an item is one of the basic things that all IF systems should be able to do.
Elexxorine
19 Sept 2008, 10:27Attach your asl file to a post so we can see what you've done.
rgaudet
20 Sept 2008, 23:09Here's my code. Saw a post that said to use the topcoat as a knapsack but not sure exactly how to do that. You will find some unfinished stuff at the end of this stuff that I've been playing with (generating a random number and using a help/hint system).
' "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 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
}
command <wear knapsack> add <knapsack; player>
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 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.>
indescription <You are at the:>
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 at the:>
east <End Of The Road>
script do <CountRooms>
action <>
end define
define room <End Of The Road>
indescription <You are at the:>
south <inven room>
west <High Hill>
script do <CountRooms>
define object <coat>
take
displaytype <Object>
article <it>
gender <it>
container
type <TLTobject>
type <TLTcontainer>
type <TLTcontainer>
type <TLTclosable>
type <TLTcoat>
properties <sizeLimit=100; weightLimit=100; sizeLimit=100; weightLimit=100>
end define
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
define function <random1>
end define
define selection <hint>
info <Hints>
choice <&AREA>
end define
' "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 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
}
command <wear knapsack> add <knapsack; player>
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 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.>
indescription <You are at the:>
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 at the:>
east <End Of The Road>
script do <CountRooms>
action <>
end define
define room <End Of The Road>
indescription <You are at the:>
south <inven room>
west <High Hill>
script do <CountRooms>
define object <coat>
take
displaytype <Object>
article <it>
gender <it>
container
type <TLTobject>
type <TLTcontainer>
type <TLTcontainer>
type <TLTclosable>
type <TLTcoat>
properties <sizeLimit=100; weightLimit=100; sizeLimit=100; weightLimit=100>
end define
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
define function <random1>
end define
define selection <hint>
info <Hints>
choice <&AREA>
end define

Thanatos
22 Sept 2008, 04:06Next time put [code*] and [/code*] before and after the code, minus the *
Elexxorine
22 Sept 2008, 17:00There is no 'knapsack' defined for a start.
rgaudet
23 Sept 2008, 00:32I finally can do what ever I want with my knapsack/pack but don't ask me how or what I Did. This is just as well because I have no idea what Thanatos was telling me to do. But, I have an excuse. I am seventy years of age(and proud of it) and haven't done any programming of any type for quite some time. So, here's another question for those of you out there who know what you're doing. How do I create and implement a function that will return a random number which is between the two numbers I submit to the function

P.S. Thanatos, could you explain your statement more precisely so that even I can understand it?


P.S. Thanatos, could you explain your statement more precisely so that even I can understand it?


Thanatos
23 Sept 2008, 01:35Erm, ok. Observe:
If you do that, you wont fill up the page with massive posts. Instead it will appear in that little scroll box. All you have to do is type
[code*] and put the code in the middle of those two. Just don't add in the *. I have to put it in otherwise it would just turn out as an empty code box.
Lalalalalala
If you do that, you wont fill up the page with massive posts. Instead it will appear in that little scroll box. All you have to do is type
[code*] and put the code in the middle of those two. Just don't add in the *. I have to put it in otherwise it would just turn out as an empty code box.
Elexxorine
23 Sept 2008, 11:29The function 'rand' returns a random number. '$rand(1;3)$' will return 1, 2, or 3 randomly. Type it with '$' and all in a 'set a variable' (think that's what it's called). This information is also given in the help files that come with quest and the online version here