Skip to main content

Table Configuration Example

This is just a simple demonstration. For details, please read Table Configuration Standards and Field Types.

There's also a randomly configured itemTable.xlsx for entertainment reference~

Below is a simple example, assuming there's an item.xlsx table:

item: Data Sheet

tip

The first row of the data sheet defines the field names, which correspond to the field names defined in the first column of the property sheet. The order can be different.

ABCDE
Item IDItem NameDescriptionMax CountDaily Limit
101BeansBasic currency for trading99999999100000
102DiamondsCurrency for trading rare items99999999
1001HP PotionWith this, you can do whatever you want999999

property: Property Sheet

tip

Column A of the property sheet defines the field name, Column B defines the variable name, Column C defines the type, Column D defines the default value (optional), Column E defines the attributes (optional), and the following columns are up to you.
The order of the property sheet can be customized through the table generation parameter --property-order, with the default being ABCDE.

ABCDEF
Item IDidintSome functional comments
Item Namenamestringrequired
Descriptiondescstring
Secretly Deleted by PlannerwtfuintdeprecatedIt's better to keep fields even if not used, just mark them as deprecated
Max Countmaxnumber9999Maximum quantity a player can have
Daily LimitdailyLimitnumberMaximum daily acquisition limit

x2f table generation will automatically generate the following structure description (.fbs) file:

// item.xlsx

namespace Xlsx;

table ItemInfo {
/// Item ID
id:int;
/// Item Name
name:string (required);
/// Description
desc:string;
/// Secretly Deleted by Planner
wtf:uint (deprecated);
/// Max Count
max:uint = 9999;
/// Daily Limit
daily_limit:uint;
}

table Item {
item_infos:[ItemInfo];
}

root_type Item;