Drag[en]gine Script Module DragonScript
1.23
|
Behavior adding support to randomize creation. More...
Public Member Functions | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
ECPFloat | getPrrobability () |
Probability property. More... | |
ECBehaviorRandomizeCreation | new (BehaviorElementClass eclass) |
Create behavior. More... | |
bool | preventCreation (StubElement stub, GameWorld gameWorld) |
Prevent creation of element. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
void | dispose () |
Dispose of behavior. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Attributes | |
ECPFloat | pProbability |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior adding support to randomize creation.
This behavior is typically used to add variation to game worlds by randomly creating or not creating element. This affects only elements added to a game world. Loading a game world does not trigger randomization.
This behavior uses BehaviorPreventCreation to randomly prevent the element to be created and added to the game world. This check is done after BehaviorPrepareStub supporting behaviors have potentially modified the StubElement.
Default property prefix is "randomizeCreation."
ECBehaviorInstance Dragengine.Scenery.ECBehaviorRandomizeCreation.createInstance | ( | BehaviorElement | element | ) |
Create Behavior instance.
Implements Dragengine.Scenery.ECBehavior.
ECPFloat Dragengine.Scenery.ECBehaviorRandomizeCreation.getPrrobability | ( | ) |
Probability property.
Probability the element is created. Property name is "probability". Default value is 1. Minimum value is 0. Minimum value is 1.
ECBehaviorRandomizeCreation Dragengine.Scenery.ECBehaviorRandomizeCreation.new | ( | BehaviorElementClass | eclass | ) |
Create behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
bool Dragengine.Scenery.ECBehaviorRandomizeCreation.preventCreation | ( | StubElement | stub, |
GameWorld | gameWorld | ||
) |
Prevent creation of element.
Called by BehaviorElementClass.createAndAddElement(StubElement,GameWorld) after BehaviorPrepareStub interfaces have been processed. If true is returned the element is not created and added to the game world.
Implements Dragengine.Scenery.BehaviorPreventCreation.
ECPFloat Dragengine.Scenery.ECBehaviorRandomizeCreation.pProbability |