|
Drag[en]gine Script Module DragonScript 1.35
|
Base actor AI. More...
Classes | |
| class | Factory |
| Factory for loading actor ai. More... | |
Public Member Functions | |
| void | actionFailed () |
| Action failed. | |
| void | actionFinished () |
| Action finished successfully. | |
| void | activate (BehaviorElement actor) |
| AI has been set as active AI in an actor. | |
| void | activateWhileLoading (BehaviorElement actor) |
| AI has been set as active AI in an actor while loading. | |
| void | collision (Collider owner, CollisionInfo info) |
| Collision detected. | |
| void | deactivate () |
| Action has been unset as active action in an actor. | |
| void | dispose () |
| Dispose of base actor ai. | |
| void | enterConversation () |
| Actor has been added to a conversation playback. | |
| void | enteredGameWorld () |
| Actor entered game world. | |
| void | enterFrame () |
| Actor has been added to game world and enterFrame() is called once. | |
| BehaviorElement | getActor () |
| Actor owning the action or null. | |
| ECBehaviorActorAIAction.Instance | getAIAction () |
| Behavior actor ai-action or null. | |
| ECBehaviorPlayerControllable.Instance | getPlayerControllable () |
| Behavior player controllable or null. | |
| bool | isActive () |
| AI is active actor AI. | |
| bool | isControlledByPlayer () |
| Actor is controlled by player. | |
| bool | isNotActive () |
| AI is not active actor AI. | |
| void | leaveConversation () |
| Actor has been removed from a conversation playback. | |
| void | leftGameWorld () |
| Actor left game world. | |
| void | log (Console console, Element element, String text) |
| Log text about element to console prefixed with actor information. | |
| void | log (Console console, Exception exception) |
| Log exception to console prefixed with actor information. | |
| void | log (Console console, String text) |
| Log text to console prefixed with actor information. | |
| void | log (Element element, String text) |
| Log text about element to BaseGameApp console prefixed with actor information. | |
| void | log (Exception exception) |
| Log exception to BaseGameApp console prefixed with actor information. | |
| void | log (String text) |
| Log text to BaseGameApp console prefixed with actor information. | |
| String | loggingPrefix () |
| Logging prefix. | |
| BaseActorAI | new () |
| Create base actor ai. | |
| String | persistencyFactoryName () |
| Name of PersistencyFactory required to load object from file. | |
| void | playerReleasesControl () |
| Player released control of actor. | |
| void | playerTakesControl () |
| Player takes control of actor. | |
| void | think (float elapsed) |
| Thinking. | |
| void | writeObjectToFile (PersistencyEnvironment env, FileWriter writer) |
| Write object to file writer. | |
Protected Member Functions | |
| void | initBehaviors () |
| Init behaviors. | |
Protected Attributes | |
| BehaviorElement | actor |
| Actor the action is assigned to or null. | |
| ECBehaviorActorAIAction.Instance | aiAction |
| Behavior actor ai-action or null. | |
| ECBehaviorPlayerControllable.Instance | playerControllable |
| Behavior player controllable or null. | |
Base actor AI.
Action supports the Persistable interface an can be read from and writen to file writers.
| void Dragengine.Scenery.BaseActorAI.actionFailed | ( | ) |
| void Dragengine.Scenery.BaseActorAI.actionFinished | ( | ) |
Action finished successfully.
Referenced by collision().
| void Dragengine.Scenery.BaseActorAI.activate | ( | BehaviorElement | actor | ) |
AI has been set as active AI in an actor.
Calls these hook methods:
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References aiAction, and isActive().
Referenced by playerReleasesControl().
| void Dragengine.Scenery.BaseActorAI.activateWhileLoading | ( | BehaviorElement | actor | ) |
AI has been set as active AI in an actor while loading.
Similar to activate(BehaviorElement) but only stores the actor and calls initBehaviors(). This is required since while loading behaviors load their state and AIs load their states. If activate(BehaviorElement) is called these states would be reset to initial values.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References aiAction, and isNotActive().
Referenced by actionFailed().
| void Dragengine.Scenery.BaseActorAI.collision | ( | Collider | owner, |
| CollisionInfo | info ) |
Collision detected.
Action does collision response and changes the parameters of owner. AI is only notified about the collision and should not interfere with collision response.
References actionFailed(), and actionFinished().
Referenced by loggingPrefix().
| void Dragengine.Scenery.BaseActorAI.deactivate | ( | ) |
Action has been unset as active action in an actor.
Referenced by leftGameWorld().
| void Dragengine.Scenery.BaseActorAI.dispose | ( | ) |
Dispose of base actor ai.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References new().
Referenced by getPlayerControllable().
| void Dragengine.Scenery.BaseActorAI.enterConversation | ( | ) |
Actor has been added to a conversation playback.
References playerReleasesControl().
Referenced by log().
| void Dragengine.Scenery.BaseActorAI.enteredGameWorld | ( | ) |
| void Dragengine.Scenery.BaseActorAI.enterFrame | ( | ) |
Actor has been added to game world and enterFrame() is called once.
References playerTakesControl().
Referenced by log().
| BehaviorElement Dragengine.Scenery.BaseActorAI.getActor | ( | ) |
Actor owning the action or null.
Referenced by Dragengine.Scenery.BAAIBehaviorTree.dispose(), isControlledByPlayer(), and Dragengine.Scenery.BAAIBehaviorTree.new().
| ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActorAI.getAIAction | ( | ) |
Behavior actor ai-action or null.
Referenced by isActive(), and writeObjectToFile().
| ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActorAI.getPlayerControllable | ( | ) |
Behavior player controllable or null.
References actor, and dispose().
Referenced by isActive(), and persistencyFactoryName().
|
protected |
Init behaviors.
Retrieve and store required and optional behavior instances from the actor element.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References enteredGameWorld().
Referenced by enteredGameWorld(), loggingPrefix(), and think().
| bool Dragengine.Scenery.BaseActorAI.isActive | ( | ) |
AI is active actor AI.
References getAIAction(), getPlayerControllable(), and playerControllable.
Referenced by activate(), and Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile().
| bool Dragengine.Scenery.BaseActorAI.isControlledByPlayer | ( | ) |
Actor is controlled by player.
References actor, and getActor().
Referenced by isNotActive(), and Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile().
| bool Dragengine.Scenery.BaseActorAI.isNotActive | ( | ) |
AI is not active actor AI.
References aiAction, isControlledByPlayer(), and playerControllable.
Referenced by activateWhileLoading().
| void Dragengine.Scenery.BaseActorAI.leaveConversation | ( | ) |
| void Dragengine.Scenery.BaseActorAI.leftGameWorld | ( | ) |
Log text about element to console prefixed with actor information.
References enterConversation().
| void Dragengine.Scenery.BaseActorAI.log | ( | Console | console, |
| Exception | exception ) |
Log exception to console prefixed with actor information.
References leaveConversation().
| void Dragengine.Scenery.BaseActorAI.log | ( | Console | console, |
| String | text ) |
Log text to console prefixed with actor information.
References enterFrame().
| void Dragengine.Scenery.BaseActorAI.log | ( | Element | element, |
| String | text ) |
Log text about element to BaseGameApp console prefixed with actor information.
| void Dragengine.Scenery.BaseActorAI.log | ( | Exception | exception | ) |
Log exception to BaseGameApp console prefixed with actor information.
| void Dragengine.Scenery.BaseActorAI.log | ( | String | text | ) |
Log text to BaseGameApp console prefixed with actor information.
References leftGameWorld().
Referenced by Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile(), and writeObjectToFile().
| String Dragengine.Scenery.BaseActorAI.loggingPrefix | ( | ) |
Logging prefix.
Returns string in the form "<actor-class>/<ai-class>" or "null/<ai-class>" if deactivated or disposed.
References collision(), and initBehaviors().
Referenced by writeObjectToFile().
| BaseActorAI Dragengine.Scenery.BaseActorAI.new | ( | ) |
Create base actor ai.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References aiAction.
Referenced by dispose().
| String Dragengine.Scenery.BaseActorAI.persistencyFactoryName | ( | ) |
Name of PersistencyFactory required to load object from file.
Name of PersistencyFactory is first written to the file as string with 8-bit length. Then writeToFile() is called to write the object itself. Empty name is not allowed as is names longer than 255 characters. Name has to match a PersistencyFactory present in the Persistency instance used for loading objects. Object is read using PersistencyFactory.readObjectFromFile() of the matching PersistencyFactory.
Implements Dragengine.LoadSave.Persistable.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References actor, getPlayerControllable(), and playerControllable.
Referenced by writeObjectToFile().
| void Dragengine.Scenery.BaseActorAI.playerReleasesControl | ( | ) |
| void Dragengine.Scenery.BaseActorAI.playerTakesControl | ( | ) |
Player takes control of actor.
Referenced by enterFrame().
| void Dragengine.Scenery.BaseActorAI.think | ( | float | elapsed | ) |
Thinking.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References actor, and initBehaviors().
Referenced by leaveConversation().
| void Dragengine.Scenery.BaseActorAI.writeObjectToFile | ( | PersistencyEnvironment | env, |
| FileWriter | writer ) |
Write object to file writer.
Implements Dragengine.LoadSave.Persistable.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
References actor, aiAction, getAIAction(), log(), loggingPrefix(), persistencyFactoryName(), playerControllable, and writeObjectToFile().
Referenced by writeObjectToFile().
|
protected |
Actor the action is assigned to or null.
Referenced by actionFailed(), getPlayerControllable(), isControlledByPlayer(), leftGameWorld(), persistencyFactoryName(), think(), Dragengine.Scenery.BAAIBehaviorTree.writeObjectToFile(), and writeObjectToFile().
|
protected |
Behavior actor ai-action or null.
Referenced by activate(), activateWhileLoading(), isNotActive(), new(), and writeObjectToFile().
|
protected |
Behavior player controllable or null.
Referenced by isActive(), isNotActive(), persistencyFactoryName(), and writeObjectToFile().