|
Drag[en]gine Script Module DragonScript 1.35
|
Public Member Functions | |
| void | addBehavior (GWBehavior behavior) |
| Add behavior. | |
| void | addElement (Element element) |
| Add Element. | |
| void | addEnterFrameOnce (Element element) |
| Call Element.enterFrame() on element once at start of next frame update. | |
| void | addOneShotSpeaker (Speaker speaker) |
| void | addThinker (Element element) |
| Add element requiring thinking on frame updates. | |
| Array | collectBehaviors (Block ablock) |
| Collect behaviors with block into Array. | |
| Dictionary | debugStatistics () |
| Collect debug statistics. | |
| Dictionary | debugStatisticsSummary () |
| Retrieves some summary statistics. | |
| void | dispose () |
| Dispose of game world. | |
| GWBehavior | findBehavior (Block ablock) |
| Find behavior with block. | |
| Element | findElement (Block ablock) |
| Find element with block with parameter Element. | |
| void | forEachBehavior (Block ablock) |
| Visit behaviors with block. | |
| void | forEachThinker (Block ablock) |
| Visit thinkers with block with parameter Element. | |
| AnchoredElementList | getAnchoredElementList () |
| GWBehaviorAnchoredElements | getBehaviorAnchoredElements () |
| Anchored elements behavior. | |
| GWBehavior | getBehaviorAt (int index) |
| Behavior at index. | |
| GWBehaviorBTSM | getBehaviorBTSM () |
| Behavior tree and state machine support game world behavior. | |
| GWBehaviorParameterTree | getBehaviorParameterTree () |
| Parameter tree game world behavior. | |
| CachedVegetation | getCachedVegetation () |
| Cached vegetation. | |
| ConversationActorList | getConvoActorList () |
| Conversation actor list. | |
| ConversationCoordSystemList | getConvoCoordSystemList () |
| Conversation coordinate system list. | |
| Element | getElementWithID (UniqueID id) |
| Element with identifier or null if absent. | |
| bool | getEnablePersistency () |
| Enable persistency (backward compatibility). | |
| bool | getEnableReadDynDataWithSize () |
| Enable reading dynamic element data from persistency with size. | |
| Vector | getGravity () |
| Gravity. | |
| LayerMask | getLayerMaskOneShotSpeaker () |
| RailList | getRailList () |
| Rail list. | |
| SpawnPointList | getSpawnPoints () |
| Spawn point list. | |
| StubGameWorld | getStub () |
| Stub used to create game world. | |
| TemporaryDecalManager | getTemporaryDecalManager () |
| Temporary decal manager. | |
| float | getTimeScale () |
| Time scale applied to elapsed time. | |
| void | init (StubGameWorld stub) |
| Init game world from stub. | |
| GameWorld | new () |
| Create game world. | |
| void | playSoundOnce (Sound sound, DVector position, float volume, float range) |
| void | playSoundOnce (Sound sound, DVector position, Quaternion orientation, float volume, float range) |
| void | playSoundOnce (Sound sound, Element element, float volume, float range) |
| void | playSynthesizerOnce (SynthesizerInstance synthesizer, DVector position, float volume, float range) |
| void | playSynthesizerOnce (SynthesizerInstance synthesizer, DVector position, Quaternion orientation, float volume, float range) |
| void | playSynthesizerOnce (SynthesizerInstance synthesizer, Element element, float volume, float range) |
| void | removeAllElements () |
| Remove all elements calling safeDispose() on them. | |
| void | removeAllOneShotSpeakers () |
| void | removeElement (Element element) |
| Remove Element without disposing it. | |
| void | removeEnterFrameOnce (Element element) |
| Stop call Element.enterFrame() on element once at start of next frame update. | |
| void | removeFinishedOneShotSpeakers () |
| void | removeThinker (Element element) |
| Remove element requiring thinking on frame updates. | |
| void | requiresThinkChanged () |
| Requires thinking changed. | |
| void | setCachedVegetation (CachedVegetation cachedVegetation) |
| Set cached vegetation. | |
| void | setEnablePersistency (bool enable) |
| void | setGravity (Vector gravity) |
| Set gravity. | |
| void | setLayerMaskOneShotSpeaker (LayerMask layerMask) |
| void | setStub (StubGameWorld stub) |
| Set stub used to create game world. | |
| void | setTemporaryDecalManager (TemporaryDecalManager manager) |
| Set temporary decal manager. | |
| void | setTimeScale (float scale) |
| Set time scale applied to elapsed time. | |
| void | setUniqueIDRemapper (UniqueIDRemapper remapper) |
| Set Unique ID remapper. | |
| void | think (float elapsed) |
| Make elements think. | |
| void | visitElements (ElementVisitor visitor) |
| Visit elements. | |
Game world.
A single simulation unit in the game. Simple games require usually only one game world containing all elements of the currently loaded map or level. More complex games can use multiple game worlds for example to simulate development of the game world outside the currently visible section. Every game world wraps an engine world resource. Elements removed from the game world using removeElement are not disposed of. This allows to move elements between game worlds. Elements removed using removeAllElements though get disposed.
| void Dragengine.Scenery.GameWorld.addBehavior | ( | GWBehavior | behavior | ) |
Add behavior.
References addBehavior(), pBehaviorAnchoredElements, pBehaviorBTSM, pBehaviorOneShotSpeaker, pBehaviorParameterTree, and pTimeScale.
Referenced by addBehavior(), and getEnableReadDynDataWithSize().
| void Dragengine.Scenery.GameWorld.addElement | ( | Element | element | ) |
| void Dragengine.Scenery.GameWorld.addEnterFrameOnce | ( | Element | element | ) |
Call Element.enterFrame() on element once at start of next frame update.
References pBehaviors.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.addOneShotSpeaker | ( | Speaker | speaker | ) |
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.addThinker | ( | Element | element | ) |
Add element requiring thinking on frame updates.
Referenced by debugStatisticsSummary().
| Array Dragengine.Scenery.GameWorld.collectBehaviors | ( | Block | ablock | ) |
Collect behaviors with block into Array.
Block is required to have one parameter GWBehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
References pBehaviorAnchoredElements, pBehaviorBTSM, pBehaviorOneShotSpeaker, pBehaviorParameterTree, pBehaviors, and pThinkingBehaviors.
Referenced by setCachedVegetation().
| Dictionary Dragengine.Scenery.GameWorld.debugStatistics | ( | ) |
Collect debug statistics.
Returns a dictionary with these values:
References pElementIDMap, and pEnterFrameOnce.
Referenced by debugStatisticsSummary().
| Dictionary Dragengine.Scenery.GameWorld.debugStatisticsSummary | ( | ) |
Retrieves some summary statistics.
Returns a dictionary with these values.
References addEnterFrameOnce(), addOneShotSpeaker(), addThinker(), debugStatistics(), debugStatisticsSummary(), findElement(), forEachThinker(), getAnchoredElementList(), getCachedVegetation(), getConvoActorList(), getConvoCoordSystemList(), getElementWithID(), getGravity(), getLayerMaskOneShotSpeaker(), getRailList(), getSpawnPoints(), getStub(), getTemporaryDecalManager(), getTimeScale(), init(), pBehaviorAnchoredElements, pBehaviorOneShotSpeaker, pBehaviors, pBehaviorsInited, pCachedVegetation, pConvoActorList, pConvoCoordSystemList, pElementIDMap, pElements, pEnablePersistency, pEnterFrameOnce, pGravity, playSoundOnce(), playSynthesizerOnce(), pNextObjectID, pRailList, pSpawnPoints, pStub, pTempDecalMgr, pThinkingBehaviors, pTimeScale, pUniqueIDRemapper, pWorld, removeAllElements(), removeAllOneShotSpeakers(), removeEnterFrameOnce(), removeFinishedOneShotSpeakers(), removeThinker(), setCachedVegetation(), setGravity(), setLayerMaskOneShotSpeaker(), setStub(), setTemporaryDecalManager(), setTimeScale(), setUniqueIDRemapper(), think(), and visitElements().
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.dispose | ( | ) |
Dispose of game world.
References pElementIDMap, pEnterFrameOnce, pSpawnPoints, pTempDecalMgr, and pUniqueIDRemapper.
Referenced by forEachBehavior().
| GWBehavior Dragengine.Scenery.GameWorld.findBehavior | ( | Block | ablock | ) |
Find behavior with block.
Block is required to have one parameter GWBehavior or subclass thereof and returning true if the right behavior is found otherwise false. Block is called only for behaviors castable to block parameter type.
References pBehaviors, and pElements.
Referenced by forEachThinker().
| Element Dragengine.Scenery.GameWorld.findElement | ( | Block | ablock | ) |
Find element with block with parameter Element.
References forEachBehavior(), and pBehaviors.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.forEachBehavior | ( | Block | ablock | ) |
Visit behaviors with block.
Block is required to have one parameter of type GWBehavior or subclass thereof. Block is called only for behaviors castable to block parameter type.
References dispose().
Referenced by findElement().
| void Dragengine.Scenery.GameWorld.forEachThinker | ( | Block | ablock | ) |
Visit thinkers with block with parameter Element.
References findBehavior().
Referenced by debugStatisticsSummary().
| AnchoredElementList Dragengine.Scenery.GameWorld.getAnchoredElementList | ( | ) |
References pElements.
Referenced by debugStatisticsSummary().
| GWBehaviorAnchoredElements Dragengine.Scenery.GameWorld.getBehaviorAnchoredElements | ( | ) |
Anchored elements behavior.
References pBehaviors, pStub, and pWorld.
Referenced by removeFinishedOneShotSpeakers().
| GWBehavior Dragengine.Scenery.GameWorld.getBehaviorAt | ( | int | index | ) |
Behavior at index.
References pBehaviors, pConvoActorList, pConvoCoordSystemList, pGravity, pRailList, and pThinkingBehaviors.
Referenced by setEnablePersistency().
| GWBehaviorBTSM Dragengine.Scenery.GameWorld.getBehaviorBTSM | ( | ) |
Behavior tree and state machine support game world behavior.
References pCachedVegetation, pConvoActorList, pConvoCoordSystemList, and pTempDecalMgr.
Referenced by playSoundOnce().
| GWBehaviorParameterTree Dragengine.Scenery.GameWorld.getBehaviorParameterTree | ( | ) |
Parameter tree game world behavior.
References pRailList, and pSpawnPoints.
Referenced by playSynthesizerOnce().
| CachedVegetation Dragengine.Scenery.GameWorld.getCachedVegetation | ( | ) |
Cached vegetation.
Referenced by debugStatisticsSummary().
| ConversationActorList Dragengine.Scenery.GameWorld.getConvoActorList | ( | ) |
| ConversationCoordSystemList Dragengine.Scenery.GameWorld.getConvoCoordSystemList | ( | ) |
Conversation coordinate system list.
Referenced by debugStatisticsSummary().
Element with identifier or null if absent.
Referenced by debugStatisticsSummary().
| bool Dragengine.Scenery.GameWorld.getEnablePersistency | ( | ) |
Enable persistency (backward compatibility).
Since Drag[en]gine 1.17 GameWorld supports persistency to load and save game world behavior states. This is incompatible with old saves where GameWorld did not persist any data. To support loading and saving saves prior to 1.17 use this method.
Hence to support loading old saves and saving new saves load with false and save with true.
By default enable persistency is set to true if the required version of the game project is set to 1.17 or newer and false otherwise. Hence projects require an earlier version will always operate with enable persistency set to false keeping them compatible while projects requiring 1.17 or newer enable persistency.
Referenced by setStub().
| bool Dragengine.Scenery.GameWorld.getEnableReadDynDataWithSize | ( | ) |
Enable reading dynamic element data from persistency with size.
Returns true if readElementStubsFromFile() encountered version 1 or higher.
References addBehavior(), and pBehaviors.
Referenced by init().
| Vector Dragengine.Scenery.GameWorld.getGravity | ( | ) |
Gravity.
Referenced by debugStatisticsSummary().
| LayerMask Dragengine.Scenery.GameWorld.getLayerMaskOneShotSpeaker | ( | ) |
Referenced by debugStatisticsSummary().
| RailList Dragengine.Scenery.GameWorld.getRailList | ( | ) |
Rail list.
Referenced by debugStatisticsSummary().
| SpawnPointList Dragengine.Scenery.GameWorld.getSpawnPoints | ( | ) |
Spawn point list.
Referenced by debugStatisticsSummary().
| StubGameWorld Dragengine.Scenery.GameWorld.getStub | ( | ) |
| TemporaryDecalManager Dragengine.Scenery.GameWorld.getTemporaryDecalManager | ( | ) |
| float Dragengine.Scenery.GameWorld.getTimeScale | ( | ) |
Time scale applied to elapsed time.
References pBehaviors, pThinkingBehaviors, and requiresThinkChanged().
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.init | ( | StubGameWorld | stub | ) |
Init game world from stub.
Subclass is required to super-call init() to init behaviors properly.
References getEnableReadDynDataWithSize().
Referenced by debugStatisticsSummary().
| GameWorld Dragengine.Scenery.GameWorld.new | ( | ) |
Create game world.
References new(), pElements, pEnablePersistency, and pWorld.
Referenced by new().
| void Dragengine.Scenery.GameWorld.playSoundOnce | ( | Sound | sound, |
| DVector | position, | ||
| float | volume, | ||
| float | range ) |
References pBehaviorBTSM.
| void Dragengine.Scenery.GameWorld.playSoundOnce | ( | Sound | sound, |
| DVector | position, | ||
| Quaternion | orientation, | ||
| float | volume, | ||
| float | range ) |
| void Dragengine.Scenery.GameWorld.playSoundOnce | ( | Sound | sound, |
| Element | element, | ||
| float | volume, | ||
| float | range ) |
References getBehaviorBTSM().
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.playSynthesizerOnce | ( | SynthesizerInstance | synthesizer, |
| DVector | position, | ||
| float | volume, | ||
| float | range ) |
| void Dragengine.Scenery.GameWorld.playSynthesizerOnce | ( | SynthesizerInstance | synthesizer, |
| DVector | position, | ||
| Quaternion | orientation, | ||
| float | volume, | ||
| float | range ) |
| void Dragengine.Scenery.GameWorld.playSynthesizerOnce | ( | SynthesizerInstance | synthesizer, |
| Element | element, | ||
| float | volume, | ||
| float | range ) |
References getBehaviorParameterTree(), and pBehaviorParameterTree.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.removeAllElements | ( | ) |
Remove all elements calling safeDispose() on them.
References pBehaviorsInited, and pStub.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.removeAllOneShotSpeakers | ( | ) |
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.removeElement | ( | Element | element | ) |
Remove Element without disposing it.
References pThinkingBehaviors.
Referenced by setTemporaryDecalManager().
| void Dragengine.Scenery.GameWorld.removeEnterFrameOnce | ( | Element | element | ) |
Stop call Element.enterFrame() on element once at start of next frame update.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.removeFinishedOneShotSpeakers | ( | ) |
References getBehaviorAnchoredElements(), and pBehaviorAnchoredElements.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.removeThinker | ( | Element | element | ) |
Remove element requiring thinking on frame updates.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.requiresThinkChanged | ( | ) |
Requires thinking changed.
Called by GWBehavior if their requirement for thinking changed. This means requiresThink() implementations return different values than last time they have been checked. Game world will check all behaviors for their thinking requirements changes. Using this method helps to reduce script processing load by not making calling update(), think() and postThink() on behaviors not requiring it.
References pCachedVegetation, pElementIDMap, and pEnterFrameOnce.
Referenced by getTimeScale().
| void Dragengine.Scenery.GameWorld.setCachedVegetation | ( | CachedVegetation | cachedVegetation | ) |
Set cached vegetation.
References collectBehaviors(), and pBehaviors.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.setEnablePersistency | ( | bool | enable | ) |
References getBehaviorAt(), and pBehaviors.
Referenced by setStub().
| void Dragengine.Scenery.GameWorld.setGravity | ( | Vector | gravity | ) |
Set gravity.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.setLayerMaskOneShotSpeaker | ( | LayerMask | layerMask | ) |
References pBehaviorOneShotSpeaker.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.setStub | ( | StubGameWorld | stub | ) |
Set stub used to create game world.
References getEnablePersistency(), pEnablePersistency, and setEnablePersistency().
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.setTemporaryDecalManager | ( | TemporaryDecalManager | manager | ) |
Set temporary decal manager.
References pElements, and removeElement().
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.setTimeScale | ( | float | scale | ) |
| void Dragengine.Scenery.GameWorld.setUniqueIDRemapper | ( | UniqueIDRemapper | remapper | ) |
Set Unique ID remapper.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.think | ( | float | elapsed | ) |
Make elements think.
Referenced by debugStatisticsSummary().
| void Dragengine.Scenery.GameWorld.visitElements | ( | ElementVisitor | visitor | ) |
Visit elements.
Referenced by debugStatisticsSummary().
| GWBehaviorAnchoredElements Dragengine.Scenery.GameWorld.pBehaviorAnchoredElements |
Referenced by addBehavior(), collectBehaviors(), debugStatisticsSummary(), and removeFinishedOneShotSpeakers().
| GWBehaviorBTSM Dragengine.Scenery.GameWorld.pBehaviorBTSM |
Referenced by addBehavior(), collectBehaviors(), and playSoundOnce().
| GWBehaviorOneShotSpeaker Dragengine.Scenery.GameWorld.pBehaviorOneShotSpeaker |
Referenced by addBehavior(), collectBehaviors(), debugStatisticsSummary(), and setLayerMaskOneShotSpeaker().
| GWBehaviorParameterTree Dragengine.Scenery.GameWorld.pBehaviorParameterTree |
Referenced by addBehavior(), collectBehaviors(), and playSynthesizerOnce().
| Array Dragengine.Scenery.GameWorld.pBehaviors |
| bool Dragengine.Scenery.GameWorld.pBehaviorsInited |
Referenced by debugStatisticsSummary(), and removeAllElements().
| CachedVegetation Dragengine.Scenery.GameWorld.pCachedVegetation |
Referenced by debugStatisticsSummary(), getBehaviorBTSM(), and requiresThinkChanged().
| ConversationActorList Dragengine.Scenery.GameWorld.pConvoActorList |
Referenced by debugStatisticsSummary(), getBehaviorAt(), and getBehaviorBTSM().
| ConversationCoordSystemList Dragengine.Scenery.GameWorld.pConvoCoordSystemList |
Referenced by debugStatisticsSummary(), getBehaviorAt(), and getBehaviorBTSM().
| Dictionary Dragengine.Scenery.GameWorld.pElementIDMap |
Referenced by debugStatistics(), debugStatisticsSummary(), dispose(), getTemporaryDecalManager(), and requiresThinkChanged().
| SafeArray Dragengine.Scenery.GameWorld.pElements |
Referenced by debugStatisticsSummary(), findBehavior(), getAnchoredElementList(), new(), and setTemporaryDecalManager().
| bool Dragengine.Scenery.GameWorld.pEnablePersistency |
Referenced by debugStatisticsSummary(), new(), and setStub().
| Array Dragengine.Scenery.GameWorld.pEnterFrameOnce |
Referenced by debugStatistics(), debugStatisticsSummary(), dispose(), and requiresThinkChanged().
| Vector Dragengine.Scenery.GameWorld.pGravity |
Referenced by debugStatisticsSummary(), and getBehaviorAt().
| UniqueID Dragengine.Scenery.GameWorld.pNextObjectID |
Referenced by debugStatisticsSummary().
| RailList Dragengine.Scenery.GameWorld.pRailList |
Referenced by debugStatisticsSummary(), getBehaviorAt(), and getBehaviorParameterTree().
| SpawnPointList Dragengine.Scenery.GameWorld.pSpawnPoints |
Referenced by debugStatisticsSummary(), dispose(), and getBehaviorParameterTree().
| StubGameWorld Dragengine.Scenery.GameWorld.pStub |
Referenced by debugStatisticsSummary(), getBehaviorAnchoredElements(), and removeAllElements().
| TemporaryDecalManager Dragengine.Scenery.GameWorld.pTempDecalMgr |
Referenced by debugStatisticsSummary(), dispose(), and getBehaviorBTSM().
| Array Dragengine.Scenery.GameWorld.pThinkingBehaviors |
Referenced by collectBehaviors(), debugStatisticsSummary(), getBehaviorAt(), getTimeScale(), and removeElement().
| float Dragengine.Scenery.GameWorld.pTimeScale |
Referenced by addBehavior(), and debugStatisticsSummary().
| UniqueIDRemapper Dragengine.Scenery.GameWorld.pUniqueIDRemapper |
Referenced by debugStatisticsSummary(), and dispose().
| World Dragengine.Scenery.GameWorld.pWorld |
Referenced by debugStatisticsSummary(), getBehaviorAnchoredElements(), and new().