Okay, so I’m attempting to make an action that can turn any object with the property ‘fortable’ into a fort. You know, like building a fort with couch cushions? I know I’m not the only one who did that as a kid.
More than just being descriptive, something that is a fort becomes a gateway to another world (A region called ‘Imagination’; but in effect it just moves the player to another room).
I don’t plan on having too many possible forts, so I could hard-code every possible example with it’s own description etc, but I would like the action to be more than just a rule for what can’t be made into a fort. Ideally, all I would have to do to make something into a fort is say “The couch is a supporter. The couch is fortable.”
This is the mess that I have at the moment. First, the action:
[code]
Building a fort is an action with past participle built, applying to one thing.
Understand “build a fort out of [something]” or “build a fort with [something]” or “build a fort from [something]” as building a fort.
A thing can be fortable or unfortable. A thing is usually unfortable.
Check building a fort something: if the noun is unfortable, say “You can’t build a fort out of [the noun].” instead.
Carry out building a fort something: choose a random row in the Table of Fort Descriptions; say “[The noun] has made [comment entry] fort.”; now the noun is unfortable.[/code]
Fairly straight forward, right? All it does at the moment is give the player a random description and change the property of the noun so that it cannot be made into a fort again.
The original plan was that a word would be drawn from the Table of Fort Descriptions and permanently become part of the printed name and description, in addition to being understood by that term as well. Not the random flavor text it is now.
I tried to get the action to add the name of the noun to the table so it could be referenced for every instance of ‘print name’ or ‘print description’ that occurs later, but I couldn’t get it to work.
Here is the aforementioned Table of Fort Descriptions:
Now here is what I have hard-coded for one fortable item, a desk:
[code]A desk is in Defense Solicitor’s Office. The desk is fortable. A concrete block is part of the desk. The plywood boards are part of the desk. Some legal documents are part of the desk.
Understand “concrete blocks” and “concrete” and “blocks” as the concrete block.
Understand “wood” and “plywood” and “boards” as the plywood boards.
Understand “cases” as some legal documents.
After building a fort desk: say “You decide to call it the desk fort.”; now the printed name of the desk is “the desk fort”.
Understand “fort” as the desk.[/code]
Already we see a problem: if somebody says ‘examine fort’ before building the fort desk, it will still print a description of the desk. However, I’m not sure how to fold the Understand statement into the After statement. As it is I want the After statement to be part of the action rules, so that the name would become something like “the cozy desk fort” or “the formidable tree fort”.
Instead of examining the desk: if the desk is unfortable begin; choose a random row from the Table of Fort Descriptions; say "The plywood boards make for very sturdy walls, and the concrete blocks make a fine front step and chimeny. Over all, it is [comment entry] fort."; otherwise; say "The desk is of simple construction, merely plywood boards resting on a few concrete blocks. Covering it is various legal documents, all very important to cases your working on."; end if.
Here, the original purpose of the three objects that are part of the desk was to be parts of the fort. An ideal description would look something like:
“The [part 1] make for [part 1 fort description], and the [part 2] make for [part 2 fort description]. The [part 3] make [part 3 fort description]. Over all, it is [comment entry] fort.”.
In the above example of the desk, the 3rd part (Legal documents) was going to be a cozy nest. These items also serve secondary purposes: the concrete blocks are also containers and the legal documents are for descriptive flavor. (You might also note how I used the fortable/unfortable property to differentiate descriptions between whether or not the desk was a fort yet. This might have to change if a more comprehensive action solution is ever found).
Instead of entering the desk: choose a random row from the Table of Fort Descriptions; say "You climb into the fort, closing it's plywood door behind you. You've built [comment entry] nest in here out of all those boring legal documents. Alone in this dark box, you start to drift off into your imagination..."; move player to Imaginary Office.
Here is another chunk of code that would benefit from not being applicable until after a fort has actually been built. Ideally, this message would be much more simplified and generic. It is only this way right now because it is written specific to the desk fort. A better example might be:
“You climb into the fort, closing its makeshift door behind you. Alone in this dark box, you start to drift off into your imagination…”
Instead of waking up: if the player is enclosed by imagination begin; say "Your imagination is beginning to get hazy. Maybe it's time to give your brain a rest."; move player to Defense Solicitor's Office; otherwise; continue the action; end if.
Understand "leave fort" as waking up.
Again, another hacked together bit of code. It has the happy effect of transporting the player from wherever they have wandered in the Imagination region back to the office, and if not in the imagination region it just prints the standard “This is not a dream” reply. But what it really needs is a more comprehensive ‘move player to location of the fort they used to travel to imagination’. I think this may require some sort of stored value, along with alot of the other code I need.
Overall, my current code is clumsy and in some places downright awful. I may just cut down the total number of possible forts to 3 (one for each main character) but even so it has some work to do before it’s perfect.
Any suggestions would be greatly appreciated!