Ruleclass | rules.t[177]

A Rule is an object that defines a set of conditions that need to be met for it to be executed when its RuleBook is run and a method that's executed when its conditions are met. A Rule can be associated with one or more RuleBooks; it starts out in the RuleBook with which it is associated via its + property (i.e. its location). [DEFINED IN RULES EXTENSION]

`class Rule : object`

Superclass Tree (in declaration order)

`Rule`
`object`

Subclass Tree

`Rule`
`AfterRule`
`BeforeRule`
`InitRule`
`PreinitRule`
`ReportRule`
`TurnEndRule`

Global Objects

(none)

Summary of Properties

`action actor aobj dobj during execAfter execBefore iobj isActive location matchObj present priority rulebook rulebooks specificity stopValue where who`

Summary of Methods

`activate addTo calcSpecficity compareTo deactivate follow initializeRule matchConditions moveInto removeFrom runAfter runBefore setRulebook when`

Properties

`// action` Interface description only | `rules.t[756]`

An action, or a list of Actions, one of which (e.g. Take or Jump) must be the current action in order for this Rule to match. [RULES EXTENSION]

`actor` | `rules.t[716]`

The actor to use to compare with the who property of this Rule. This will normally be gPlayerChar, but the value of this property is taken from our RuleBook's actor property. [RULES EXTENSION]

`// aobj` Interface description only | `rules.t[767]`

no description available

`// dobj` Interface description only | `rules.t[765]`

An object (or class), or a list of objects (and or classes) one of which of each the direct, indirect and accessory objects of the current action must match in order for this Rule to match. (The accessory object is only relevant if the TIAAction extension is in use). [RULES EXTENSION]

`// during` Interface description only | `rules.t[750]`

A Scene, or a list of Scenes, one of which much be currently happening for this Rule to match. [RULES EXTENSION]

`execAfter` | `rules.t[258]`

A list of Rules this Rule should specifically run after; this overrides all other ranking. [RULES EXTENSION]

`execBefore` | `rules.t[275]`

A list of Rules this Rule should specifically run before; this overrides all other ranking except for runAfter/execAfter. [RULES EXTENSION]

`// iobj` Interface description only | `rules.t[766]`

no description available

`isActive` | `rules.t[282]`

A Rule is normally active (that is it will normally be considered when a RuleBook is being followed) but it can be temporarily disabled by setting its isActive property to nil. [RULES EXTENSION]

`location` | `rules.t[183]`

Our location is the RuleBook with which we start out being associated. Normally this will be defined by locating a Rule inside its RukeBook using the + notation. [RULES EXTENSION]

`// matchObj` Interface description only | `rules.t[775]`

An object, class, or other value, or a list of objects and/or classes or of other values, one of which must match the matchObj property of our rulebook (which is set by the first parameter of a call to that RuleBooks's follow() method) for this Rule to match. [RULES EXTENSION]

`// present` Interface description only | `rules.t[786]`

An object in the presence of which the actor must be for this rule to match. Presence normally means in the same room, but if this property is defined as a list and the first item in the list is a property pointer (&canSee, &canHear, &canReach, &canSmell), this property will be used to test for tne appropriate sense connection between the actor and at least one of the other items in the list instead. [RULES EXTENSION]

`priority` | `rules.t[234]`

The priority of this Rule. This can be used to alter the order in which this Rule is considered in its RuleBook. If two Rules have different priorities they will be run in priority order, highest priority first. The default value is 100. [RULES EXTENSION]

`rulebook` | `rules.t[191]`

The rulebook that's currently considering us. Normally this will be our location, but it could be a different RuleBook if we belong to one. Note that this property is automatically set by the library and so it should never need to be altered by game code. [RULES EXTENSION]

`rulebooks` | `rules.t[201]`

A list of all the rulebooks this rule is currently associated with. [RULES EXTENSION]

`specificity` | `rules.t[242]`

Where two Rules have the same priority, the one with the more specific conditions is taken first. The specificity property holds a measure of the Rule's specificity which is calculated by the calcSpecificity() method at PreInit. [RULES EXTENSION]

`stopValue` | `rules.t[709]`

The value this rule should return when the stop macro is used at the end of its follow method. By default we use our rulebook's stopValue. [RULES EXTENSION]

`// where` Interface description only | `rules.t[730]`

A Room or Region, or a list of Rooms and/or Regions in which our actor (usually either gActor or gPlayerChar - the latter by default - must be for this Rule to match. [RULES EXTENSION]

`// who` Interface description only | `rules.t[744]`

An actor, or a list of actors, one of whom must be performing the current action for this Rule to match. [RULES EXTENSION]

Methods

`activate ( )` | `rules.t[285]`

Make this Rule active [RULES EXTENSION]

`addTo (rb)` | `rules.t[649]`

Add this rule to another rulebook [RULES EXTENSION]

`calcSpecficity ( )` | `rules.t[297]`

Calculate the specificity of this Rule. The principles are (a) Rules that specify more conditions are more specific than Rule that specify fewer condition; (b) conditions involving specific objects are more specific that those relating to classes and (c) Rooms are more specific than Regions in a where condition. [RULES EXTENSION]

`compareTo (other)` | `rules.t[417]`

Get the processing priority sorting order relative to another Rule. [RULES EXTENSION]

`deactivate ( )` | `rules.t[288]`

Make this Rule inactive [RULES EXTENSION]

`follow ([args])` | `rules.t[224]`

Do whatever this Rule needs to do when its conditions are met. This method will need to be defined on each individual Rule in game code. [RULES EXTENSION]

`initializeRule ( )` | `rules.t[208]`

Initialize this Rule by adding it to the contents list of its location and calculating its specificity (i.e. how specific its conditions are) [RULES EXTENSION]

`matchConditions ( )` | `rules.t[464]`

Check whether a Rule matches its where, when, who and during conditions. [RULES EXTENSION]

`moveInto (rb)` | `rules.t[676]`

Move this rule to another rulebook, removing it from all its current rulebooks. If rb is nil, simply remove this Rule from its current rulebooks. [RULES EXTENSION]

`removeFrom (rb)` | `rules.t[659]`

Remove this rule from a rulebook [RULES EXTENSION]

`runAfter (other)` | `rules.t[249]`

Return true if this Rule should always execute after other (despite all other ranking criteria). By default we return true if and only if other is in our execAfter list. [RULES EXTENSION]

`runBefore (other)` | `rules.t[265]`

Return true if this Rule should always execute before other (despite all other ranking criteria). By default we return true if and only if other is in our execBefore list. [RULES EXTENSION]

`setRulebook (r)` | `rules.t[198]`

Set our current rulebook to r. Note that this method is normally called by the Rulebook that's running us, and shouldn't normally be used by game code. [RULES EXTENSION]

`// when ( )`Interface description only | `rules.t[738]`

A condition that must hold (or a method returning a Boolean value to determine whether or not appropriate conditions hold) for this Rule to match. This is only needed if none of the other properties in this section provide a way of speficifying the required conditions.

Adv3Lite Library Reference Manual
Generated on 12/12/2022 from adv3Lite version 1.6