style
esc
  • Loading…

Start hereEnma Style Guide template

Conventions for writing Enma scripts, embedding the Enma SDK, and building single-player scripts on Perception.

A Windows Premake host that embeds the Enma SDK through RAII engine, module and context owners, a script package laid out per the guide with tests beside each script, budget, permission and .emb round-trip tests, the clang-format config, and a CI workflow.

  1. 1

    Download

    Pick a name and a 2–3 letter prefix; the host, namespace, macros and solution are renamed for you.

  2. 2

    Vendor the SDK

    Copy the Enma SDK's shipped/ folder into vendor/enma/, then run tools\Setup.bat to add doctest and generate the solution.

  3. 3

    Build and test

    Build the solution in Visual Studio, then run the -Tests executable and the app from the repository root.

What you get

Project/
├── .github/
│   └── workflows/
│       └── ci.yml
├── Project/
│   ├── src/
│   │   ├── Project/
│   │   │   ├── Core/
│   │   │   │   ├── Assert.h
│   │   │   │   ├── Base.h
│   │   │   │   ├── Log.cpp
│   │   │   │   └── Log.h
│   │   │   └── Scripting/
│   │   │       ├── Addons/
│   │   │       ├── Natives/
│   │   │       │   ├── LogNatives.cpp
│   │   │       │   ├── LogNatives.test.cpp
│   │   │       │   └── Natives.h
│   │   │       ├── ScriptContext.cpp
│   │   │       ├── ScriptContext.h
│   │   │       ├── ScriptEngine.cpp
│   │   │       ├── ScriptEngine.h
│   │   │       ├── ScriptEngine.test.cpp
│   │   │       ├── ScriptError.h
│   │   │       ├── ScriptModule.cpp
│   │   │       └── ScriptModule.h
│   │   ├── Main.cpp
│   │   └── TestMain.cpp
│   └── premake5.lua
├── scripts/
│   ├── Gameplay/
│   │   ├── Spawner.em
│   │   └── Spawner.test.em
│   ├── Lib/
│   │   ├── MathUtils.em
│   │   └── MathUtils.test.em
│   └── Main.em
├── tools/
│   ├── Format.sh
│   ├── GenerateProjects.bat
│   └── Setup.bat
├── vendor/
│   └── enma/
├── .clang-format
├── .clang-tidy
├── .gitattributes
├── .gitignore
├── Dependencies.lua
├── premake5.lua
├── README.md
└── TOOLCHAIN.md