Drag[en]gine Script Module DragonScript Script API  1.0
CConditionActorCommand Class Reference

Conversation condition using value returned by command send to actor. More...

Inheritance diagram for CConditionActorCommand:
ConversationCondition Persistable

Classes

class  Factory
 Factory for loading actor actions. More...
 

Public Member Functions

bool evaluate (ConversationPlayback playback)
 Condition is true. More...
 
StringID getActorID ()
 Actor ID or null if not set. More...
 
int getActorIndex ()
 Actor index or -1 if not set. More...
 
String getCommand ()
 Command to send. More...
 
bool getNegate ()
 Result of the condition is negated. More...
 
CConditionActorCommand new ()
 Create conversation action. More...
 
CConditionActorCommand new (PersistencyEnvironment env, FileReader reader)
 Read from file. More...
 
String persistencyFactoryName ()
 Name of PersistencyFactory required to load object from file. More...
 
void setActorID (StringID id)
 Set actor ID or null if not set. More...
 
void setActorIndex (int index)
 Set actor index or -1 if not set. More...
 
void setCommand (String command)
 Set command to send. More...
 
void setNegate (bool negate)
 Set if result of the condition is negated. More...
 
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)
 Write object to file writer. More...
 
- Public Member Functions inherited from ConversationCondition
bool evaluate (ConversationPlayback playback)
 Evaluate condition. More...
 
ConversationCondition new ()
 Create conversation condition. More...
 

Detailed Description

Conversation condition using value returned by command send to actor.

The command is a single text string parsed by the conversation script into an array of arguments and then send to the player action. The format of the command depends on the type of the player action the actor is using at the time of the command being send. The command returns a boolean value use directly as condition result.

Member Function Documentation

◆ evaluate()

bool evaluate ( ConversationPlayback  playback)

Condition is true.

◆ getActorID()

StringID getActorID ( )

Actor ID or null if not set.

◆ getActorIndex()

int getActorIndex ( )

Actor index or -1 if not set.

◆ getCommand()

String getCommand ( )

Command to send.

◆ getNegate()

bool getNegate ( )

Result of the condition is negated.

◆ new() [1/2]

Create conversation action.

◆ new() [2/2]

Read from file.

◆ persistencyFactoryName()

String 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 Persistable.

◆ setActorID()

void setActorID ( StringID  id)

Set actor ID or null if not set.

◆ setActorIndex()

void setActorIndex ( int  index)

Set actor index or -1 if not set.

◆ setCommand()

void setCommand ( String  command)

Set command to send.

◆ setNegate()

void setNegate ( bool  negate)

Set if result of the condition is negated.

◆ writeObjectToFile()

void writeObjectToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object to file writer.

Implements Persistable.


The documentation for this class was generated from the following file: