| 
  • 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
 

More Special Operators

Page history last edited by Bill Maya 15 years, 1 month ago

Bigger, Smaller

 

These are simple Operators; they simply return the bigger or smaller of two BNumbers.

 

PickUpperIf

 

This Operator has three arguments: a Boolean to decide whether or not to pick the upper BNumber, an upper BNumber, and a lower BNumber. Here's a quick example:

 

PickUpperIf of:

   TopGreaterThanBottom(BNumber)

        Nasty_Nice of:

             ThisSubject

        Nasty_Nice of:

             ThisDirObject

   0.5

   0.0

 

This will return a 0.5 if ThisSubject is nicer than ThisDirObject; otherwise, it will return 0.0. This is handy for situations where you must make an abrupt choice between two possibilities based on some yes-or-no factor. It can be used in cases where the author wants one Option to override all the others under a special circumstance. An example of such an Inclination Script might look like this:

 

PickUpperIf of:

   SpecialCircumstance

   Maxi

   Mini

 

(Maxi and Mini are BNumber constants.  Maxi = 0.999 and Mini = -0.999

 

This would insure that the Option was a shoo-in when SpecialCircumstance was true, but otherwise was out of the running.

 

Actor@Sum

 

You can use this Operator to add up the Attribute (or perceived Attribute) values of all the Actors towards one Actor. For example, suppose you want to find out how trusted Joe is by the female Actors.

 

First, go to the Actor Editor and click the far right green plus sign to add a trait. Name the new trait Faithless_Honest. Unclick the check box to the right of the trait. This means the trait is not readily detectable when two Actors meet (an example of a visible/detectable trait would be Short_Tall. An example of an invisible or non-detectable trait would be Cowardly_Courageous). Then return to the Verb editor and choose any Desirable or Inclination script.

Now highlight a BNumber term and then select Actor@Sum from the Actor menu, and fill out the other terms to get this:

 

Actor@Sum of:

   Female of:

        CandidateActor

             PFaithless_Honest of:

        CandidateActor

             Joe

 

This would add up all the female Actors' PFaithless_Honest values towards Joe. Note that the first term, the Boolean, allows you to filter out Actors based on whatever acceptability criteria you choose.

 

Prop@Sum, Stage@Sum, Event@Sum

 

These Operators function for Props, Stages, and Events, respectively, in the same way that Actor@Sum does for Actors.

 

Actor@Average, Prop@Average, Stage@Average, Event@Average

 

These four Operators behave the same way as their ____@Sum counterparts, except that they return the average values of the given Attributes, rather than their totals.

 

Actor@Tally, Prop@Tally, Stage@Tally, Event@Tally

 

These Operators use regular numbers, rather than BNumbers. They count up the number of Actors, Props, Stages, or Events that meet a set of criteria you specify. You can then convert them to BNumbers and use them in your scripts.

Suppose you want to have the ReactingActor make a decision on whether to confront a bully or defer the confrontation based on how many allies he or she has. The inclination script might look something like this:

 

Number2BNumber of:

   Actor@Tally of:

        TopGreaterThanBottom(BNumber)

             PEnemy_Ally of:

                  CandidateActor

                  ReactingActor

            0.2

 

Actor@Tally (we pronounce these operators, by the way, as for instance "ActorTally"that is, with a silent "@"reduces the tongue tangles) in the above script counts the number of Actors whose perception of how allied the ReactingActor is to them (that is, their PEnemy_Ally value for ReactingActor) is at least medium-large (i.e., greater than 0.2), and gives you a numerical count from 0 to the total number of Actors in your storyworld (let's call it 4).

 

Using the Operator Number2BNumber converts this result to a BNumber (all Desirable and Inclination scripts must result in a BNumber). Applying the BNumber magic, 4 allies translates into a willingness to confront the bully of 0.8. Since the BNumber range is about -0.9999 to +0.9999, if you have four allies, 0.8 is pretty high on the scale. A confrontation with the bully is a pretty likely scenario!

 

You might want to tune this script to make it less sensitive to the number of allies. Let's say you want to make it so your Actor will only confront the bully if he or she has lots of allies. To do so, you can divide the Actor@Tally by, say, 10.0. It would look like this:

 

Number2BNumber of:

    quotient of:

Actor@Tally of:

     TopGreaterThanBottom(BNumber)

          PEnemy_Ally of:

               CandidateActor

ReactingActor

          0.2

     10.0

 

It would take a lot more Allies to make ReactingActor confront the bully. If ReactingActor has four allies, this script ends up with 0.29 for Inclination. This script makes a confrontation less likely than the first script above.

 

Play around with different values for the divisor, and watch what happens in Scriptalyzer to the likelihood of this Option being taken (For extra credit, see if you can make the script take into account to the Actor's personal courage. Hint: the ReactingActor's courage affects how many allies he or she will want, in order to feel safe).

 

PickBest___

 

This is one of the most powerful Operators in Sappho. It will pick the best Actor, Prop, Stage, Verb, Event, ActorTrait, PropTrait, StageTrait, MoodTrait, or Quantifier depending upon your specifications. And what are your specifications? Nothing more than the same Acceptable and Desirable subscripts that you use for WordSockets!

 

Here's an example:

 

Suppose we want to pick the Prop that ReactingActor owns that is most lethal. This would be good if ReactingActor is preparing for a fight.

In the Desirable script choose CorrespondingPropTrait, and then for the PropTrait, select PickBestProp under Picking in the Operator menu.  Here's how the script looks:

 

CorrespondingPropTrait of:

   Candidate Prop

        PickBestPropTrait of:

             AreSameActor

                  ReactingActor

                  Owner of:

                       CandidateProp

             Harmless_Lethal of:

                  CandidateProp

 

There will be times when your PickBest___ Operator fails to find anything at all. For example, in the above script, if the ReactingActor doesn't own any Props at all, then PickBestProp will not find anything to return. In this case, PickBestProp will generate Poison that will eliminate the Option from consideration.

 

Next Tutorial: Who's Fate (part 1)

Previous Tutorial: HistoryBook Operators

 


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.