SonolusHaniwa
  • 1. 概述
  • 2. ハニプレ
  • 3. ユメステ
  • 4. Stellarity
  • 5. Phigros
  • 首页

    • 1. 概述
  • 玩家

    • 2. 安装服务
    • 3. 配置文件标准
    • 4. 服务使用方法
  • 开发者

    • 5. 自定义搜索函数
    • 6. 自定义资源创建接口
    • 7. 插件开发标准
  • 其他

    • 8. 更新日志
    • 9. 关于 srp 资源包
  • 1. 搭建开发环境
  • 2. Sonolus 基础
  • 3. 配置项目信息
  • 4. 基本数据类型
  • 5. 函数与语句块
  • 6. 注意事项
  • 1. 游玩模式基础
  • Index

    • 1. Introduce
  • Basics

    • 1. Index
    • 2. Types
    • 3. Statements
    • 4. Resources
    • 5. Projects
    • 6. Commands
  • API

    • Index
    • Macros
    • Builtins
    • Engine Options
    • Engine UI
    • Play Mode
    • Tutorial Mode
    • Preview Mode
    • Watch Mode
  • 1. 概述
  • 2. ハニプレ
  • 3. ユメステ
  • 4. Stellarity
  • 5. Phigros
  • 首页

    • 1. 概述
  • 玩家

    • 2. 安装服务
    • 3. 配置文件标准
    • 4. 服务使用方法
  • 开发者

    • 5. 自定义搜索函数
    • 6. 自定义资源创建接口
    • 7. 插件开发标准
  • 其他

    • 8. 更新日志
    • 9. 关于 srp 资源包
  • 1. 搭建开发环境
  • 2. Sonolus 基础
  • 3. 配置项目信息
  • 4. 基本数据类型
  • 5. 函数与语句块
  • 6. 注意事项
  • 1. 游玩模式基础
  • Index

    • 1. Introduce
  • Basics

    • 1. Index
    • 2. Types
    • 3. Statements
    • 4. Resources
    • 5. Projects
    • 6. Commands
  • API

    • Index
    • Macros
    • Builtins
    • Engine Options
    • Engine UI
    • Play Mode
    • Tutorial Mode
    • Preview Mode
    • Watch Mode
  • Index

    • 1. Introduce
  • Basics

    • 1. Index
    • 2. Types
    • 3. Statements
    • 4. Resources
    • 5. Projects
    • 6. Commands
  • API

    • Index
    • Macros
    • Builtins
    • Engine Options
    • Engine UI
    • Play Mode
    • Tutorial Mode
    • Preview Mode
    • Watch Mode

Play Mode

class Archetype

variable int id

The unique identifier of the archetype.

variable VariablesArray<EntityMemoryId> memory

Generic memory storage for the entity. This is accessible only by the entity itself.

variable VariablesArray<EntitySharedMemoryId> sharedMemory

Generic shared memory storage accessible by other entities.

variable EntityInfoGroup info

Contains state information of the entity. This variable is read-only in all callback functions.

variable EntityDespawnGroup despawn

Used by entities to pass despawn information back to Sonolus.

variable EntityInputGroup input

Used by entities to pass input information back to Sonolus.

variable ArchetypeLifeGroup life

Contains life configuration of the archetype.

variable string name

The name of the archetype, referenced by entities in level data. Special names have specific effects:

  • #BPM_CHANGE: Signals a BPM change. Entities with this name must also provide data named #BEAT and #BPM.
  • #TIMESCALE_CHANGE: Signals a time scale change. Entities with this name must also provide data named #BEAT and #TIMESCALE.

variable bool hasInput

If true, entities with this archetype are considered playable and contribute to judgment, combo, life, score, etc.

variable double preprocessOrder

Determines the order of the preprocess callback function. Smaller values execute earlier.

variable double spawnOrderOrder

Determines the order of the spawnOrder callback function. Smaller values execute earlier.

variable double shouldSpawnOrder

Determines the order of the shouldSpawn callback function. Smaller values execute earlier.

variable double initializeOrder

Determines the order of the initialize callback function. Smaller values execute earlier.

variable double updateSequentialOrder

Determines the order of the updateSequential callback function. Smaller values execute earlier.

variable double touchOrder

Determines the order of the touch callback function. Smaller values execute earlier.

variable double updateParallelOrder

Determines the order of the updateParallel callback function. Smaller values execute earlier.

variable double terminateOrder

Determines the order of the terminate callback function. Smaller values execute earlier.

function preprocess

Description: Callback function executed during preprocessing.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function spawnOrder

Description: Callback function executed to determine the spawn order.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function shouldSpawn

Description: Callback function executed to determine if the entity should spawn.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function initialize

Description: Callback function executed during entity initialization.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function updateSequential

Description: Callback function executed sequentially during each update cycle.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function touch

Description: Callback function executed when TouchArray is not empty.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function updateParallel

Description: Callback function executed in parallel during each update cycle.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function terminate

Description: Callback function executed during termination of the entity.

Returns:

Return TypeDescription
SonolusApiThe signature of the SonolusApi function

function defineImport

Description: Defines an import data for the EntityData block. This macro automatically allocates memory and creates a variable for the imported data.

Parameters:

ParameterTypeDefault ValueDescription
namestringrequiredThe name of the imported data. This will be used as a variable name in the code and a key in the JSON object.

function defineImportDetailed

Description: Defines a detailed import for the EntityData block, allowing a custom JSON key for the import. This macro also allocates memory and creates a variable for the imported data.

Parameters:

ParameterTypeDefault ValueDescription
varNamestringrequiredThe name of the variable in the code.
jsonNamestringrequiredThe key of the imported data in the JSON object.

function defineExport

Description: Defines an export for the replay data. This macro adds the name of the exported data to the exports list.

Parameters:

ParameterTypeDefault ValueDescription
namestringrequiredThe name of the variable in code and the exported data.

function defineExportDetailed

Description: Defines a detailed export for the replay data, allowing a custom JSON key for the export. This macro adds the export to the exports list.

Parameters:

ParameterTypeDefault ValueDescription
varNamestringrequiredThe name of the variable in the code.
jsonNamestringrequiredThe name of the exported data in the JSON object.

function BuildData

Description: Finalizes and writes the engine play data into a GZIP-compressed JSON file.

Parameters:

ParameterTypeDefault ValueDescription
...archetype classesrequiredAll the names of the archetype class

function getAid

Description: Retrieves the identifier for a given archetype class name.

Parameters:

ParameterTypeDefault ValueDescription
archetypestringrequiredThe name of the archetype class.

Returns:

Return TypeDescription
intThe ID of the archetype. If the archetype is not found, returns -1.
最近更新: 2025/8/2 12:40
Contributors: LittleYang0531
Prev
Engine UI
Next
Tutorial Mode