New DecisionMaker Functions

 

Boolean:EventHappened(Subject, Verb, DirObject, HowRecently)

This function is used for determining if an event of a certain type has already taken place. The input arguements are the subject, verb, direct object, and how far back the storybuilder desires the search to go. The input arguements for Subject and DirObject can also take the value "Anybody", in which case the function will accept any value in their place. The funtion returns a boolean value, true if the search was successful, false if unsuccessful. Some examples:

 

EventHappened(Mary, Hot_Kiss, Jack, 10)

 

returns true if Mary has Hot_Kiss Jack in the last 10 minutes.

 

EventHappened(ThisSubject, ThisVerb, Jack, 100)

 

returns true if the Subject of this sentence has done the verb of this sentence to Jack in the last 100 minutes.

 

EventHappened(Mary, Hot_Kiss, Anybody, 10)

 

returns true if Mary has done Hot_Kiss to anybody in the last 10 minutes.

 

Event:LookUpEvent(Subject, Verb, DirObject, HowRecently)

This function behaves just like EventHappened, except that it returns the index number of the event; it returns a value of -1 if no such event has ever taken place.

 

Boolean:PrecursorEventHappened(PrecursedEvent, Subject, Verb, DirObject, HowManyStepsBack)

This is rather like EventHappened, except that this time it looks only at the causal thread leading up to PrecursedEvent. That is, it considers only those events that are in the causal chain leading up to the event specified in PrecursedEvent. The arguement HowManyStepsBack specifies how many links in the chain should be examined. This function will terminate automatically if it comes to the end of the causal chain without success. The "Anybody" value can be used here.

 

Event:LookUpPrecursorEvent(PrecursedEvent, Subject, Verb, DirObject, HowManyStepsBack)

This does the same calculation that PrecursorEventHappened does, but it returns the event number of the result, returning a value of -1 if no such event ever took place. This function relates to PrecursorEventHappened just as LookUpEvent relates to EventHappened.

 

Deal functions:

 

Number:DealValueIn1(ForWhom, Event)

This function evaluates the attractiveness of one side of a deal, the side that represents what a character expects to gain from the deal. The function assumes a great many things about the way the deal is structured. The first arguement is the character for whom the deal is being evaluated. The second arguement is the event index of the deal offer or demand. This assumes that the deal is structured with the two traders in the position of Subject and DirObject, and that the deal itself is presented in the various additional objects of the sentence structure. There are two objects of each critical type, labelled CharacterObject1, CharacterObject2, ThingObject1, ThingObject2, and so on. All #1 Objects are what the subject gets out of the deal; all #2 Objects are what the DirObject gets out of the deal. Here's an example of an original deal:

 

Subject Mary

Verb Offer_Deal

DirObject Fred

CharacterObject1 Tom

CharacterObject2

ThingObject1

ThingObject2 Mary's underwear

VerbObject1 Beat_Up

VerbObject2

 

Mary offers Fred her underwear (Fred's kinda kinky) in return for Fred beating up Tom. In deal setups, it is assumed that the subject of any VerbObject is one of the dealing partners.

 

The next task is to evaluate whether

 

I am putting this aside for the time being.