Class ScriptSpaceComponent

Inheritance Relationships

Base Type

Class Documentation

class ScriptSpaceComponent : public csp::multiplayer::ComponentBase

Enables custom behavior through scripting.

This component allows developers to author scripts that control how entities and components behave based on specific conditions or user actions. Scripts can modify entity properties, trigger events, or respond to user inputs.

Public Functions

ScriptSpaceComponent(SpaceEntity *Parent)

Constructs the script space component, and associates it with the specified Parent space entity.

Parameters

Parent – The Space entity that owns this component.

const csp::common::String &GetScriptSource() const

Retrieves the source of the script of this script component.

Returns

The script source of this script component.

void SetScriptSource(const csp::common::String &ScriptSource)

Sets the source of the script of this script component.

Parameters

ScriptSource – The script source of this script component.

int64_t GetOwnerId() const

Gets the ID of the owner of this script component.

Returns

The ID of the owner of this script.

void SetOwnerId(int64_t OwnerId)

Sets the ID of the owner of this script component.

Parameters

OwnerId – The ID of the owner of this script.

ScriptScope GetScriptScope() const

Gets the scope within which this script operates.

Returns

The scope of this script.

void SetScriptScope(ScriptScope Scope)

Sets the scope within which this script operates.

Parameters

Scope – The scope of this script.

Protected Functions

virtual void SetPropertyFromPatch(uint32_t Key, const ReplicatedValue &Value) override
virtual void OnRemove() override