-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to add new attributes
In general, we can only use the attributes that come from the attribute system in NF's world. We have two kinds of data that can describe as attributes: static data and dynamic data.
The static data means the data can't be changed after loaded from configuration files, normally we called it as configuration data.
The only way to change the static data is to reload it when you want to fix some error data.
The dynamic data means the data will be modified by business requirements then store into the database, normally we called it as player's data.
Each data in NF's world is an attribute(or record), it's the minimum data unit. The framework uses the excel files to design the attributes that belong the player or global static data.
Let us have a look what it look like.

We can know from the graph that there has these attributes in the entity named Player
The attribute defined in Excel files located in [_Out/Server/NFDataCfg/Excel_Ini] will be transformed into code by utilizing the NFFileProcess application that will be located in [_Out/Server/NFDataCfg/Tool] after building the framework.
Besides the property name, also type and attributes can be defined:
-
Public: Whether to inform the client of other players about changes of this attribute. For example, you may want to broadcast changes to the player level, but not to the players experience value, because other players can only see the level but not the experience points. If other players should not know about this property, set the attribute to
FALSE. -
Private: Whether to inform the client about changes to this property. If this property is only meant to be visible to the server but not to the client, this attribute should be set to
FALSE. -
Save: Whether the property should be persisted in the database (i.e. the state should be stored on logout). This attribute should be set to
FALSEfor transient properties (e.g. a calculatedtotal_hpproperty that combines character HP and equipment HP). - Cache: TODO
- Ref: TODO
- Upload: TODO
- Desc: A small description for the property.
Example:
To add the new attribute Test to the Player entity open the Player.xlsx and add a new Property like shown below:
