Difference between revisions of "LogicIntro"

(New page: Uru game logic is scene-object oriented. On each scene object, there can be multiple modifiers assigned. These modifiers can generally be divided into a number of categories: * '''Action...)
 
Line 1: Line 1:
Uru game logic is scene-object oriented.
+
=Game Logic=
 +
In uru game logic is scene-object oriented.
  
On each scene object, there can be multiple modifiers assigned. These modifiers can generally be divided into a number of categories:
+
On each scene object, there can be multiple modifiers assigned. These modifiers can generally be divided into two categories:
  
* '''Actions and Responders'''
+
* '''actions''' - Actions and Responders
 
*: These are responsible for linking actions to these objects.
 
*: These are responsible for linking actions to these objects.
* '''Triggers and Conditionals'''
+
* '''modifiers''' - Modifiers, Triggers and Conditionals
 
*: These react to events in the object, or to messages from other objects, and can tell an action to start its performance.
 
*: These react to events in the object, or to messages from other objects, and can tell an action to start its performance.
 +
*: The basic class in this group is the '''Logic Modifier''' - it is the base class that is used to trigger actions.
  
[Continued]
+
In PyPRP, these are grouped as '''actions''' and '''modifiers'''.<br/>
 +
 
 +
PyPRP uses an AlcScript to describe these objects. Basically the setup is like this:
 +
 
 +
<object name>:
 +
    logic:
 +
        modifiers:
 +
            # a list of subscripts that describe the attached modifiers
 +
 
 +
        actions:
 +
            # a list of subscripts that describe attached actions
 +
 
 +
It is not always necessary to describe both.<br/>
 +
for example in order to link scene objects to SDL python, it is sufficient to have only a '''.logic.actions''' subscript, that contains a python file mod referencing an SDL file.
 +
 
 +
Also, for OneShot animations, the action can be defined on one object, while the modifier that triggers it is located on another object.
 +
 
 +
We will go into these in more detail, starting at the logic modifiers.

Revision as of 14:18, 4 February 2008

Game Logic

In uru game logic is scene-object oriented.

On each scene object, there can be multiple modifiers assigned. These modifiers can generally be divided into two categories:

  • actions - Actions and Responders
    These are responsible for linking actions to these objects.
  • modifiers - Modifiers, Triggers and Conditionals
    These react to events in the object, or to messages from other objects, and can tell an action to start its performance.
    The basic class in this group is the Logic Modifier - it is the base class that is used to trigger actions.

In PyPRP, these are grouped as actions and modifiers.

PyPRP uses an AlcScript to describe these objects. Basically the setup is like this:

<object name>:
    logic:
        modifiers:
            # a list of subscripts that describe the attached modifiers
        actions:
            # a list of subscripts that describe attached actions

It is not always necessary to describe both.
for example in order to link scene objects to SDL python, it is sufficient to have only a .logic.actions subscript, that contains a python file mod referencing an SDL file.

Also, for OneShot animations, the action can be defined on one object, while the modifier that triggers it is located on another object.

We will go into these in more detail, starting at the logic modifiers.