Drag[en]gine Game Engine  1.21
deScriptingSystem Class Reference

Scripting System. More...

#include <deScriptingSystem.h>

Inheritance diagram for deScriptingSystem:
deBaseSystem

Public Member Functions

Constructors and Destructors
 deScriptingSystem (deEngine *engine)
 Create new scripting system linked to the given engine. More...
 
 ~deScriptingSystem ()
 Clean up scripting system. More...
 
Management
deBaseScriptingModuleGetActiveModule () const
 Active module. More...
 
const decStringGetScriptDirectory () const
 Directory relative to the game directory where the scripts are located. More...
 
void SetScriptDirectory (const char *scriptDirectory)
 Set directory relative to the game directory where the scripts are located. More...
 
const decStringGetScriptVersion () const
 Script version for compatibility. More...
 
void SetScriptVersion (const char *scriptVersion)
 Set script version for compatibility. More...
 
const decStringGetGameObject () const
 Initial game object to create. More...
 
void SetGameObject (const char *gameObject)
 Set initial game object to create. More...
 
void AddVFSSharedDataDir (deVirtualFileSystem &vfs) const
 Add virtual file system container for module shared data. More...
 
bool GetEditMode () const
 Scripts are executed in edit mode. More...
 
void SetEditMode (bool editMode)
 Set if scripts are executed in edit mode. More...
 
void InitGame ()
 Inits the game if not running. More...
 
void ExitGame ()
 Exits the game it running. More...
 
void UserRequestQuit ()
 User requested window to be closed. More...
 
void OnFrameUpdate ()
 A new fram update cycle started. More...
 
void OnResizeRenderWindow ()
 Render window has changed size. More...
 
void SendEvent (deInputEvent *event)
 Event has to be processed. More...
 
void LoadCollider (deCollider *collider)
 Create peer object for the given collider using the active module and assigns it. More...
 
void LoadServer (deServer *server)
 Create peer object for the given server using the active module and assigns it. More...
 
void LoadConnection (deConnection *connection)
 Create peer object for the given connection using the active module and assigns it. More...
 
void LoadNetworkState (deNetworkState *state)
 Create peer object for the given network state using the active module and assigns it. More...
 
void LoadTouchSensor (deTouchSensor *touchSensor)
 Create peer object for the given touch sensor using the active module and assigns it. More...
 
void LoadPropField (dePropField *propField)
 Create peer object for the given prop field using the active module and assigns it. More...
 
void LoadParticleEmitterInstance (deParticleEmitterInstance *instance)
 Create peer object for the given particle emitter instance using the active module and assigns it. More...
 
void LoadSoundLevelMeter (deSoundLevelMeter *meter)
 Create deSoundLevelMeter peer using active module and assigns it. More...
 
void LoadSpeaker (deSpeaker *speaker)
 Create deSpeaker peer using active module and assigns it. More...
 
Overloadables
virtual void SetActiveModule (deLoadableModule *module)
 Set active loadable module. More...
 
virtual void ClearPermanents ()
 Clearcross references and links that could lead to memory leaks. More...
 
virtual void PostStart ()
 Carry out here actions right after the system started up. More...
 
virtual void PreStop ()
 Carry out here actions right before the system shuts down. More...
 
- Public Member Functions inherited from deBaseSystem
 deBaseSystem (deEngine *engine, const char *systemName, int requiredModuleType)
 Create new base system linked to the given engine. More...
 
virtual ~deBaseSystem ()
 Clean up base system. More...
 
deEngineGetEngine () const
 Linked game engine. More...
 
deLoadableModuleGetActiveLoadableModule () const
 Active loadable module. More...
 
bool GetIsRunning () const
 System is running. More...
 
bool GetHasFailed () const
 System has failed during runtime. More...
 
const decStringGetSystemName () const
 System name. More...
 
virtual bool CanStart ()
 
void SetHasFailed (bool hasFailed)
 Set if system has failed. More...
 
virtual void Start ()
 Start system and the active loadable module. More...
 
virtual void Stop ()
 Stop system and the active loadable module. More...
 
void CheckAndActivateFirst (deModuleSystem::eModuleTypes type)
 Check if at least one module is working and select the first one. More...
 
void LogInfo (const char *message)
 Output information message on the console. More...
 
void LogInfoFormat (const char *message,...)
 Output formated information message on the console. More...
 
void LogInfoFormatUsing (const char *message, va_list args)
 Output formated information message on the console. More...
 
void LogWarn (const char *message)
 Output warning message on the console. More...
 
void LogWarnFormat (const char *message,...)
 Output formated warning message on the console. More...
 
void LogWarnFormatUsing (const char *message, va_list args)
 Output formated warning message on the console. More...
 
void LogError (const char *message)
 Output error message on the console. More...
 
void LogErrorFormat (const char *message,...)
 Output formated error message on the console. More...
 
void LogErrorFormatUsing (const char *message, va_list args)
 Output formated error message on the console. More...
 
void LogException (const deException &exception)
 Output exception as error message on the console. More...
 

Detailed Description

Scripting System.

Provides support for an external scripting or programming language. This is the only system that can not change during the run of a game not even during engine-break time. The scripts drive the entire engine and should provide an interface ( abstraction layer ) between the engine and engine systems towards the game developer. The amount of access to the engine functionality is depending on the scripting module used.

Note
Currently the system sends events directly to the scripting system. It would be better to avoid this by giving the scripting system the chance to retrieve the events itself from a queue. The best idea would be to create an event queue in the engine object that the input system writes to and that the scripting system retrieves from. Conversion of events has to be done anyways.

Constructor & Destructor Documentation

◆ deScriptingSystem()

deScriptingSystem::deScriptingSystem ( deEngine engine)

Create new scripting system linked to the given engine.

◆ ~deScriptingSystem()

deScriptingSystem::~deScriptingSystem ( )

Clean up scripting system.

Member Function Documentation

◆ AddVFSSharedDataDir()

void deScriptingSystem::AddVFSSharedDataDir ( deVirtualFileSystem vfs) const

Add virtual file system container for module shared data.

No container is added if no module is active or the active module has no shared data.

◆ ClearPermanents()

virtual void deScriptingSystem::ClearPermanents ( )
virtual

Clearcross references and links that could lead to memory leaks.

Do not forget to call the super function.

Reimplemented from deBaseSystem.

◆ ExitGame()

void deScriptingSystem::ExitGame ( )

Exits the game it running.

◆ GetActiveModule()

deBaseScriptingModule* deScriptingSystem::GetActiveModule ( ) const
inline

Active module.

◆ GetEditMode()

bool deScriptingSystem::GetEditMode ( ) const
inline

Scripts are executed in edit mode.

In this mode the scripts are reduced to what is required by an editing application. The edit mode can only be changed while the system is not running.

◆ GetGameObject()

const decString& deScriptingSystem::GetGameObject ( ) const
inline

Initial game object to create.

◆ GetScriptDirectory()

const decString& deScriptingSystem::GetScriptDirectory ( ) const
inline

Directory relative to the game directory where the scripts are located.

◆ GetScriptVersion()

const decString& deScriptingSystem::GetScriptVersion ( ) const
inline

Script version for compatibility.

Version
1.9

◆ InitGame()

void deScriptingSystem::InitGame ( )

Inits the game if not running.

◆ LoadCollider()

void deScriptingSystem::LoadCollider ( deCollider collider)

Create peer object for the given collider using the active module and assigns it.

◆ LoadConnection()

void deScriptingSystem::LoadConnection ( deConnection connection)

Create peer object for the given connection using the active module and assigns it.

◆ LoadNetworkState()

void deScriptingSystem::LoadNetworkState ( deNetworkState state)

Create peer object for the given network state using the active module and assigns it.

◆ LoadParticleEmitterInstance()

void deScriptingSystem::LoadParticleEmitterInstance ( deParticleEmitterInstance instance)

Create peer object for the given particle emitter instance using the active module and assigns it.

◆ LoadPropField()

void deScriptingSystem::LoadPropField ( dePropField propField)

Create peer object for the given prop field using the active module and assigns it.

◆ LoadServer()

void deScriptingSystem::LoadServer ( deServer server)

Create peer object for the given server using the active module and assigns it.

◆ LoadSoundLevelMeter()

void deScriptingSystem::LoadSoundLevelMeter ( deSoundLevelMeter meter)

Create deSoundLevelMeter peer using active module and assigns it.

◆ LoadSpeaker()

void deScriptingSystem::LoadSpeaker ( deSpeaker speaker)

Create deSpeaker peer using active module and assigns it.

◆ LoadTouchSensor()

void deScriptingSystem::LoadTouchSensor ( deTouchSensor touchSensor)

Create peer object for the given touch sensor using the active module and assigns it.

◆ OnFrameUpdate()

void deScriptingSystem::OnFrameUpdate ( )

A new fram update cycle started.

◆ OnResizeRenderWindow()

void deScriptingSystem::OnResizeRenderWindow ( )

Render window has changed size.

◆ PostStart()

virtual void deScriptingSystem::PostStart ( )
virtual

Carry out here actions right after the system started up.

Reimplemented from deBaseSystem.

◆ PreStop()

virtual void deScriptingSystem::PreStop ( )
virtual

Carry out here actions right before the system shuts down.

Reimplemented from deBaseSystem.

◆ SendEvent()

void deScriptingSystem::SendEvent ( deInputEvent event)

Event has to be processed.

◆ SetActiveModule()

virtual void deScriptingSystem::SetActiveModule ( deLoadableModule module)
virtual

Set active loadable module.

Do not forget to call the super function.

Reimplemented from deBaseSystem.

◆ SetEditMode()

void deScriptingSystem::SetEditMode ( bool  editMode)

Set if scripts are executed in edit mode.

In this mode the scripts are reduced to what is required by an editing application. The edit mode can only be changed while the system is not running.

◆ SetGameObject()

void deScriptingSystem::SetGameObject ( const char *  gameObject)

Set initial game object to create.

◆ SetScriptDirectory()

void deScriptingSystem::SetScriptDirectory ( const char *  scriptDirectory)

Set directory relative to the game directory where the scripts are located.

◆ SetScriptVersion()

void deScriptingSystem::SetScriptVersion ( const char *  scriptVersion)

Set script version for compatibility.

Version
1.9

◆ UserRequestQuit()

void deScriptingSystem::UserRequestQuit ( )

User requested window to be closed.


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