Documentation index for AI agents

GS2-Script API Reference

Lua script execution environment

Services for game-specific specifications.

Scripts can be executed by triggering various events within GS2. For example, an account initialization script can be executed by triggering the event when an account is registered. A player level-up event can trigger a script to restore stamina, for example. Scripts can be used to extend functionality when game specifications cannot be realized with standard GS2 functionality.

The language used to write scripts is Lua. Lua is a lightweight scripting language with a strong track record in the game industry, with simple syntax and high execution performance.

Scripts can be registered either by directly uploading a string, or by retrieving files via integration with a GitHub repository. By using GitHub integration, you can manage script change history in Git and operate with pull request-based review.

Script execution has a time limit set by default, and overly long scripts result in errors. Script execution time is included in the response and tallied as execution cost.

Exceptions raised within a script propagate as exceptions of the entire API call. If an exception occurs in a pre-processing script, the GS2 standard processing is not executed.

From within a script, you can call the APIs provided by GS2 directly. You can assemble logic that spans multiple microservices inside a script, such as checking the item count in GS2-Inventory before performing GS2-Account processing, or looking at the remaining amount in GS2-Stamina to determine whether a GS2-Mission has been completed.


GS2-Script SDK API Reference

Specification of models and API references for GS2-Script SDK for various programming languages

GS2-Script Deploy/CDK Reference

The template format used when creating stacks with GS2-Deploy, and implementation examples of template output in various languages using CDK

GS2-Script Transaction Actions

Specification of verify/consume/acquire transaction actions