Skip to content
Type a keyword to search.
This page was translated with machine assistance. The Simplified Chinese version is the authoritative reference.

Other Common Command Formats

This page collects parameter formats reused by many story commands. When a command parameter says “item list”, “weather effect”, “global position”, or a similar shared format, look it up here.

Dialogue boxes, text boxes, and some common UI can use double brackets to assign colors to text. Custom colors use & in place of #.

This is [[imp:important text]], [[&ff6699ff:custom colored text]]
Color CodeUseColor ValuePreview
placePlace name#a32121
roleRole name#a32121
campFaction name#a32121
itemItem name#a32121
impImportant information#a32121
questQuest information#00ffff
mag_damageMagic damage#4489a3
phy_damagePhysical damage#bf3b25
effectEffect feedback#9a52a0
explainExplanation text#b55e1f
recoverRecovery text#6b9f52
descDescription text#9d9150

Images can also be inserted into dialogue. Common forms:

[[img:image path,size=size format]]
[[img:ui://NewUI/defence_1,size=1.8em]]
[[img:ui://NewUI/defence_1,height=50%,width=50%]]
Path TypeFormatExample
Assets resource pathAssets/resource pathAssets/BuildSource/headavata/unknown_man-head.png
FairyGUI URLui://package/resourceui://NewUI/defence_1
Role portraitrole://RoleIDrole://主角
Custom portraitavatar://character:PortraitIDavatar://character:unknown_man
Dynamic modelmodel://3D#ModelID#ActionID#ExtraInfomodel://3D#雷电男1#男长枪1#r_weapon:weaponSpear1;l_weapon:null
Common model, weaponmodel://Model#Weapon#WeaponPrefabIDmodel://Model#Weapon#weaponSpear1
Common model, buildingmodel://Model#Building#BuildingPrefabIDmodel://Model#Building#building_fort_1
Game effectmodel://Effect#EffectPrefabIDmodel://Effect#psChestFlash1

Dynamic model paths usually follow model://. Standard role models use 3D#ModelID#ActionID#ExtraInfo; $ can also be used instead of #. Weapon prefabs are under Assets/BuildSource/weapon_models/Prefabs/, building prefabs are under Assets/BuildSource/buildings/, and effect prefabs are under Assets/BuildSource/battle_effects/.

model://3D#雷电男1#男长枪1#r_weapon:weaponSpear1;l_weapon:null
model://Model#Weapon#weaponSpear1
model://Model#Building#building_fort_1
model://Effect#psChestFlash1
Size FormDescription
height=64Uses a pixel value.
height=100%Scales by percentage of the original image size.
height=2emScales by the current line-height multiplier.
size=1emFits height to one line-height and scales width proportionally.

Roles, teams, world-map objects, and teleport commands use position formats. When filling a position, first confirm whether the parameter expects a role position or a world-map coordinate.

Role positions use:

PositionCode:PositionParam
FormatDescription
0No assigned position.
1:PlaceID,FacilityIDThe role is in a place. If the facility ID is empty, the role is outside facilities.
2:TeamIDThe role is in a team.
3:ProjectIDThe role is in a project.
MapID:CoordX,CoordYGlobal position for a world-map object or team, commonly used by commands such as TELEPORT.

When a world-map object, team, teleport command, or similar parameter needs a global position, use the map and coordinates directly:

MapID:CoordX,CoordY

Restriction conditions in a specific battle table can combine multiple command fields separated by semicolons.

command1:param1;command2:param2;...commandN:paramN;
CommandDescription
playerResets the team hero list. Format: RoleID1,ResetLevel|RoleID2,ResetLevel|...; reset level -1 or empty means do not reset.
unitsResets the team’s common soldier list, using the normal card list format.
add_statAdds role attribute states. Format: TargetRoleID#StatusTable.

World-map unit control commands assign a sequence of behaviors to a team. The unit executes each command in order. If the game is saved in the middle, loading the save continues the unfinished commands. Except for special units such as dummies and monsters, most teams disband automatically when their command table ends.

1,test_map:100,100;1,test_map:100,200;99,0
CodeDescription
1Move to a world-map coordinate. Parameter: MapID:CoordX,CoordY.
2Stay in place. Parameter: stay duration in in-game days.
3Enter a place. Parameter: target place ID.
4Attack a target place. Parameter: PlaceID,CaptureMode; 0 occupies, 1 plunders.
5Stay inside the target place. Parameter: PlaceID,StayDuration.
7Execute an event. Parameter: event ID.
8Change the current StateNum value. Parameter: new StateNum.
9Permanently execute a custom movement command.
10Join a warband. Parameter: warband numeric ID.
11Play an action. Parameters: action ID, loop count, single action duration, playback object, initial frame range, and whether to continue to the next command after playback ends.
12Plunder a place. Parameter: target place ID. This code is deprecated.
13Open a chest. Parameter: chest ID.
14Execute a TimeLine action. Parameter: TimeLineID,Duration; duration defaults to -1, meaning continuous playback.
15Change the current team’s attitude toward the player. 0 neutral, 1 hostile.
16Change the current team’s movement speed. Parameter: target speed.
17Mark a trade as successful. Parameter: trade target place ID.
18Perform a trade. Parameter: trade target place ID.
19Follow a target team. Parameter: target team’s control ID.
99Disband the current team.

StateNum can mark the current state of a story-controlled team, such as 0 before reaching a position and 1 after arrival, then triggers or queries can use that value for later behavior.

The 5th parameter of an action command is the initial frame range, from 0-1. 1 means the last animation frame, and -1 picks a random frame. The 6th parameter controls whether playback continues into the next command; the default is 0, and 1 continues to the following command.

Default action IDs can use loop actions and one-shot actions. Loop actions include idle, move, walk slowly, charge, and charge-up. One-shot actions include hit reaction, dodge, block, attack, shoot, horizontal slash, downward slash, thrust, release, roar, knock-up, jump, celebrate, and death.

Default Movement Command Format for Units and Teams

Section titled “Default Movement Command Format for Units and Teams”

Dummies, monsters, and teams on the world map can set default movement modes. Scripts can also temporarily change movement modes. After a mode is assigned, the unit follows that mode as its default behavior.

MovementMode,param1[,param2,...,paramN]
Movement ModeDescription
WANDER,radius[,centerX,centerY]Wander within the specified radius. If center coordinates are omitted, the unit’s current position is used as the center.
PATROL,x1,y1,x2,y2,...,xN,yNPatrol between multiple coordinate points. If the first coordinate equals the last coordinate, patrol loops; otherwise it goes back and forth.
Other value or emptyStay still.

Item lists use compact string parameters. Multiple items are separated by |, and fields within one item are separated by commas.

ItemCode1,count1[,detailInfoTable]|ItemCode2,count2[,detailInfoTable]|...|ItemCodeN,countN[,detailInfoTable]

This format is used by item or resource lists in commands such as GETITEMS, REMOVE_ITEMS, and LOOT. The detail info table uses a key=value dictionary format, with multiple fields separated by English commas.

FieldDescription
mfAutomatically match and create affixes. Format: mf=minQuality-maxQuality[-variableValueBase]; minimum quality 0 means an affix may be omitted.
cwCreate a specified affix. Format: cw=AffixID+variableValueBase; the variable value base is usually 0-100.
wSpecifies complete affix details. Format: w=AffixID$variableCodeArray.
qvSpecifies an item attribute variable array.
pRecords the item’s purchase price.
长剑,1,mf=0-3
长剑,1,cw=吸血剑+50

Variable code arrays are written as enumValue/qualityValue pairs. For example, an affix with 3 variables can be written as 0/50/0/100/0/100.

Weather effects combine multiple effects with |. Within one effect, the weather ID and intensity are separated by a comma.

WeatherEffectID,intensity|WeatherEffectID2,intensity

Intensity 0 turns an effect off. For rain and snow, 1-50 means normal rain or snow, and 50-100 means heavy rain or heavy snow. Sandstorm, lightning, fog, and darkness use 1-100.

Weather Effect IDIntensity
0 off, 1-50 normal rain, 50-100 heavy rain.
0 off, 1-50 normal snow, 50-100 heavy snow.
风沙0 off, 1-100 intensity.
雷电0 off, 1-100 intensity.
0 off, 1-100 intensity.
黑暗0 off, 1-100 intensity.
炎热0 off, 1-100 heat distortion intensity.
0 off, 1-100 ground cloud-shadow intensity in clear weather.
chance,durationDays:weatherEffect;chance,durationDays:weatherEffect

Example:

30,1:;50,3:雨,20|雾,10;20,5:风沙,30

This means: 30% chance of no weather effect for 1 day; 50% chance of rain with fog for 3 days; 20% chance of sandstorm for 5 days.

FilterEffectID,intensity|FilterEffectID2,intensity

Supports vignette, black-and-white, and old-photo effects. Intensity 0 turns the effect off, and 1-100 controls effect strength.

Filter Effect IDIntensity
暗角0 off, 1-100 edge darkening strength.
黑白0 off, 1-100 black-and-white photo effect strength.
老旧0 off, 1-100 yellowed old-photo effect strength.

Some role table fields create special effects in story, battle, or UI. When filling these fields, prefer the fixed field names shown in the table.

FieldDescription
LIKEMarks item types the role likes, affecting favor gain speed. Format: LIKE:type1|type2|....
DEF_WEAPON_SPEEDDefault weapon speed used when the role has no equipped weapon.
FVChangeUnitAlgorithm unit coefficient used when gifts change role favor.
dg_skillReplaces this role’s dungeon skill.
attached_scriptScript event ID attached to this role in battle.
loot_listDrop list for this role in dungeon battle; 经验 can be used as an item ID to specify an EXP source.
IsNoExpelPrevents expelling this role; active when the field is not empty.
IsNoBetrayThis role will not betray or leave a faction on its own; active when the field is not empty.
CanChangeNameAllows story triggers to change the name; active when set to 1, and does not affect direct name changes by script commands.
FieldDescription
迷你地图显示Shows the minimap for places other than town maps, which display by default.
迷你地图不显示Hides the minimap.
AI出征关闭The stronghold will not proactively march, patrol, or occupy resource points.
SharedPermissionPlace ID whose trade permission is shared.

After SharedPermission is configured, this place shares trade permission with the specified place.

FieldDescription
NO_CHANGE_DIPNot affected by dynamic diplomacy changes, except direct script command changes.
UNFAILEDThe faction cannot be destroyed through normal means.
EMBARGOPlaces occupied by the faction will not send caravans and will not trade with other places.
NO_FARMERPlaces occupied by the faction will not have population movement.
CAMP_COLORSpecifies faction color. Example: CAMP_COLOR=FFFFFF.
CAMP_UI_BGSpecifies the faction info UI background.
HIDE_BY_ACTIVESTATEHides related information according to the current ActiveState.

If CAMP_COLOR is not specified, the game assigns a default color to the faction. If CAMP_UI_BG is not specified, the faction info screen uses the default background overlaid with the faction color. HIDE_BY_ACTIVESTATE only takes effect when the config table’s “hidden” field does not force hiding.

FieldDescription
IgnoreBagSpaceThe item does not take inventory space when set to 1.
NoSellOrDropThe item cannot be discarded or sold when set to 1.
BatchUseSupports batch use. The used quantity is written into arg_int_val1.
DoNotCostWhenUseThe item is not consumed on use when set to 1.
PresentGift type tag field, separated with |.
AiNotLootAI cannot obtain the item through normal means when set to 1.
MendableWhether the item can be repaired; non-repairable items are destroyed automatically when durability reaches 0.
RoleActUses a specified role model action after equipping.
DropModelModel info for this item on the ground in battle. Format: WorldMapUnitModelID#EffectInfo. If empty, def_dropitem_model from the initial settings table is used.
FieldDescription
BattleLoseStayWhether the player stays in place after losing a battle in exploration map mode.
RolePlayWhen the player is on this map, replaces the role model and name with specified role info and disables UI such as inventory and party.
FixedGameTimeFreezes the current map time to a specific time of day.
CameraFilterForces a specified camera filter when entering the map.
NoFoodConsumeThe player does not consume food and will not starve on this map.

FixedGameTime ranges from 0-1.0; for example, 0.5 means 12:00 noon. After time is frozen, world time does not advance, but units on the current map keep acting. CameraFilter uses the same format as camera filters.

FieldDescription
PlayerInitTypePlayer role initialization mode: 0 default mode, using the default role template and dungeon start position; 1 manual mode, controlled through Lua APIs.
ExpModeEXP distribution mode. Format: distributionMode[,radiusParam].
ExpMode ModeDescription
0Last-hit mode, the default. The killer alone gains EXP.
1Equal distribution mode. If the radius parameter is less than or equal to 0, all allied players share EXP equally.
2Shared distribution mode. If the radius parameter is greater than 0, EXP is shared only within the specified radius.

Item affixes are reused by multiple systems and are usually written as strings in config tables, command parameters, or effect configs.

FormDescription
AffixType:{enumInfo1,value1;enumInfo2,value2;...}General affix structure.
aPassively increases role attributes.
skillAdds an available role skill.
dg_skillReplaces the current dungeon skill.
chance1,ItemID1,minCount,maxCount[,paramTable]|chance2,ItemID2,minCount,maxCount[,paramTable]|...|chanceN,ItemIDN,minCount,maxCount[,paramTable]

Example:

100.0,金钱,100,200|50.0,经验,100,200

This means: always gain 100-200 money, and have a 50% chance to gain 100-200 EXP. The parameter table uses the same detail info format as item lists.

Item ID can be the special value QUERY, meaning it queries a drop result from the global drop table and returns it. The parameter table then specifies global drop query conditions.

chance,QUERY,minCount,maxCount[,id=DropID,lv=Level,t1=Tag1,t2=Tag2,t3=Tag3]
Query ParameterDescription
idDirectly takes the result with the specified ID from the global drop table. If present and not empty, other query conditions are ignored.
lvMatching level. -1 matches all results; 0 uses the main character’s current level.
t1Filter query TAG1.
t2Filter query TAG2.
t3Filter query TAG3.
eventTime:commandType,param1,param2,...

The event time is seconds after start. Supports shake_cam and play_sound.

Command TypeParameters
shake_camParameter 1 is shake duration; parameter 2 is intensity.
play_soundParameter 1 is sound ID.