Script Methods Map
Engine-owned documentation. This page maps native
///@ ExportMethodfiles inSource/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:
- choose the correct runtime side (
Common,Server,Client, orMapper); - choose the correct receiver/entity family (
Game,Entity,Critter,Map,Item,Location,Player,ImGui); - preserve authoritative server boundaries and client/view-only boundaries;
- update tests and docs when exported method groups move.
Source paths inspected
All current native script method files were inspected:
Source/Scripting/ClientCritterScriptMethods.cppSource/Scripting/ClientEntityScriptMethods.cppSource/Scripting/ClientGlobalScriptMethods.cppSource/Scripting/ClientImGuiScriptMethods.cppSource/Scripting/ClientItemScriptMethods.cppSource/Scripting/ClientLocationScriptMethods.cppSource/Scripting/ClientMapScriptMethods.cppSource/Scripting/ClientPlayerScriptMethods.cppSource/Scripting/CommonGlobalScriptMethods.cppSource/Scripting/CommonImGuiScriptMethods.cppSource/Scripting/MapperGlobalScriptMethods.cppSource/Scripting/ServerCritterScriptMethods.cppSource/Scripting/ServerEntityScriptMethods.cppSource/Scripting/ServerGlobalScriptMethods.cppSource/Scripting/ServerItemScriptMethods.cppSource/Scripting/ServerLocationScriptMethods.cppSource/Scripting/ServerMapScriptMethods.cppSource/Scripting/ServerPlayerScriptMethods.cpp
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:
Common_Game_*— side-neutral global utility exposed through the game/global object.Common_ImGui_*— side-neutral ImGui wrapper methods.Server_Game_*,Server_Map_*,Server_Critter_*, etc. — authoritative server methods.Client_Game_*,Client_Map_*,Client_Critter_*, etc. — client/view/frontend methods.Mapper_Game_*— mapper/editor automation methods.
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
- Exported methods: 75
- Prefix:
Common_Game_* - Ownership: cross-side global helpers that do not require authoritative server-only state or client-only rendering state.
- Typical responsibilities:
- logging and debugger break helpers;
- quit/invoke helpers;
- resource and config reads;
- random, time, UTF-8, clipboard, open-link helpers;
- geometry helpers such as distance, direction, line angle, intervals, trace line;
- common serialization and formatting helpers.
- Tests to inspect:
Source/Tests/Test_CommonScriptMethods.cpp,Source/Tests/Test_ScriptBuiltins.cpp.
Source/Scripting/CommonImGuiScriptMethods.cpp
- Exported methods: 331
- Prefixes:
Common_Game_ImGui,Common_ImGui_* - Ownership: script-visible ImGui wrappers shared by tools/frontends that expose ImGui.
- Typical responsibilities:
- window begin/end and style stack operations;
- layout, text, widgets, popups, menus, tables, child windows;
- value editors and controls;
- draw-list or UI helper wrappers where implemented.
- Keep UI wrapper semantics here; runtime-specific UI policy belongs to client/mapper scripts or embedding-project scripts.
Server methods
Source/Scripting/ServerGlobalScriptMethods.cpp
- Exported methods: 112
- Prefix:
Server_Game_* - Ownership: authoritative game/server global operations.
- Typical responsibilities:
- create, load, unload, and destroy critters/entities;
- get/move/destroy items and item collections;
- create locations/maps and query world entities;
- call server-side global utility operations that require
ServerEngineownership.
- Related docs: ServerRuntime.md, EntityModel.md, Persistence.md.
- Tests to inspect:
Source/Tests/Test_ServerScriptMethods.cppand server runtime tests.
Source/Scripting/ServerEntityScriptMethods.cpp
- Exported methods: 24
- Prefix:
Server_Entity_* - Ownership: server-side base entity operations.
- Typical responsibilities:
- persistence toggles such as
IsPersistent/MakePersistent; - entity time-event start/count/stop/repeat/data helpers.
- persistence toggles such as
- These operations are server-only because persistence and authoritative entity scheduling belong to the server runtime.
Source/Scripting/ServerCritterScriptMethods.cpp
- Exported methods: 61
- Prefix:
Server_Critter_* - Ownership: authoritative critter operations.
- Typical responsibilities:
- script setup and init callbacks;
- movement state, movement UIDs, map/global transfer;
- player/control relationship;
- alive/knockout/dead state helpers;
- visibility, direction, item inventory operations, and view refresh.
- Related docs: ServerRuntime.md, MapsMovementGeometry.md.
Source/Scripting/ServerMapScriptMethods.cpp
- Exported methods: 73
- Prefix:
Server_Map_* - Ownership: authoritative map operations.
- Typical responsibilities:
- script setup and location lookup;
- item creation/query by id, hex, radius, or collection;
- static item lookup;
- critter lookup by id, hex, radius, path, and visibility conditions;
- map geometry, path, and movement-related queries.
- Keep state-changing world operations here rather than in common/client helpers.
Source/Scripting/ServerItemScriptMethods.cpp
- Exported methods: 12
- Prefix:
Server_Item_* - Ownership: authoritative item operations.
- Typical responsibilities:
- item script setup;
- add/query inner items;
- resolve item map position or owning critter;
- refresh item visibility.
Source/Scripting/ServerLocationScriptMethods.cpp
- Exported methods: 10
- Prefix:
Server_Location_* - Ownership: authoritative location operations.
- Typical responsibilities:
- location script setup;
- add/query maps by pid/index/id;
- return map collections;
- regenerate locations.
Source/Scripting/ServerPlayerScriptMethods.cpp
- Exported methods: 9
- Prefix:
Server_Player_* - Ownership: connected player/session operations.
- Typical responsibilities:
- host/port lookup;
- disconnect and naming;
- switch controlled critter;
- query controlled critter;
- view/reset/unload map operations.
- Related docs: ServerRuntime.md for player/connection flow.
Client methods
Source/Scripting/ClientGlobalScriptMethods.cpp
- Exported methods: 107
- Prefix:
Client_Game_* - Ownership: client-side global/runtime/frontend helpers.
- Typical responsibilities:
- current map/location/player and mouse/gamepad/window state;
- fullscreen/minimize/connection status;
- distance helpers and visible entity queries;
- atlas/resource/debug helpers;
- resolution/minimap/render-facing helpers;
- sound, music, video, sprite, and UI-adjacent helpers where exposed.
- Related docs: ClientRuntime.md, FrontendAndRendering.md.
Source/Scripting/ClientEntityScriptMethods.cpp
- Exported methods: 22
- Prefix:
Client_Entity_* - Ownership: client-side base entity time-event helpers.
- Typical responsibilities:
- start/count/stop/repeat time events;
- set time-event data.
- Mirrors part of the server entity utility surface, but acts on client-owned/view entities.
Source/Scripting/ClientCritterScriptMethods.cpp
- Exported methods: 36
- Prefix:
Client_Critter_* - Ownership: client-side visible critter/view operations.
- Typical responsibilities:
- display name, online/alive/movement/model/visibility state;
- animation availability/playback/stop/refresh;
- inventory queries on visible client-side critters;
- text position, particles, animation callbacks, bone positions;
- local movement helpers.
- Do not add authoritative inventory or transfer policy here; that belongs to server methods.
Source/Scripting/ClientMapScriptMethods.cpp
- Exported methods: 61
- Prefix:
Client_Map_* - Ownership: client-side map/view/rendering operations.
- Typical responsibilities:
- draw map sprites and entity sprites;
- rebuild fog and day colors;
- screen/scroll state;
- visible item/critter lookup by id, hex, radius, path, and collections;
- path and line tracing queries;
- coordinate conversion between map and screen.
- Related docs: ClientRuntime.md, MapsMovementGeometry.md, FrontendAndRendering.md.
Source/Scripting/ClientItemScriptMethods.cpp
- Exported methods: 15
- Prefix:
Client_Item_* - Ownership: client-side visible item/view operations.
- Typical responsibilities:
- visibility and clone helpers;
- map position and movement state;
- animation playback/time/direction;
- inner item queries;
- alpha/finish helpers.
Source/Scripting/ClientImGuiScriptMethods.cpp
- Exported methods: 4
- Prefix:
Client_ImGui_* - Ownership: client-specific ImGui image/image-button helpers.
- Typical responsibilities:
- image widgets backed by client/frontend texture or sprite resources.
- General ImGui wrappers live in
CommonImGuiScriptMethods.cpp.
Source/Scripting/ClientLocationScriptMethods.cpp
- Exported methods: 0
- Ownership: reserved/empty client-side location method group.
- Keep this file as a routing marker unless client location methods are actually added.
Source/Scripting/ClientPlayerScriptMethods.cpp
- Exported methods: 0
- Ownership: reserved/empty client-side player method group.
- Player/session authority remains server-owned; add client methods here only for genuinely client-owned player view behavior.
Mapper methods
Source/Scripting/MapperGlobalScriptMethods.cpp
- Exported methods: 44
- Prefix:
Mapper_Game_* - Ownership: mapper/editor automation.
- Typical responsibilities:
- add/delete/move/select entities;
- add tiles;
- load/unload/save/show maps;
- query loaded map files;
- resize maps;
- manage mapper tabs and tab pid filters.
- Related docs: MapperTools.md.
Adding or moving exported methods
Use this checklist before editing a *ScriptMethods.cpp file:
- Identify the side that owns the state: common utility, server authority, client view/frontend, or mapper editor.
- Identify the receiver family: global/game, entity, critter, map, item, location, player, ImGui, or another registered type.
- Add
///@ ExportMethodandFO_SCRIPT_APIin the owning file. - Apply
FO_NULLABLEonly when a pointer parameter/return genuinely accepts or returns null; see Nullability.md. - Regenerate code so method descriptors and wrappers reflect the new signature.
- Add or update the smallest relevant script method tests.
- Update this page if a file is added/removed or a group meaning changes.
Validation checklist
- Recount
///@ ExportMethoddeclarations after large API changes. - Run code generation and compile generated wrappers.
- Run the relevant method tests:
- common methods:
Source/Tests/Test_CommonScriptMethods.cpp; - server methods:
Source/Tests/Test_ServerScriptMethods.cppplus relevant server runtime tests; - entity/handle behavior:
Source/Tests/Test_ScriptEntityOps.cpp; - builtins/types:
Source/Tests/Test_ScriptBuiltins.cpp.
- common methods:
- Run nullable analyzers if any pointer signature changed.
- Validate runtime behavior on the owning side; compilation alone does not prove that a method belongs on that side.