RUSTICDOCSSearch documentation

Public property API

Read and update typed properties declared for this behavior.

When to call it

Use properties for designer-configurable values such as speed, health, and damage. Read at setup or when needed; write only when gameplay changes the value.

Calls

  • rustic.get_property(name)
  • rustic.set_property(name, value)

Variables

VariableTypeRequiredDescription
namestringYesExact declared property name.
valueEngineValueYesValue matching the property's existing type.

Return and timing

Get returns the stored value. Set queues an update and cannot create a missing property.

Language examples

Lua 5.4

lua
local health = rustic.get_property('health')
rustic.set_property('health', health - 10)

JavaScript

javascript
const health = rustic.get_property('health');
rustic.set_property('health', health - 10);

Python

python
health = rustic.get_property('health')
rustic.set_property('health', health - 10)

C++

cpp
double health = rustic.get_property("health").number();
rustic.set_property("health", RusticValue{health - 10});

C#

csharp
long health = (long)rustic.get_property("health")!;
rustic.set_property("health",health-10);

Luau

lua
local health = rustic.get_property('health')
rustic.set_property('health',health-10)

C

c
RusticValue health = rustic.get_property("health");
health.integer -= 10;
rustic.set_property("health",health);

Java

java
long health = ((Number)rustic.get_property("health")).longValue();
rustic.set_property("health",health-10);

PHP

php
$health = $rustic->get_property("health");
$rustic->set_property("health",$health-10);

HTML / inline JS

javascript
const health = rustic.get_property('health');
rustic.set_property('health', health - 10);

Constraints and behavior

  • Unknown names and type changes are rejected. Boundary values are booleans, integers, finite numbers, strings, vectors, and optional entity IDs.
  • Every gameplay language calls the engine-owned API. Rustic supplies SDKs and dispatches callbacks; scripts do not parse requests or serialize responses. See the language guide for complete setup and callback registration.