Scripting
Gameplay scripts can be written in Strata or C#
Each script picks its language when you create it, and a project can use both languages - you aren't boxed into just one
What is Strata?
You probably haven't heard of Strata - because it's a new project aimed at creating a simple, C-type language meant for scripting (separate from Hyperion).
Strata is statically typed and compiled, with no garbage collector, ref counting or manual memory management - the Strata overview covers the syntax
Exposing C++ to scripts
Engine types show up in both languages through reflection. Add a class in C++ with reflection macros, and Hyperion's CodeGenTool generates binding code so you can use it in scripts.
HYP_CLASS()
class Camera : public ObjectBase
{
HYP_OBJECT_BODY(Camera);
public:
HYP_METHOD(Property = "FOV")
float GetFOV() const;
HYP_METHOD(Property = "FOV")
void SetFOV(float v);
};
In this section
- Your first scriptAttach a script to an entity and make it move.
- Calling engine codeHow engine types show up in Strata and C#, and how to expose your own.
- SamplesExample scripts
TODO
- Shipping builds (ahead-of-time compiled scripts)
