version 1/120327 by Kevin Norris

  • Home page
  • Beginning
  • Previous
  • Next

  • Section: Defining a new order

    A person is 'obedient' if the obedience rules succeed for them. By default, playable characters are obedient, but other people are not.

    The orders are defined in the table of orders, which by default looks like this:
        Table of Orders
      Order  Printed description  Targeted people    
      null-order  "Do nothing."  Description of people    
      stop  "Stop here for now."  --    
      regroup  "Regroup."  --    
      continue  "Travel as a group."  --    
    Note that the "Targeted people" column is empty. This is necessary for the game to compile (this is bug 889 in Inform; see <>). However, it's more useful when it's filled, so let's look at what the table ought to look like:

        Table of Orders
      Order  Printed description  Targeted people    
      null-order  "Do nothing."  Description of people    
      stop  "Stop here for now."  visible obedient ready to follow other people    
      regroup  "Regroup."  visible obedient other people who are not in the location of the player    
      continue  "Travel as a group."  visible obedient other not ready to follow people who are held by the holder of the player    

    Since we cannot have any non-blank entries in the targeted people column, we insert these entries when play begins. However, this is a little trickier than it sounds, since we must also update the actual order values, so we use a phrase:
        Target (O - an order) at (D - a description of people)
    The Giving an order to rulebook is where most of the logic lies. Write a rule like this:

        Giving an order to someone (called P) when the relevant order is...:

    You can use the outcomes "It is complied with" and "It is not complied with" to indicate what happened (whether the order was successfully followed). You may also use "It is silently ignored" if you need to prevent anything from being printed for this person (e.g. if you've printed something yourself as a special case). Note that you should not be worrying about obedience at this point; the person is already following the order. Instead, you need to worry about whether the action succeeds. In general, you should use "Try silently" (or "Silently try") to make things happen within these rules.
    For finesse and completeness, add reporting rules:
        For printing the failure to comply of someone (called P) when the relevant order is...:
        For printing the compliance list of a list of people (called A) when the relevant order is...:
            Say "[The list of things included by A] obey[list-based s of A]."
    Note that Plurality currently does not support list-like things. So we provide the tokens "[list based s of A]" and "[list based is-are of A]", which behave much like "[is-are]" and "[s]", but for variable numbers of entries. Note that these will behave slightly differently depending on whether or not the american dialect option is active (ambiguously plural things are considered singular in American English but (often) plural in British English, and this extension respects that).

    Also note the rather peculiar circumlocution "[The list of things included by A]". This is mostly because "[A with definite articles]" doesn't capitalize and there's no obvious alternative. A list includes something if the something in question is listed in the list.