| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Enriching the Storyworld

Page history last edited by Bill Maya 15 years ago

Let’s add some Props to this storyworld. We already have two Props that we created earlier: the whiskey bottle and the chair. Let's have Tom and Fred use them as weapons.

 

Start by creating a new Verb, "hit with." For its WordSockets, include 3Actor and 4Prop(in case you're wondering, the numbers in front of the WordSocket terms, in this case 3Actor and 4Prop, tell you in what positions they will show up in Storyteller when someone is playing your storyworld).  Now go back to the Verb "punch" and add "hit with" as an Option to the Rolepunchee. We'll need to specify the Acceptable and Desirable for the two WordSockets. For the DirObjectWordSocket, we'll simply use the same Scripts that we used with the Option "punch:" 

 

DirObject

     Acceptable

          AreSameActor

                ThisSubject

               CandidateActor

    Desirable

    0.0

 

But now we need to write the Acceptable and Desirable Scripts for the 4PropWordSockets. On what basis should an Actor decide which Prop to use?

 

Let's assign one Prop to each of the two Actors: Tom always uses the whiskey bottle and Fred always uses the chair. We do all of this within the Acceptable Script. We'll need to organize this information in a way the Engine will understand. 

 

First, we want to restrict our considerations to Tom and Fred The beginning of our script structure (not the actual Script) will look something like this:

 

Acceptable

     OR (either of the next two situations is acceptable)

          We're considering Tom and the whiskey bottle together

          We're considering Fred and the chair together

 

Let's flesh out the first part, the one for Tom. To logically put two requirements together, we combine them with AND, like so:

 

     AND (both conditions are met)

          AreSameActor

               ReactingActor

               Tom

          AreSameProp

               CandidateProp

               whiskey bottle

 

We'll do the same for Fred and the chair.  Combining these Scripts with the initial decision (which Actor is being considered), our finished Script looks like this:

 

Acceptable

     OR

          AND

               AreSameActor

                    ReactingActor

                    Tom

               AreSameProp

                    CandidateProp

                    whiskey bottle

          AND

               AreSameActor

                    ReactingActor

                    Fred

               AreSameProp

                    CandidateProp

                    chair

 

We don't need to worry about the Desirable Script, because the decision is made by the Acceptable Script.

 

Going back up a level, we need to define the Inclination Script.  How does the ReactingActor choose between punch, run away, and hit with?  We used Anger as the Inclination for punch and the inverse of Anger as the Inclination for run away.  Now it’s time for a new idea: let’s say that ReactingActor never repeats himself. If, the last time around, he punched, then this time around, he should hit with. And if, last time around, he hit with, then this time he should punch.

 

This brings us to one of the really neat features of Storytronics: Actors have memories. They remember what they did in the past and use that memory to shape their future actions. To pull off this trick, you use the HistoryBook (see HistoryBook Operators for full discussion of this feature).

 

We're going to use two new Operators: PickUpperIf and IHaventDoneThisSince. The first is in the Arithmetic menu; the second is in the History menu. 

Make sure "hit with" shows in the Option window, and click on Inclination. The prompt shows 0.0.  Click on the Arithmetic menu and choose PickUpperIf.  You'll see this:

 

PickUpperIf:

     Switcher?

     ValueIfTrue?

     ValueIfFalse?

 

The idea behind PickUpperIf is that sometimes you want to choose between two different numbers depending upon the circumstances. The three arguments can be defined like this:

 

PickUpperIf:

     logical circumstances

     upper number

     lower number

 

If the logical circumstances are TRUE, then it will pick the upper number for the value of Inclination. If the logical circumstances are FALSE, then it will pick the lower number.

 

The logical circumstance, in this case, is whether the ReactingActor has done "this" (this Option, hitting with) in a certain amount of time.  Here's where we use IHaventDoneThisSince.

 

The Switcher? prompt should be highlighted (if it isn't, click on it), then click on the History menu.  Choose IHaventDoneThisSince.  You'll get a prompt, HowLongBack?  Choose NumberConstant and enter 2, for 2 moments.  Here's how our Script looks now:

 

PickUpperIf:

     IHaventDoneThisSince

     2

     ValueIfTrue?

     ValueIfFalse?

 

Now for the numbers.  Let's make the upper number 0.99much bigger than the Inclination for either of the other two Options. And we'll make the lower number -0.99much lower than the Inclination for either of the other two Options. Use the BNumberConstant button to fill in these values. 

 

Inclination

    PickUpperIf:

          IHaventDoneThisSince

          2

          0.99

          -0.99

 

So if the logical circumstances are TRUE, then ReactingActor will definitely choose the hit with Option, but if the logical circumstances are FALSE, then the ReactingActor will choose one of the other Options.  If ReactingActor had indeed used the Verbhit with on his last action, then that would have taken place 1 moment ago (each action takes one game "moment") and would have been caught by IHaventDoneThisSince.

 

There’s one more step: we need to create a Role and Options for the Verb "hit with." Here’s an easy way to do so:

 

We should still be editing the Verb "punch." Look under the main menu option "Edit," and select "Copy Role." This copies the current (and only) Role "punchee" into the clipboard. Next, double-click on the verb "hit with" so that you’re set up to edit that Verb. Select "Paste Role" and voila! A copy of the Rolepunchee has been inserted into the Role list for the Verb "hit with." It has the same Options and Scripts that the original Role had, so it will work exactly like that Role works. Change the name of the Role to "hittee," and we're done.

 

Let’s try out our handiwork. Fire up Storyteller Lizard and see what happens. Notice that Fred always alternates between punch and hit with, while you (as Tom) get to do them in any order you wish. That’s because Inclinations are not used to make decisions for human players. Only the other Scripts affect human players.

 

Next Tutorial: Attributes

Previous Tutorial: Running a Storyworld

 


Creative Commons License  This tutorial by Storytron, Inc. is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

 

Comments (0)

You don't have permission to comment on this page.