View on GitHub

FOnline Engine

Flexible cross-platform isometric game engine

Script Methods Map

Engine-owned documentation. This page maps native ///@ ExportMethod files in Source/Scripting/ to their script-facing responsibilities. It complements Scripting.md; it is not a full generated API reference.

Purpose

Use this page when adding, moving, or reviewing script-visible native methods. The goal is to keep method ownership obvious before editing codegen inputs:

Source paths inspected

All current native script method files were inspected:

The current set contains 996 ///@ ExportMethod declarations across these files.

Naming and ownership conventions

Exported functions are C++ functions with FO_SCRIPT_API and a generated-script name derived from the side/type prefix. Common patterns:

The prefix is part of the ownership contract. Do not move a method to a more convenient file if that changes who owns the state it mutates.

Common methods

Source/Scripting/CommonGlobalScriptMethods.cpp

Source/Scripting/CommonImGuiScriptMethods.cpp

Server methods

Source/Scripting/ServerGlobalScriptMethods.cpp

Source/Scripting/ServerEntityScriptMethods.cpp

Source/Scripting/ServerCritterScriptMethods.cpp

Source/Scripting/ServerMapScriptMethods.cpp

Source/Scripting/ServerItemScriptMethods.cpp

Source/Scripting/ServerLocationScriptMethods.cpp

Source/Scripting/ServerPlayerScriptMethods.cpp

Client methods

Source/Scripting/ClientGlobalScriptMethods.cpp

Source/Scripting/ClientEntityScriptMethods.cpp

Source/Scripting/ClientCritterScriptMethods.cpp

Source/Scripting/ClientMapScriptMethods.cpp

Source/Scripting/ClientItemScriptMethods.cpp

Source/Scripting/ClientImGuiScriptMethods.cpp

Source/Scripting/ClientLocationScriptMethods.cpp

Source/Scripting/ClientPlayerScriptMethods.cpp

Mapper methods

Source/Scripting/MapperGlobalScriptMethods.cpp

Adding or moving exported methods

Use this checklist before editing a *ScriptMethods.cpp file:

  1. Identify the side that owns the state: common utility, server authority, client view/frontend, or mapper editor.
  2. Identify the receiver family: global/game, entity, critter, map, item, location, player, ImGui, or another registered type.
  3. Add ///@ ExportMethod and FO_SCRIPT_API in the owning file.
  4. Apply FO_NULLABLE only when a pointer parameter/return genuinely accepts or returns null; see Nullability.md.
  5. Regenerate code so method descriptors and wrappers reflect the new signature.
  6. Add or update the smallest relevant script method tests.
  7. Update this page if a file is added/removed or a group meaning changes.

Validation checklist

  1. Recount ///@ ExportMethod declarations after large API changes.
  2. Run code generation and compile generated wrappers.
  3. Run the relevant method tests:
    • common methods: Source/Tests/Test_CommonScriptMethods.cpp;
    • server methods: Source/Tests/Test_ServerScriptMethods.cpp plus relevant server runtime tests;
    • entity/handle behavior: Source/Tests/Test_ScriptEntityOps.cpp;
    • builtins/types: Source/Tests/Test_ScriptBuiltins.cpp.
  4. Run nullable analyzers if any pointer signature changed.
  5. Validate runtime behavior on the owning side; compilation alone does not prove that a method belongs on that side.