Dynamically Create Objects
Alf
31 Dec 2003, 13:08Another Newbie question:
Can we dynamically create objects?
Example: If the gameplayer sees a tree and has a saw, can he cut down the tree and make lumber? Can he then use the lumber to build a house? Will the lumber and house be objects?
On a totally unrelated note, is the Colossal Cave available for Quest? The first time I played it was on a mainframe a *long* time ago. I'm not sure, but I think the code was COBOL.
Thanks!
Alf
Can we dynamically create objects?
Example: If the gameplayer sees a tree and has a saw, can he cut down the tree and make lumber? Can he then use the lumber to build a house? Will the lumber and house be objects?
On a totally unrelated note, is the Colossal Cave available for Quest? The first time I played it was on a mainframe a *long* time ago. I'm not sure, but I think the code was COBOL.
Thanks!
Alf
Alex
31 Dec 2003, 13:34You can indeed dynamically create objects, using the "create object" command if you're hand-coding ASL, or in QDK with the "Create an object" command in the "Objects" category.
However it might be easy if you just set the "lumber" object up and have it unavailable ("hidden" in ASL). Then it will not appear in the room - just as if it didn't exist. Then, when the player uses the saw on the tree, hide the tree and show the "lumber" object. Voila - you've chopped down the tree!
I'm not aware of any implementations of Colossal Cave, or any other classic adventure games for that matter. I'd be very interested to see it though if someone wants to have a stab at it.
However it might be easy if you just set the "lumber" object up and have it unavailable ("hidden" in ASL). Then it will not appear in the room - just as if it didn't exist. Then, when the player uses the saw on the tree, hide the tree and show the "lumber" object. Voila - you've chopped down the tree!
I'm not aware of any implementations of Colossal Cave, or any other classic adventure games for that matter. I'd be very interested to see it though if someone wants to have a stab at it.
Alf
31 Dec 2003, 13:58Hi, Alex
Thanks for the quick reply! This is another 'trick of the trade' that I'll have to try.
TTFN,
Alf
Thanks for the quick reply! This is another 'trick of the trade' that I'll have to try.
TTFN,
Alf
davidw
31 Dec 2003, 16:26If you want to try your hand at converting Colossal Cave for Quest, the source code can be found at http://www.inform-fiction.org/examples/Advent/Advent_2_com.html. It's in Inform but should be reasonably straightforward (says someone who's never tried it) to convert it to Quest.
Alf
31 Dec 2003, 17:01Hi, David. You're right, the code does look pretty straightforward. That can be one of my spare time (ha ha) projects.
Actually, for a newbie, it would be a good learning experience.
Alf
Actually, for a newbie, it would be a good learning experience.
Alf