Drag[en]gine Script Module DragonScript
1.23
|
Base actor AI. More...
Classes | |
class | Factory |
Factory for loading actor ai. More... | |
Public Member Functions | |
void | actionFailed () |
Action failed. More... | |
void | actionFinished () |
Action finished successfully. More... | |
void | activate (BehaviorElement actor) |
AI has been set as active AI in an actor. More... | |
void | activateWhileLoading (BehaviorElement actor) |
AI has been set as active AI in an actor while loading. More... | |
void | collision (Collider owner, CollisionInfo info) |
Collision detected. More... | |
void | deactivate () |
Action has been unset as active action in an actor. More... | |
void | dispose () |
Dispose of base actor ai. More... | |
void | enterConversation () |
Actor has been added to a conversation playback. More... | |
void | enteredGameWorld () |
Actor entered game world. More... | |
void | enterFrame () |
Actor has been added to game world and enterFrame() is called once. More... | |
BehaviorElement | getActor () |
Actor owning the action. More... | |
ECBehaviorActorAIAction.Instance | getAIAction () |
Behavior actor ai-action or null. More... | |
ECBehaviorPlayerControllable.Instance | getPlayerControllable () |
Behavior player controllable or null. More... | |
bool | isActive () |
AI is active actor AI. More... | |
bool | isControlledByPlayer () |
Actor is controlled by player. More... | |
bool | isNotActive () |
AI is not active actor AI. More... | |
void | leaveConversation () |
Actor has been removed from a conversation playback. More... | |
void | leftGameWorld () |
Actor left game world. More... | |
void | log (Console console, Element element, String text) |
Log text about element to console prefixed with actor information. More... | |
void | log (Console console, Exception exception) |
Log exception to console prefixed with actor information. More... | |
void | log (Console console, String text) |
Log text to console prefixed with actor information. More... | |
void | log (Element element, String text) |
Log text about element to BaseGameApp console prefixed with actor information. More... | |
void | log (Exception exception) |
Log exception to BaseGameApp console prefixed with actor information. More... | |
void | log (String text) |
Log text to BaseGameApp console prefixed with actor information. More... | |
String | loggingPrefix () |
Logging prefix. More... | |
BaseActorAI | new () |
Create base actor ai. More... | |
String | persistencyFactoryName () |
Name of PersistencyFactory required to load object from file. More... | |
void | playerReleasesControl () |
Player released control of actor. More... | |
void | playerTakesControl () |
Player takes control of actor. More... | |
void | think (float elapsed) |
Thinking. More... | |
void | writeObjectToFile (PersistencyEnvironment env, FileWriter writer) |
Write object to file writer. More... | |
Protected Member Functions | |
void | initBehaviors () |
Init behaviors. More... | |
Protected Attributes | |
BehaviorElement | actor |
Actor the action is assigned to or null. More... | |
ECBehaviorActorAIAction.Instance | aiAction |
Behavior actor ai-action or null. More... | |
ECBehaviorPlayerControllable.Instance | playerControllable |
Behavior player controllable or null. More... | |
Base actor AI.
Action supports the Persistable interface an can be read from and writen to file writers.
void Dragengine.Scenery.BaseActorAI.actionFailed | ( | ) |
Action failed.
void Dragengine.Scenery.BaseActorAI.actionFinished | ( | ) |
Action finished successfully.
void Dragengine.Scenery.BaseActorAI.activate | ( | BehaviorElement | actor | ) |
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.
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.
void Dragengine.Scenery.BaseActorAI.deactivate | ( | ) |
Action has been unset as active action in an actor.
void Dragengine.Scenery.BaseActorAI.dispose | ( | ) |
Dispose of base actor ai.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
void Dragengine.Scenery.BaseActorAI.enterConversation | ( | ) |
Actor has been added to a conversation playback.
void Dragengine.Scenery.BaseActorAI.enteredGameWorld | ( | ) |
Actor entered game world.
void Dragengine.Scenery.BaseActorAI.enterFrame | ( | ) |
Actor has been added to game world and enterFrame() is called once.
BehaviorElement Dragengine.Scenery.BaseActorAI.getActor | ( | ) |
Actor owning the action.
ECBehaviorActorAIAction.Instance Dragengine.Scenery.BaseActorAI.getAIAction | ( | ) |
Behavior actor ai-action or null.
ECBehaviorPlayerControllable.Instance Dragengine.Scenery.BaseActorAI.getPlayerControllable | ( | ) |
Behavior player controllable or null.
|
protected |
Init behaviors.
Retrieve and store required and optional behavior instances from the actor element.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
bool Dragengine.Scenery.BaseActorAI.isActive | ( | ) |
AI is active actor AI.
bool Dragengine.Scenery.BaseActorAI.isControlledByPlayer | ( | ) |
Actor is controlled by player.
bool Dragengine.Scenery.BaseActorAI.isNotActive | ( | ) |
AI is not active actor AI.
void Dragengine.Scenery.BaseActorAI.leaveConversation | ( | ) |
Actor has been removed from a conversation playback.
void Dragengine.Scenery.BaseActorAI.leftGameWorld | ( | ) |
Actor left game world.
Log text about element to console prefixed with actor information.
void Dragengine.Scenery.BaseActorAI.log | ( | Console | console, |
Exception | exception | ||
) |
Log exception to console prefixed with actor information.
void Dragengine.Scenery.BaseActorAI.log | ( | Console | console, |
String | text | ||
) |
Log text to console prefixed with actor information.
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.
String Dragengine.Scenery.BaseActorAI.loggingPrefix | ( | ) |
Logging prefix.
Returns string in the form "<actor-class>/<ai-class>".
BaseActorAI Dragengine.Scenery.BaseActorAI.new | ( | ) |
Create base actor ai.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
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.
void Dragengine.Scenery.BaseActorAI.playerReleasesControl | ( | ) |
Player released control of actor.
void Dragengine.Scenery.BaseActorAI.playerTakesControl | ( | ) |
Player takes control of actor.
void Dragengine.Scenery.BaseActorAI.think | ( | float | elapsed | ) |
Thinking.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
void Dragengine.Scenery.BaseActorAI.writeObjectToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write object to file writer.
Implements Dragengine.LoadSave.Persistable.
Reimplemented in Dragengine.Scenery.BAAIBehaviorTree.
|
protected |
Actor the action is assigned to or null.
|
protected |
Behavior actor ai-action or null.
|
protected |
Behavior player controllable or null.