Config||doc135364

September 20, 2022

Config

Introduction

Configuration information defines the basic content of an Object. It is the basic unit of all elements that make up the game. Using the Block as an example, configuration information determines its external appearance, size of its collision body, whether it can be clicked or destroyed, etc. For an Entity, configuration determines its model when placed in the scene, as well as other basic properties like HP, movement speed, jump height, etc.

How to define a configuration information

Configuration information cannot be defined during the game, so it is necessary to define the required configuration before the game runs. In the component library and game resources of Blockman Editor, there is a convenient method to define configuration information that can be accessed in their respective panels via the to create a new template. The newly created configuration information will have the default properties of the Class that it belongs.


What types of configuration information the editor can define

In the editor, the types of configuration information we can define are blocks, entity, item, buffs, skills and projectiles, etc. We call these types modules, and all modules are under the plugin location, so it is often seen that the full name of a configuration information is "myplugin/" at the beginning + the template name of this configuration information.

What is the role of configuration information in the code

Usually, obtaining a configuration information is mainly used to register the trigger processing function of the template and check the trigger in the configuration information and trigger it. The registration and triggering of specific triggers can be found in hereCheck.


Global configuration information definition

Global configuration is a special configuration information that can be accessed throughWorld.cfgto get the global configuration. It determines the changes of the game stage and game state of the entire game, the number of players and the default team allocation, etc. in the editor viaGame settings entry, to define some global configuration. It can also be used to register global trigger handlers.

Properties

string fullName

Configuration information full name

string modName

module name

string plugin

plugin name

string displayName

Configure display name

table collider

Collision Box Data

Function

table<string, variant> Entity.GetCfgstring fullName )
Get configuration information for an Entity
table<string, variant> DropItem.GetCfgstring fullName )
Get configuration information for a DropItem
table<string, variant> Missile.GetCfgstring fullName )
Get configuration information for a Missile
table<string, variant> Entity.TryBuffCfgstring fullName )
Get configuration information for a Buff
table<string, variant> Skill.Cfgstring fullName )
Get configuration information for a Skill