Google Groups Home
Help | Sign in
Multiple actions in one rule?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
scott_mckay  
View profile
 More options Jul 19, 8:21 am
Newsgroups: rec.arts.int-fiction
From: "scott_mckay" <.>
Date: Sat, 19 Jul 2008 07:21:17 -0500
Local: Sat, Jul 19 2008 8:21 am
Subject: Multiple actions in one rule?
I tried this:

Before doing anything other than looking or taking the laptop in the Cabin:
if the laptop is in the Cabin, say "The laptop is still sitting here."

I know why this doesn't compile based on what Inform me. But then what's the
best way to do this? It seems impractical to create multiple rules just to
produce the exact same text. This is a simple case where I'd only have two
rules so no big deal but I'm thinking ahead here I can imagine many
scenarios like this where my use of rules would increase quite a bit. I'm
guessing the answer here is going to be to create a phrase (like "To say
...") but that also seems a bit impractical, leading to lots of phrases that
might differ only in slight details but, in other cases, differ quite a bit.

Is there some _concise_ section of the manual that tells you how and when to
modularize or generalize things?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Emily Short  
View profile
 More options Jul 19, 2:50 pm
Newsgroups: rec.arts.int-fiction
From: Emily Short <emsh...@mindspring.com>
Date: Sat, 19 Jul 2008 11:50:32 -0700 (PDT)
Local: Sat, Jul 19 2008 2:50 pm
Subject: Re: Multiple actions in one rule?
On Jul 19, 1:21 pm, "scott_mckay" <.> wrote:

> I tried this:

> Before doing anything other than looking or taking the laptop in the Cabin:
> if the laptop is in the Cabin, say "The laptop is still sitting here."

> I know why this doesn't compile based on what Inform me. But then what's the
> best way to do this? It seems impractical to create multiple rules just to
> produce the exact same text. This is a simple case where I'd only have two
> rules so no big deal but I'm thinking ahead here I can imagine many
> scenarios like this where my use of rules would increase quite a bit. I'm
> guessing the answer here is going to be to create a phrase (like "To say
> ...") but that also seems a bit impractical, leading to lots of phrases that
> might differ only in slight details but, in other cases, differ quite a bit.
> Is there some _concise_ section of the manual that tells you how and when to
> modularize or generalize things?

There isn't a simple answer to that question, though! (For this
language or for any other I've used.)

I mean, as a general rule, "don't duplicate code" is sensible. Beyond
that, I would add: organize the code in the way which makes it easiest
for you to conceptualize. (This will vary per author.) But it seems
that you already have this instinct.

That handles "when".

The "how" is going to depend quite a bit on what it is you're trying
to generalize, though. Some tips that sound relevant to what you're
doing:

-- If you're likely to be writing a lot of rules about the same set of
acts, try making those actions into a kind. See 7.15, "Kinds of
action". Once you've defined a kind of action, you can use that as
shorthand in future rules.

-- If you're going to be writing prose that is going to vary based on
a single input (e.g., an object that an action is applied to),
consider using a text property for the object that contains the
relevant information, as in

   A thing has some text called the burning description.

   The burning description of a thing is usually "[The item described]
goes up in smoke!"

   Report burning something:
     say "You strike a match and hold it to [the noun]. [burning
description of the noun][paragraph break]".

-- If you're going to be writing prose that is going to vary based on
multiple factors (e.g., the object the action is applied to BUT ALSO
the scene when it is occurring), you may want to consider an activity
instead. Activities are a little more complex to set up, but they
offer the freedom of a whole rulebook in which to express the details
of what you want to write. So for instance

  Describing ignition of something is an activity.
  Rule for describing ignition of something (called the burning item):
    say "[The burning item] goes up in smoke!"

  Rule for describing ignition of something (called the burning item)
when the strong wind is blowing:
    say "[The burning item] sends up a great deal of smoke, which is
carried off by the wind."

  Report burning something:
    carry out the describing ignition activity with the noun.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
scott_mckay  
View profile
 More options Jul 19, 5:34 pm
Newsgroups: rec.arts.int-fiction
From: "scott_mckay" <.>
Date: Sat, 19 Jul 2008 16:34:33 -0500
Local: Sat, Jul 19 2008 5:34 pm
Subject: Re: Multiple actions in one rule?
What you just put here is exactly what I was looking for in the manual. This
is great and it helps me break down my thinking a bit better.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google