├── _csharp-api ├── core │ ├── README.md │ ├── game.md │ ├── gamemodel.md │ ├── itemobject.md │ ├── informationmanager.md │ ├── basiccharacterobject.md │ └── mbobjectmanager.md ├── engine │ ├── README.md │ ├── globallayer.md │ ├── gameentity.md │ ├── scene.md │ └── scriptcomponentbehaviour.md ├── inputsystem │ ├── README.md │ └── input.md ├── library │ ├── README.md │ └── moduleinfo.md ├── network │ └── README.md ├── mountandblade │ ├── README.md │ ├── team.md │ ├── mission.md │ ├── missionbehaviour │ │ ├── missionview.md │ │ ├── missionlogic.md │ │ └── README.md │ ├── mbinitialscreenbase.md │ ├── mbsubmodulebase.md │ └── agent.md ├── campaignsystem │ ├── README.md │ ├── settlement.md │ ├── actions │ │ └── ChangeOwnerOfSettlementAction.md │ ├── gamemenu.md │ ├── TournamentGame.md │ ├── campaigngamestarter.md │ ├── campaignbehaviorbase.md │ └── hero.md ├── twodimension │ └── README.md ├── platformservice │ └── README.md ├── README.md ├── localization │ ├── MBTextManager.md │ ├── TextObject.md │ └── README.md └── savesystem │ └── README.md ├── _intro ├── README.md ├── advanced.md ├── general-recommendations.md ├── getting-started.md └── folder-structure.md ├── _tutorials ├── README.md ├── bannertutorial.md ├── packing_mods_for_vortex.md ├── modding-gauntlet-without-csharp.md ├── new_settlements.md └── basic-csharp-mod.md ├── _xmldocs ├── README.md ├── atmosphere.md ├── SPCultures │ ├── README.md │ └── Culture │ │ ├── clan_names │ │ ├── README.md │ │ └── name │ │ │ └── README.md │ │ ├── male_names │ │ ├── README.md │ │ └── name │ │ │ └── README.md │ │ ├── female_names │ │ ├── README.md │ │ └── name │ │ │ └── README.md │ │ └── README.md ├── NPCCharacters │ ├── README.md │ └── NPCCharacter │ │ ├── Traits │ │ ├── README.md │ │ └── Trait │ │ │ └── README.md │ │ ├── face │ │ ├── hair_tags │ │ │ ├── README.md │ │ │ └── hair_tag │ │ │ │ └── README.md │ │ ├── beard_tags │ │ │ ├── README.md │ │ │ └── beard_tag │ │ │ │ └── README.md │ │ ├── README.md │ │ ├── face_key_template │ │ │ └── README.md │ │ ├── BodyProperties │ │ │ └── README.md │ │ └── BodyPropertiesMax │ │ │ └── README.md │ │ ├── skills │ │ ├── README.md │ │ └── skill │ │ │ └── README.md │ │ ├── upgrade_targets │ │ ├── README.md │ │ └── upgrade_target │ │ │ └── README.md │ │ ├── equipmentSet │ │ ├── README.md │ │ └── equipment │ │ │ └── README.md │ │ ├── equipment │ │ └── README.md │ │ └── README.md ├── Items │ ├── CraftedItem │ │ ├── Pieces │ │ │ ├── README.md │ │ │ └── Piece │ │ │ │ └── README.md │ │ └── README.md │ ├── README.md │ └── Item │ │ ├── ItemComponent │ │ ├── Horse │ │ │ ├── Materials │ │ │ │ ├── README.md │ │ │ │ └── Material │ │ │ │ │ ├── MeshMultipliers │ │ │ │ │ ├── README.md │ │ │ │ │ └── MeshMultiplier │ │ │ │ │ │ └── README.md │ │ │ │ │ └── README.md │ │ │ └── README.md │ │ ├── README.md │ │ ├── Food │ │ │ └── README.md │ │ ├── Armor │ │ │ └── README.md │ │ └── Weapon │ │ │ ├── README.md │ │ │ └── WeaponFlags │ │ │ └── README.md │ │ ├── Flags │ │ └── README.md │ │ └── README.md ├── Scenes │ ├── Scene │ │ ├── TerrainTypes │ │ │ ├── README.md │ │ │ └── TerrainType │ │ │ │ └── README.md │ │ ├── GameType │ │ │ └── README.md │ │ └── README.md │ └── README.md ├── scene.md ├── cultures.md ├── items.md ├── npccharacters.md └── submodule.md ├── _gauntlet ├── brush.md ├── scenelayer.md ├── viewmodel.md ├── gauntletlayer.md ├── gauntletmovie.md ├── gauntletview.md ├── README.md ├── screenmanager.md ├── movie.md ├── widget.md └── screenbase.md ├── LICENSE ├── README.md └── ru └── _intro ├── folder-structure.md └── getting-started.md /_csharp-api/core/README.md: -------------------------------------------------------------------------------- 1 | # Core 2 | 3 | -------------------------------------------------------------------------------- /_intro/README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | -------------------------------------------------------------------------------- /_tutorials/README.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/engine/README.md: -------------------------------------------------------------------------------- 1 | # Engine 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/inputsystem/README.md: -------------------------------------------------------------------------------- 1 | # Input System -------------------------------------------------------------------------------- /_csharp-api/library/README.md: -------------------------------------------------------------------------------- 1 | # Library 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/network/README.md: -------------------------------------------------------------------------------- 1 | # Network 2 | 3 | -------------------------------------------------------------------------------- /_xmldocs/README.md: -------------------------------------------------------------------------------- 1 | # XML Documentation 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/README.md: -------------------------------------------------------------------------------- 1 | # Mount And Blade -------------------------------------------------------------------------------- /_csharp-api/core/game.md: -------------------------------------------------------------------------------- 1 | # Game 2 | 3 | Work In Progress. -------------------------------------------------------------------------------- /_gauntlet/brush.md: -------------------------------------------------------------------------------- 1 | # Brush 2 | 3 | **Work in progress** -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/README.md: -------------------------------------------------------------------------------- 1 | # Campaign System 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/twodimension/README.md: -------------------------------------------------------------------------------- 1 | # Two Dimension 2 | 3 | -------------------------------------------------------------------------------- /_csharp-api/platformservice/README.md: -------------------------------------------------------------------------------- 1 | # Platform Service 2 | 3 | -------------------------------------------------------------------------------- /_gauntlet/scenelayer.md: -------------------------------------------------------------------------------- 1 | # SceneLayer 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_gauntlet/viewmodel.md: -------------------------------------------------------------------------------- 1 | # ViewModel 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_csharp-api/core/gamemodel.md: -------------------------------------------------------------------------------- 1 | # GameModel 2 | **NOTE**: Work in progress. 3 | -------------------------------------------------------------------------------- /_csharp-api/core/itemobject.md: -------------------------------------------------------------------------------- 1 | # ItemObject 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/team.md: -------------------------------------------------------------------------------- 1 | # Team 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_gauntlet/gauntletlayer.md: -------------------------------------------------------------------------------- 1 | # GauntletLayer 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_gauntlet/gauntletmovie.md: -------------------------------------------------------------------------------- 1 | # GauntletMovie 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_gauntlet/gauntletview.md: -------------------------------------------------------------------------------- 1 | # GauntletView 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_xmldocs/atmosphere.md: -------------------------------------------------------------------------------- 1 | # Atmosphere (XML) 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_csharp-api/engine/globallayer.md: -------------------------------------------------------------------------------- 1 | # GlobalLayer 2 | 3 | Work in Progress 4 | 5 | -------------------------------------------------------------------------------- /_csharp-api/README.md: -------------------------------------------------------------------------------- 1 | # C# API Documentation 2 | 3 | ### Note: All Gauntlet related documentation is available [here.](../_gauntlet) 4 | -------------------------------------------------------------------------------- /_xmldocs/SPCultures/README.md: -------------------------------------------------------------------------------- 1 | # SPCultures 2 | 3 | ## Parent node 4 | - *None* 5 | 6 | ## Child nodes 7 | - [Culture](Culture) 8 | 9 | ## Attributes 10 | None -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/clan_names/README.md: -------------------------------------------------------------------------------- 1 | # clan_names 2 | 3 | ## Parent node 4 | - [Culture](../../Culture) 5 | 6 | ## Child node 7 | - [name](name) 8 | 9 | ## Attributes -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/male_names/README.md: -------------------------------------------------------------------------------- 1 | # male_names 2 | 3 | ## Parent node 4 | - [Culture](../../Culture) 5 | 6 | ## Child node 7 | - [name](name) 8 | 9 | ## Attributes -------------------------------------------------------------------------------- /_gauntlet/README.md: -------------------------------------------------------------------------------- 1 | # Gauntlet 2 | 3 | Gauntlet is Bannerlord's UI System, It uses the MVVM design pattern which will be familiar to anyone who has developed for frameworks such as WPF. -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/README.md: -------------------------------------------------------------------------------- 1 | # NPCCharacters 2 | 3 | ## Parent node 4 | - *None* 5 | 6 | ## Child nodes 7 | - [NPCCharacter](NPCCharacter) 8 | 9 | ## Attributes 10 | None -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/female_names/README.md: -------------------------------------------------------------------------------- 1 | # female_names 2 | 3 | ## Parent node 4 | - [Culture](../../Culture) 5 | 6 | ## Child node 7 | - [name](name) 8 | 9 | ## Attributes -------------------------------------------------------------------------------- /_xmldocs/Items/CraftedItem/Pieces/README.md: -------------------------------------------------------------------------------- 1 | # Pieces 2 | The Pieces node has no attributes. 3 | 4 | ## Parent node 5 | - [Item](../../CraftedItem) 6 | 7 | ## Child nodes 8 | - [Piece](Piece) -------------------------------------------------------------------------------- /_xmldocs/Scenes/Scene/TerrainTypes/README.md: -------------------------------------------------------------------------------- 1 | # TerrainType 2 | 3 | ## Parent node 4 | - [Scene](../../Scene) 5 | 6 | ## Child nodes 7 | - [TerrainType](TerrainType) 8 | 9 | ## Attributes 10 | None -------------------------------------------------------------------------------- /_xmldocs/Items/README.md: -------------------------------------------------------------------------------- 1 | # 物品(大类) Items 2 | 3 | ## 父节点 Parent node 4 | - *无 None* 5 | 6 | ## 子节点 Child node 7 | - [物品 Item](Item) 8 | - [物品(制作) CraftedItem](CraftedItem) 9 | 10 | ## 属性 Attributes 11 | 无 -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/Traits/README.md: -------------------------------------------------------------------------------- 1 | # Traits 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - [Trait](Trait) 8 | 9 | ## Attributes 10 | *None* -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/hair_tags/README.md: -------------------------------------------------------------------------------- 1 | # hair_tags 2 | 3 | ## Parent node 4 | - [face](../../face) 5 | 6 | ## Child nodes 7 | - [hair_tag](hair_tag) 8 | 9 | ## Attributes 10 | *None* -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/skills/README.md: -------------------------------------------------------------------------------- 1 | # skills 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - [skill](skill) 8 | 9 | ## Attributes 10 | *None* -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/beard_tags/README.md: -------------------------------------------------------------------------------- 1 | # beard_tags 2 | 3 | ## Parent node 4 | - [face](../../face) 5 | 6 | ## Child nodes 7 | - [NPCCharacter](NPCCharacter) 8 | 9 | ## Attributes 10 | None -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Horse/Materials/README.md: -------------------------------------------------------------------------------- 1 | # Materials 2 | 3 | ## Parent node 4 | - [Horse](../../Horse) 5 | 6 | ## Child nodes 7 | - [Material](Material) 8 | 9 | ## Attributes 10 | The Materials node has no attributes. -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/upgrade_targets/README.md: -------------------------------------------------------------------------------- 1 | # upgrade_targets 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - [upgrade_target](upgrade_target) 8 | 9 | ## Attributes 10 | *None* -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/README.md: -------------------------------------------------------------------------------- 1 | # 物品组件 ItemComponent 2 | 没有属性 3 | 4 | ## 父节点 Parent node 5 | - [物品 Item](../../Item) 6 | 7 | ## 子节点 Child nodes 8 | - [防具 Armour](Armor) 9 | - [食物 Food](Food) 10 | - [马匹 Horse](Horse) 11 | - [武器 Weapon](Weapon) -------------------------------------------------------------------------------- /_xmldocs/Scenes/README.md: -------------------------------------------------------------------------------- 1 | # Scenes 2 | 3 | *Named as SPBattleScenes in SandBox Module* 4 | *Named as CustomBattleScenes in SandBoxCore* 5 | 6 | ## Parent node 7 | - *None* 8 | 9 | ## Child nodes 10 | - [Scene](Scene) 11 | 12 | ## Attributes 13 | None -------------------------------------------------------------------------------- /_xmldocs/scene.md: -------------------------------------------------------------------------------- 1 | # Scenes (XML) 2 | 3 | ## Scenes documentation 4 | 5 | - [Scenes](Scenes) 6 | - [Scene](Scenes/Scene) 7 | - [TerrainTypes](Scenes/Scene/TerrainTypes) 8 | - [TerrainType](Scenes/Scene/TerrainTypes/TerrainType) 9 | - [GameType](Scenes/Scene/GameType) 10 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/README.md: -------------------------------------------------------------------------------- 1 | # MeshMultipliers 2 | 3 | ## Parent node 4 | - [Material](../../Material) 5 | 6 | ## Child nodes 7 | - [MeshMultiplier](MeshMultiplier) 8 | 9 | ## Attributes 10 | The MeshMultiplier node has no attributes. -------------------------------------------------------------------------------- /_csharp-api/core/informationmanager.md: -------------------------------------------------------------------------------- 1 | # InformationManager 2 | 3 | InformationManager是一种向提示信息(例如:伤害)输出文本,或者向玩家显示提问(例如:是/否 确认)的的高级手段。 4 | 5 | ## 输出至提示信息 6 | 7 | ```csharp 8 | InformationManager.DisplayMessage() 9 | ``` 10 | 11 | ## 显示提问 12 | 13 | ```csharp 14 | InformationManager.ShowInquiry() 15 | ``` 16 | 17 | -------------------------------------------------------------------------------- /_xmldocs/cultures.md: -------------------------------------------------------------------------------- 1 | # SPCultures (XML) 2 | 3 | ## SPCultures documentation 4 | 5 | - [SPCultures](SPCultures) 6 | - [Culture](SPCultures/Culture) 7 | - [clan_names](SPCultures/Culture/clan_names) 8 | - [female_names](SPCultures/Culture/female_names) 9 | - [male_names](SPCultures/Culture/male_names) 10 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Food/README.md: -------------------------------------------------------------------------------- 1 | # 食物 Food 2 | 3 | ## 父节点 Parent Node 4 | - [ItemComponent](../../ItemComponent) 5 | 6 | ## 子节点 Child Node 7 | - *无 None* 8 | 9 | ## attributes 10 | [士气加成 morale_bonus](#morale_bonus) 11 | 12 | - #### morale_bonus 13 | **类型:** `int` 14 | **例子:** `2` 15 | *对部队士气的加成* 16 | -------------------------------------------------------------------------------- /_intro/advanced.md: -------------------------------------------------------------------------------- 1 | # 高级用法 2 | 3 | ## [Harmony](https://github.com/pardeike/Harmony) 4 | 5 | 6 | 7 | Harmony 是在多个其它游戏中得到应用的,广受欢迎的库。它可以针对运行中的程序与DLL进行功能性的修改(这些改动并非永久性的,它们只在这次运行中生效) 8 | 9 | _注意,如果多个Mod尝试修改相同的方法,这可能导致冲突。因此,它应该只在必需时使用。_ 10 | 11 | 关于这个库,典型的用法是在特定的方法被执行[之前/之后]再执行。 12 | 13 | 但是,它也可以使你自己编写的方法完全取代内置方法,或者追加独立IL instructions \(谨慎使用) -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/settlement.md: -------------------------------------------------------------------------------- 1 | # Settlement 2 | 3 | Settlements are villages, castles, or towns on the campaign map. 4 | 5 | ## Tips 6 | 7 | * You can get the current settlement with `Settlement.CurrentSettlement` assuming player is in the settlement. 8 | 9 | ## Functions 10 | Work in Progress 11 | 12 | ## Properties 13 | Work in Progress 14 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/README.md: -------------------------------------------------------------------------------- 1 | # Face 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - [beard_tags](beard_tags) 8 | - [BodyProperties](BodyProperties) 9 | - [BodyPropertiesMax](BodyPropertiesMax) 10 | - [face_key_template](face_key_template) 11 | - [hair_tags](hair_tags) 12 | 13 | ## Attributes 14 | *None* -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/README.md: -------------------------------------------------------------------------------- 1 | # Material 2 | 3 | ## Parent node 4 | - [Materials](../../Materials) 5 | 6 | ## Child nodes 7 | - [MeshMultiplier](MeshMultipliers/MeshMultiplier) 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **类型:** `string` 14 | **例子:** `horse_brown_mat` 15 | *TODO: figure out what name references* 16 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/mission.md: -------------------------------------------------------------------------------- 1 | # Mission 2 | 3 | 所谓任务\(`Mission`\),可以理解成游戏模式`GameMode`(如战场`Battle`,死斗`TeamDeathMatch`之类)。当任务实例化的时候,同时还会生成的实例有:场景[Scene](../engine/scene.md),任务视图[MissionViews](missionbehaviour/missionview.md),还有任务行为[MissionBehaviours](missionbehaviour/README.md)。 4 | 5 | 更多关于任务的相关信息,要等我们\(文档原作者\)获得`CampaignSystem`的DLL的访问权。 6 | 7 | ## 小贴士 8 | 9 | * 你可以通过 `Mission.Current` 属性获取当前任务下的实例\(假如有任何实例的话\)。 -------------------------------------------------------------------------------- /_gauntlet/screenmanager.md: -------------------------------------------------------------------------------- 1 | # ScreenManager 2 | 3 | 如果你打算做任何与Gauntlet相关的东西(例如:UI),你就必须熟悉Screen Manager。 4 | 5 | The Screen Manager can be used to push screens \(which may load [Movies](movie.md)\), check which screen is focused or top-most, or pop a screen when you are done with it. 6 | 7 | Screen Manager可以用来将screen入栈(push) \(这可能加载 [Movies](movie.md)\),检查哪个screen当前正在被指向(focused)、或在顶端(topmost),或者将已经完成的screen出栈(pop)。 8 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/face_key_template/README.md: -------------------------------------------------------------------------------- 1 | # face_key_template 2 | 3 | ## Parent node 4 | - [face](../../face) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [value](#value) 11 | 12 | - #### value 13 | **type:** `NPCCharacter reference` 14 | **example:** `NPCCharacter.villager_empire` 15 | *Reference to the NPCCharacter (copies the face of that NPC)* 16 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/equipmentSet/README.md: -------------------------------------------------------------------------------- 1 | # equipmentSet 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - [equipment](equipment) 8 | 9 | ## Attributes 10 | [civilian](#civilian) 11 | 12 | - #### civilian 13 | **type:** `boolean` 14 | **accepted values:** `true` | `false` 15 | **example:** `true` 16 | *If the equipment set is for civilian use* -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/clan_names/name/README.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | ## Parent node 4 | - [Culture](../../clan_names) 5 | 6 | ## Child node 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `string` 14 | **example:** `{=6pAsFGvw}Abeil` 15 | *Note: The prefix in the `{=}` format is the translation id found in strings.txt* 16 | *TODO: Find out if this is auto generated.* -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/male_names/name/README.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | ## Parent node 4 | - [Culture](../../male_names) 5 | 6 | ## Child node 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `string` 14 | **example:** `{=6pAsFGvw}Abeil` 15 | *Note: The prefix in the `{=}` format is the translation id found in strings.txt* 16 | *TODO: Find out if this is auto generated.* -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/female_names/name/README.md: -------------------------------------------------------------------------------- 1 | # name 2 | 3 | ## Parent node 4 | - [Culture](../../female_names) 5 | 6 | ## Child node 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `string` 14 | **example:** `{=6pAsFGvw}Abeil` 15 | *Note: The prefix in the `{=}` format is the translation id found in strings.txt* 16 | *TODO: Find out if this is auto generated.* -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/upgrade_targets/upgrade_target/README.md: -------------------------------------------------------------------------------- 1 | # upgrade_target 2 | 3 | ## Parent node 4 | - [upgrade_targets](../../upgrade_targets) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id) 11 | 12 | - #### id 13 | **type:** `NPCCharacter reference` 14 | **example:** `NPCCharacter.aserai_tribesman` 15 | *The reference to the NPCCharacter this troop can upgrade to* 16 | -------------------------------------------------------------------------------- /_xmldocs/Scenes/Scene/GameType/README.md: -------------------------------------------------------------------------------- 1 | # GameType 2 | *Currently used in Multiplayer only* 3 | 4 | ## Parent node 5 | - [Scenes](../../Scene) 6 | 7 | ## Child nodes 8 | - *None* 9 | 10 | ## Attributes 11 | [name](#name) 12 | 13 | - #### name 14 | **type:** `string` 15 | **possbile values:** `Captain` | `TeamDeathmatch` | `Skirmish` | `FreeForAll` | `Duel` | `Siege` 16 | **example:** `Captain` 17 | *The GameType of the Scene* -------------------------------------------------------------------------------- /_xmldocs/Scenes/Scene/TerrainTypes/TerrainType/README.md: -------------------------------------------------------------------------------- 1 | # TerrainType 2 | 3 | ## Parent node 4 | - [TerrainTypes](../../TerrainTypes) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `string` 14 | **possible values:** `River` | `Forest` | `Water` | `Dune` | `Mountain` | `Canyon` | `Lake` 15 | **example:** `{=!}battle_terrain_a (Plain)` 16 | *The name of the TerrainType* 17 | -------------------------------------------------------------------------------- /_csharp-api/library/moduleinfo.md: -------------------------------------------------------------------------------- 1 | # ModuleInfo 2 | 3 | `ModuleInfo`类里放的是Mod的详细资料。 4 | 5 | 我们可以把所有**已加载**的Mod的详细资料\(它们各自的`ModuleInfo`\)读取到一个列表`List`里面如: 6 | 7 | ```csharp 8 | var loadedMods = new List(); 9 | foreach(var moduleName in Utilities.GetModulesNames()) 10 | { 11 | var moduleInfo = new ModuleInfo(); 12 | moduleInfo.Load(moduleName); 13 | loadedMods.Add(moduleInfo); 14 | } 15 | ``` 16 | 17 | 通过这个方法,我们随后可以用来判断某个Mod加载了没有。当Mod之间存在依赖关系,但又是非必须的依赖关系时会很有用。 -------------------------------------------------------------------------------- /_csharp-api/core/basiccharacterobject.md: -------------------------------------------------------------------------------- 1 | # BasicCharacterObject 2 | 3 | `BasicCharacterObjects` 包含了 `npccharacters` XML 文件中的反序列化信息。每个被定义的角色有 `BodyProperties`, `Equipment`, `Level`, `Skills`, 和 `Culture` 信息。 4 | 5 | `BasicCharacterObjects` 一般用来构建 [Agents](../mountandblade/agent.md) 的区块。 6 | 7 | 你可以用 [MBObjectManager](mbobjectmanager.md) 来获取一个加载后的 `BasicCharacterObject` ,代码如下: 8 | 9 | ```csharp 10 | MBObjectManager.Instance.GetObject("example_troop_id"); 11 | ``` 12 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/beard_tags/beard_tag/README.md: -------------------------------------------------------------------------------- 1 | # beard_tag 2 | 3 | ## Parent node 4 | - [beard_tags](../../beard_tags) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `Beard reference` 14 | **possible values:** `DroopyMustache` | `MediumMustache` | `Cleanshaven` | `LightShortBeard` | `HeavyShortBeard` 15 | **example:** `DroopyMustache` 16 | *The name of the beard it references* 17 | 18 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/Traits/Trait/README.md: -------------------------------------------------------------------------------- 1 | # Trait 2 | 3 | ## Parent node 4 | - [Traits](../../Traits) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id) | [value](#value) 11 | 12 | - #### id 13 | **type:** `Trait reference` 14 | **possible values:** `Smuggler` | `Thug` | `IsEquipmentTemplate` 15 | **example:** `Smuggler` 16 | *The reference to the trait id* 17 | 18 | - #### value 19 | **type:** `int` 20 | **example:** `1` 21 | *The amount of trait points* 22 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier/README.md: -------------------------------------------------------------------------------- 1 | # MeshMultiplier 2 | 3 | ## Parent node 4 | - [Material](../../MeshMultipliers) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [mesh_multiplier](#mesh_multiplier) | [percentage](#percentage) 11 | 12 | - #### mesh_multiplier 13 | **类型:** `hex` 14 | **例子:** `FF303030` 15 | *TODO: figure out what this does* 16 | - #### percentage 17 | **类型:** `float` 18 | **例子:** `0.75` 19 | *TODO: figure out what this does* -------------------------------------------------------------------------------- /_gauntlet/movie.md: -------------------------------------------------------------------------------- 1 | # Movie \(XML\) 2 | 3 | 当你打开任何新的 [GauntletView](gauntletview.md) 或者 [ScreenBase](screenbase.md)时可以使用Movie。 4 | 它们通过 [GauntletMovie](gauntletmovie.md) 类加载。 5 | 6 | 使用Movie的模板如下: 7 | 8 | ```markup 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ``` 24 | 25 | 你将花费大部分时间,在向`Window`元素添加子元素上。 26 | -------------------------------------------------------------------------------- /_tutorials/bannertutorial.md: -------------------------------------------------------------------------------- 1 | # Making Banners 2 | You can make banners using the [Banner Editor](https://bannerlord.party/banner/), made by reddit user [BizzFarts](https://www.reddit.com/user/bizzfarts/). 3 | The given code can be used as an entry for the common tag *'banner_key'*, an example of this is seen in the SandBox\spclan.xml. Also, you can post and discuss banner designs on [r/BannerlordBanners](https://www.reddit.com/r/BannerlordBanners/). 4 | 5 | After you have finished your banner design, you can copy the code and paste it into the Game's Banner editor. This is useful for seeing what your design will look like in-game. 6 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/hair_tags/hair_tag/README.md: -------------------------------------------------------------------------------- 1 | # hair_tag 2 | 3 | ## Parent node 4 | - [hair_tags](../../hair_tags) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [name](#name) 11 | 12 | - #### name 13 | **type:** `Hair reference` 14 | **possible values:** `Short` | `SlickedLong` | `Bald` | `ShortAndThin` | `Tousled` | `Bobbed` | `RestingOnShoulders` | `ShoulderLengthTied` | `AboveShoulderLength` | `TiedLongOverShoulder` | `LongOvershoulder` | `TiedInBack` | `Ukrainian` | `BraidedAboveEars` | `BraidedInBack` 15 | **example:** `Short` 16 | *The name of the hair it references* 17 | 18 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/missionbehaviour/missionview.md: -------------------------------------------------------------------------------- 1 | # MissionView 2 | 3 | Mission Views are a type of [MissionBehaviour](./) that are usually intended for the client and generally involve interacting with UI elements. 4 | 5 | An example of this is the `MissionMainAgentController` MissionView, which handles anything from movement for the player (via inputs) to checking if the player is requesting to spawn as a bot. 6 | 7 | Note that `MissionMainAgentController` has the `DefaultView` attribute applied to it. This means that it will be loaded automatically for Missions that enable loading default views with the `AddDefaultMissionBehavioursTo()` method. 8 | 9 | -------------------------------------------------------------------------------- /_xmldocs/Items/CraftedItem/Pieces/Piece/README.md: -------------------------------------------------------------------------------- 1 | # Piece 2 | 3 | ## Parent node 4 | - [Items](../../Pieces) 5 | 6 | ## Child node 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id-1) | [Type](#Type) | [scale_factor](#scale_factor) 11 | 12 | - #### id 13 | **type:** `string` 14 | **example:** `sturgia_axe_3_t3` 15 | *The ID of the item* 16 | 17 | - #### Type 18 | **type:** `string` 19 | **accepted_values:** `'Blade', 'Handle', 'Guard', 'Pommel'` 20 | **example:** `Blade` 21 | *The Type of the piece* 22 | 23 | - #### scale_factor 24 | **type:** `int` 25 | **example:** `103` 26 | *The scale of the piece* 27 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/skills/skill/README.md: -------------------------------------------------------------------------------- 1 | # skill 2 | 3 | ## Parent node 4 | - [skills](../../skills) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id) | [value](#value) 11 | 12 | - #### id 13 | **type:** `Skill reference` 14 | **possible values:** `Athletics` | `Riding` | `OneHanded` | `TwoHanded` | `Polearm` | `Bow` | `Crossbow` | `Throwing` | `Scouting` | `Trade` | `Tactics` | `Roguery` | `Charm` | `Crafting` | `Leadership` | `Steward` | `Medicine` | `Engineering` 15 | **example:** `Athletics` 16 | *The reference to the skill id* 17 | 18 | - #### value 19 | **type:** `int` 20 | **example:** `20` 21 | *The amount of skill points* 22 | -------------------------------------------------------------------------------- /_intro/general-recommendations.md: -------------------------------------------------------------------------------- 1 | ## Defining custom data 2 | Because the game can't differentiate between it's 'built-int' datas defined in core modules and custom modules, when such custom modules are removed, the game won't load the save file without them. 3 | While it is expected, not every module introduces permanent changes to the save file that could render it unplayable. 4 | 5 | A valid workaround for now would be when defining a custom SaveableTypeDefiner for classes and structures to use a high enough range of numbers that the game doesn't use and when defining custom xml data to use 'custom_MODNAME_' prefix for Id's. This way it would be easier to detect custom data and remove it from game's internal storage in the future. 6 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/equipment/README.md: -------------------------------------------------------------------------------- 1 | # equipment 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../NPCCharacter) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id) | [slot](#slot) | [amount](#amount) 11 | 12 | - #### id 13 | **type:** `Item reference` 14 | **example:** `Item.aserai_horse` 15 | *The Item ID reference* 16 | 17 | - #### slot 18 | **type:** `string` 19 | **possible values:** `Head` | `Body` | `Leg` | `Gloves` | `Cape` | `Item0` | `Item2` | `Item3` | `Horse` | `Item1` | `HorseHarness` 20 | **example:** `Head` 21 | *The slot of the item* 22 | 23 | - #### amount 24 | **type:** `int` 25 | **example:** `20` 26 | *The amount of projectiles an Item has. (arrows, javelins etc.)* 27 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/equipmentSet/equipment/README.md: -------------------------------------------------------------------------------- 1 | # equipment 2 | 3 | ## Parent node 4 | - [NPCCharacter](../../equipmentSet) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [id](#id) | [slot](#slot) | [amount](#amount) 11 | 12 | - #### id 13 | **type:** `Item reference` 14 | **example:** `Item.aserai_horse` 15 | *The Item ID reference* 16 | 17 | - #### slot 18 | **type:** `string` 19 | **possible values:** `Head` | `Body` | `Leg` | `Gloves` | `Cape` | `Item0` | `Item2` | `Item3` | `Horse` | `Item1` | `HorseHarness` 20 | **example:** `Head` 21 | *The slot of the item* 22 | 23 | - #### amount 24 | **type:** `int` 25 | **example:** `20` 26 | *The amount of projectiles an Item has. (arrows, javelins etc.)* 27 | -------------------------------------------------------------------------------- /_csharp-api/engine/gameentity.md: -------------------------------------------------------------------------------- 1 | # GameEntity 2 | 3 | 游戏实体 `GameEntity` 指的是游戏里的对象\(或称之为实体\)。举几个例子:角色,建筑,树木,马匹……等等等等。凡是游戏里出现的每个物件都是一个游戏实体。 4 | 5 | 每一个游戏实体,包含了:网格\(`Mesh`\),骨架\(`Skeleton`\),刚体\(`PhysicsBody`\),脚本组件\(`ScriptComponent`\)以及各种游戏里的对象附带的其他内容。 6 | 7 | 要向场景里添加一个游戏实体,除了通过编辑场景\([Scene](../../_xmldocs/scene.md)\)文件`scene.xscene`外,也可以直接通过`GameEntity`类的静态方法`Instantiate`“刷出”\(实例化出\)一个,比如: 8 | 9 | ```csharp 10 | GameEntity.Instantiate(Scene scene, string prefabName, MatrixFrame frame) 11 | ``` 12 | 13 | 另一个例子,往`main [Agent]`(../mountandblade/agent.md)里生成一个物体。\(注:`Agent`负责处理活物\) 14 | 15 | ```csharp 16 | GameEntity.Instantiate(Mission.Current.Scene, "ship_a", Agent.Main.Frame) 17 | ``` 18 | 19 | ## 多人模式中的游戏实体 20 | 21 | 某些游戏实体无法在玩家的客户端之间同步,因此你需要自己往脚本组件\(`ScriptComponent`\)里添加 `SynchedMissionObject`。 22 | 23 | -------------------------------------------------------------------------------- /_csharp-api/core/mbobjectmanager.md: -------------------------------------------------------------------------------- 1 | # MBObjectManager 2 | 3 | The object manager is something that you will be using a lot in the modding of Bannerlord, so it is important to familiarize yourself with it. 4 | 5 | The MBObjectManager can be used to get any object in the game that is currently loaded from the XMLs. 6 | 7 | These include: 8 | 9 | * [BasicCharacterObjects](basiccharacterobject.md) 10 | * CharacterAttributes 11 | * CraftingPieces 12 | * CraftingTemplates 13 | * Cultures 14 | * ItemModifierGroups 15 | * ItemCategories 16 | * ItemComponents 17 | * [ItemObjects](itemobject.md) 18 | * SkillObjects 19 | * SiegeEngineTypes 20 | 21 | Example of getting a [BasicCharacterObject](basiccharacterobject.md): 22 | 23 | ```csharp 24 | MBObjectManager.Instance.GetObject("example_troop_id"); 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/BodyProperties/README.md: -------------------------------------------------------------------------------- 1 | # BodyProperties 2 | 3 | ## Parent node 4 | - [face](../../face) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [age](#age) | [build](#build) | [key](#key) | [version](#version) | [weight](#weight) | 11 | 12 | - #### age 13 | **type:** `float` 14 | **example:** `24.31` 15 | *The age of the face* 16 | 17 | - #### build 18 | **type:** `float` 19 | **example:** `0.7077` 20 | *TODO: Figure out what this does* 21 | 22 | - #### key 23 | **type:** `key` 24 | **example:** `0033F00E400005D3710005000004000050060800000000077718F00000000060000447A404000000000000000000000000000000000000000000000000505000` 25 | *Face key* 26 | 27 | - #### version 28 | **type:** `int` 29 | **example:** `4` 30 | *TODO: Figure out what this is for* 31 | 32 | - #### weight 33 | **type:** `float` 34 | **example:** `0.4502` 35 | *TODO: Figure out what this is for* 36 | 37 | 38 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/face/BodyPropertiesMax/README.md: -------------------------------------------------------------------------------- 1 | # BodyPropertiesMax 2 | 3 | ## Parent node 4 | - [face](../../face) 5 | 6 | ## Child nodes 7 | - *None* 8 | 9 | ## Attributes 10 | [age](#age) | [build](#build) | [key](#key) | [version](#version) | [weight](#weight) 11 | 12 | - #### age 13 | **type:** `float` 14 | **example:** `24.31` 15 | *The age of the face* 16 | 17 | - #### build 18 | **type:** `float` 19 | **example:** `0.7077` 20 | *TODO: Figure out what this does* 21 | 22 | - #### key 23 | **type:** `key` 24 | **example:** `0033F00E400005D3710005000004000050060800000000077718F00000000060000447A404000000000000000000000000000000000000000000000000505000` 25 | *Face key* 26 | 27 | - #### version 28 | **type:** `int` 29 | **example:** `4` 30 | *TODO: Figure out what this is for* 31 | 32 | - #### weight 33 | **type:** `float` 34 | **example:** `0.4502` 35 | *TODO: Figure out what this is for* 36 | 37 | 38 | -------------------------------------------------------------------------------- /_xmldocs/items.md: -------------------------------------------------------------------------------- 1 | # Items \(XML\) 2 | 3 | ## Items documentation 4 | - [物品(类别) Items](Items) 5 | * [物品 Item](Items/Item) 6 | + [旗帜 Flags](Items/Item/Flags) 7 | + [物品组件 ItemComponent](Items/Item/ItemComponent) 8 | + [防具 Armor](Items/Item/ItemComponent/Armor) 9 | + [武器 Weapon](Items/Item/ItemComponent/Weapon) 10 | + [WeaponFlags](Items/Item/ItemComponent/Weapon/WeaponFlags) 11 | + [马 Horse](Items/Item/ItemComponent/Horse) 12 | + [材质(类别) Materials](Items/Item/ItemComponent/Horse/Materials) 13 | + [材质 Material](Items/Item/ItemComponent/Horse/Materials/Material) 14 | + [MeshMultipliers](Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers) 15 | + [MeshMultiplier](Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier) 16 | + [食物 Food](Items/Item/ItemComponent/Food) 17 | * [物品(制造) CraftedItem](Items/CraftedItem) 18 | + [部件(类别) Pieces](Items/CraftedItem/Pieces) 19 | + [部件 Piece](Items/CraftedItem/Pieces/Piece) 20 | -------------------------------------------------------------------------------- /_tutorials/packing_mods_for_vortex.md: -------------------------------------------------------------------------------- 1 | # 将你的mod打包上传至Vortex 2 | 3 | ## 介绍 4 | Vortex是Nexus Mods出品的、强大的开源Mod管理器。 它支持安装和管理适用于100多种游戏的mod,包括骑马与砍杀2:霸主。 共享您的mod时,应注意一些事项,以确保其结构与Vortex兼容。 5 | [你可以在这里了解关于Vortex的更多事情](https://nexusmods.com/about/vortex). 6 | 7 | 8 | ## 模组 9 | 10 | 模组是自动检测的,它们由多个mod组成。这些mods包含在“ Modules”文件夹中,并且包含Submodule.xml文件。 Vortex抓取了包含Submodule.xml的整个文件夹,并将其放入游戏的“ Modules”文件夹中。 11 | 12 | 开始游戏时,请不要忘记在启动器中启用这些mod! 13 | 14 | 15 | ## XML 编辑与其它mod 16 | 17 | 当前,任何其他类型的mod都需要您相对于游戏根目录进行简单打包。 例如,如果我有文件“ BannerEditor.xml”,则需要进入“ Modules \ Native \ GUI \ Prefabs \ Bannereditor”文件夹,然后将我上传的文件放到这些文件夹下。 18 | 19 | 这种方式将正确且一致地安装包括XML编辑,视频/声音编辑和Reshade预设在内的所有内容。 20 | 21 | 22 | ## 有多种选项的Mod 23 | 24 | Vortex支持[mod 安装器](https://wiki.nexusmods.com/index.php/How_to_create_mod_installers),它可让您向用户提供选择性的Mod下载方式。 Mod安装程序可以用XML编写,也可以使用[FOMOD 创建工具](https://www.nexusmods.com/fallout4/mods/6821/?tab=files)创建。 如果您想使用Mod安装程序,但是在设置方面遇到困难,请联系Nexus Mods社区管理员,我们将很乐意为您提供帮助。 25 | 26 | 27 | ## 不匹配的Mod 28 | 29 | 在撰写本文时,我们还不知道是否有与Vortex不兼容的任何Mod(正确打包上传的前提下)。 但是,如果您上传的工具或保存游戏不应该以上述方式安装,则可以在Nexus Mods页面上禁用Vortex按钮。 -------------------------------------------------------------------------------- /_csharp-api/engine/scene.md: -------------------------------------------------------------------------------- 1 | # Scene 2 | 3 | Scenes are the current loaded view of the instances. 4 | 5 | ## Tips 6 | 7 | * You can get current scene with `Mission.Current.Scene` assuming `Mission.Current` is not null and Scene is loaded. 8 | 9 | * You can get the Scenes' static information through `/Modules/_MODULENAME_/SceneObj/`. 10 | 11 | ### Scene Detection Example 12 | 13 | **Note**: You should **NEVER** modify the default game files directly. 14 | 15 | Each Module's Scene is located in the corresponding `SceneObj` directory. For example, SandBox scenes are located in `/Modules/SandBox/SceneObj`. 16 | 17 | In this example the path: `/Modules/SandBox/SceneObj/arena_aserai_a`. Open up the `scene.xscene` with preferred text editor. 18 | 19 | The second line in the file contains the name of this particular Scene. 20 | 21 | `` name of the Scene is `arena_aserai_a`. 22 | 23 | And then check the current Scene in code by it's name. 24 | 25 | ```csharp 26 | if(Mission.Current.SceneName == "arena_aserai_a") 27 | { 28 | // ... 29 | } 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /_gauntlet/widget.md: -------------------------------------------------------------------------------- 1 | # Widget 2 | 3 | Widgets(以下简称控件) 是一种强大的,用于为你的UI创建可交互内容的工具。它可能包括scrollbars(滚动条), buttons(按钮), tooltips(工具栏),等等。 4 | 5 | ## 常用的预定义控件包括 6 | 7 | * ButtonWidget(按钮) 8 | * ImageWidget (图片) 9 | * ListPanel(列表界面) 10 | * RichTextWidget(富文本) 11 | * ScrollablePanel(滚动界面) 12 | * ScrollBarWidget(滚动条) 13 | * TextWidget(普通文本) 14 | * TooltipWidget(工具栏) 15 | * Widget(控件) 16 | 17 | ### 注意 18 | 这里有非常多的控件;上面所列举的只是最常用到的控件。你可以通过反编译`TaleWorlds.GauntletUI.dll`和`TaleWorlds.MountAndBlade.GauntletUI.dll`这2个DLL文件去找到其它控件。继承于`widget`类的自定义控件的标签名将会与自定义控件类的类名相同。 19 | 20 | ## 控件常用的预定义属性包括 21 | 22 | * Brush 23 | * Command.Click _\(Command.自定义方法键\)_ 24 | * DataSource _\(Properties with DataSourceProperty Attribute in C\#\)_ 25 | * DoNotAcceptEvents 26 | * HorizontalAlignment / VerticalAlignment 27 | * Id 28 | * MarginLeft / MarginRight / MarginTop / MarginBottom 29 | * Sprite 30 | * SuggestedWidth / SuggestedHeight 31 | * Text _\(只有Text控件包含此属性\)_ 32 | * WidthSizePolicy / HeightSizePolicy 33 | 34 | ## 创建一个自定义控件 35 | 36 | 你可以通过简单的继承`widget`类来创建一个自定义控件。当这一切完成以后,你可以在[Movie](movie.md)中使用你自定义的控件。你的控件的标签名将会与你自定义控件类的类名相同。 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Bannerlord Modding 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/mbinitialscreenbase.md: -------------------------------------------------------------------------------- 1 | # MBInitialScreenBase 2 | 3 | 想要创建一个自定义的开场画面,你可以写一个MBInitialScreenBase的派生类,然后让这个类采用`GameStateScreen`属性。 4 | 5 | 这个派生类的写法,可以参考以下例子: 6 | 7 | ```csharp 8 | [GameStateScreen(typeof(InitialState))] 9 | public class MyInitialScreen : MBInitialScreenBase 10 | { 11 | private GauntletLayer _gauntletLayer; 12 | private InitialMenuVM _dataSource; 13 | 14 | public MBInitialScreen(InitialState initialState) : base(initialState) { } 15 | 16 | protected override void OnInitialize() 17 | { 18 | base.OnInitialize(); 19 | this._dataSource = new InitialMenuVM(); 20 | this._gauntletLayer = new GauntletLayer(1, "GauntletLayer"); 21 | this._gauntletLayer.LoadMovie("InitialScreen", this._dataSource); 22 | this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.Mouse); 23 | base.AddLayer(this._gauntletLayer); 24 | GameNotificationManager.Current?.LoadMovie(false); 25 | ChatLog.Current?.LoadMovie(false); 26 | InformationManager.ClearAllMessages(); 27 | } 28 | } 29 | ``` 30 | 31 | 然后把类名中的 `InitialScreen` 替换成相应的[影片](../../_gauntlet/movie.md)XML文件的文件名。 32 | -------------------------------------------------------------------------------- /_xmldocs/Scenes/Scene/README.md: -------------------------------------------------------------------------------- 1 | # Scene 2 | 3 | ## Parent node 4 | - [Scenes](../../Scenes) 5 | 6 | ## Child nodes 7 | - [TerrainTypes](TerrainTypes) 8 | 9 | ## Attributes 10 | [name](#name) | [terrain](#terrain) | [forest_density](#forest_density) | [is_siege_map](#is_siege_map) | [is_village_map](#is_village_map) 11 | 12 | - #### name 13 | **类型:** `string` 14 | **例子:** `{=!}battle_terrain_a (Plain)` 15 | *The name of the scene* 16 | 17 | - #### terrain 18 | **类型:** `string` 19 | **possible values:** `Plain` | `Desert` | `Steppe` | `Swamp` | `Forest` 20 | **例子:** `Plain` 21 | *The terrain of the scene* 22 | 23 | - #### forest_density 24 | **类型:** `string` 25 | **possible values:** `Low` | `High` 26 | **例子:** `Low` 27 | *The forest density on the scene* 28 | *Note: the value seems to be case insensitive* 29 | 30 | - #### is_siege_map 31 | **类型:** `boolean` 32 | **接受值:** `true` | `false` 33 | **default value:** `false` 34 | **例子:** `true` 35 | *If the scene is a Siege scene* 36 | 37 | - #### is_village_map 38 | **类型:** `boolean` 39 | **接受值:** `true` | `false` 40 | **default value:** `false` 41 | **例子:** `true` 42 | *If the scene is a Village scene* 43 | -------------------------------------------------------------------------------- /_intro/getting-started.md: -------------------------------------------------------------------------------- 1 | # 开始第一步 2 | 3 | ## 重要提示 4 | 5 | 在进一步工作之前, 理解文件[SubModule.xml](../_xmldocs/submodule.md) 是非常重要的,因为这个文件指定了你Mod中的哪一部分会被加载。 6 | 7 | ## 工具 8 | 9 | ### C\# IDE 10 | 11 | * [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) \(基础的Mod不需要用到它\) 12 | 13 | ### 文本编辑器 14 | 15 | 任何文本编辑器都足以满足要求, 但是以下是推荐使用的: 16 | 17 | * [Visual Studio Code](https://code.visualstudio.com/download) 18 | * [Sublime Text](https://www.sublimetext.com/) 19 | * [Notepad++](https://notepad-plus-plus.org/downloads/) 20 | 21 | ## 不使用 C\# 制作Mod 22 | 23 | 游戏中部分内容不需要C#即可定制,包括场景、物品、文化、角色、Gauntlet UI等等。 24 | 25 | ## 使用 C\# 制作Mod 26 | 27 | “基于模组”的Mod制作系统,使霸主的Mod制作工作比前作更加容易,并且它支持实现更复杂的Mod功能。 28 | 29 | ## 制作一个模组 30 | 31 | 在霸主,一个独立运行的Mod被叫做“模组”。模组唯一必要的部分就是SubModule文件夹,和负责启动Mod的`SubModule.xml`文件。 32 | 33 | 1.在游戏目录的`Modules`文件夹中新建文件夹,文件夹名称必须与你的SubModule保持一致。 34 | 2. 在你的新文件夹中创建文件`SubModule.xml`,你可以 [看看这个例子](../_xmldocs/submodule.md) 或者 [获取完整参考文档](../_xmldocs/submodule.md) 35 | 36 | ## 下一步 37 | 38 | * 参考[文件结构](folder-structure.md) 页面,以获取其它文件夹路径的参考信息,帮助拓展你的Mod。 39 | * 参考[基础 C\# Mod](../_tutorials/basic-csharp-mod.md) 页面,它提供了一份在霸主中设置,编译,运行代码的简单例子。 40 | * 参考[不使用C#的Gauntlet UI定制](../_tutorials/modding-gauntlet-without-csharp.md) 页面,它提供了无需C#的Gauntlet UI定制方法。 41 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/actions/ChangeOwnerOfSettlementAction.md: -------------------------------------------------------------------------------- 1 | # ChangeOwnerOfSettlementAction 2 | 3 | The function of this class is to set or change the owner of a settlement. 4 | 5 | ## Functions 6 | 7 | Here is a list of functions that detail different ways a settlement can change ownership: 8 | - `ApplyByDefault(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` - Called at the start of a campaign or when a player cheats to attain a settlement 9 | - `ApplyByKingDecision(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` 10 | - `ApplyBySiege(`[Hero](../hero.md)`newOwner, `[Hero](../hero.md)`capturerHero, `[Settlement](../settlement.md)`settlement)` 11 | - `ApplyByRevolt(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` 12 | - `ApplyByLeaveFaction(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` 13 | - `ApplyByBarter(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` 14 | - `ApplyByRemoveFaction(`[Settlement](../settlement.md)`settlement)` 15 | - `ApplyByDestroyClan(`[Settlement](../settlement.md)`settlement, `[Hero](../hero.md)`newOwner)` - Called when owner of settlement dies, when this happens, the fief is passed to a random child of the previous owner 16 | -------------------------------------------------------------------------------- /_xmldocs/npccharacters.md: -------------------------------------------------------------------------------- 1 | # NPCCharacters (XML) 2 | 3 | ## NPCCharacters documentation 4 | 5 | - [NPCCharacters](NPCCharacters) 6 | - [NPCCharacter](NPCCharacters/NPCCharacter) 7 | - [equipment](NPCCharacters/NPCCharacter/equipment) 8 | - [equipmentSet](NPCCharacters/NPCCharacter/equipmentSet) 9 | - [equipment](NPCCharacters/NPCCharacter/equipmentSet/equipment) 10 | - [face](NPCCharacters/NPCCharacter/face) 11 | - [beard_tags](NPCCharacters/NPCCharacter/face/beard_tags) 12 | - [beard_tag](NPCCharacters/NPCCharacter/face/beard_tags/beard_tag) 13 | - [BodyProperties](NPCCharacters/NPCCharacter/face/BodyProperties) 14 | - [BodyPropertiesMax](NPCCharacters/NPCCharacter/face/BodyPropertiesMax) 15 | - [face_key_template](NPCCharacters/NPCCharacter/face/face_key_template) 16 | - [hair_tags](NPCCharacters/NPCCharacter/face/hair_tags) 17 | - [hair_tag](NPCCharacters/NPCCharacter/face/hair_tags/hair_tag) 18 | - [skills](NPCCharacters/NPCCharacter/skills) 19 | - [skill](NPCCharacters/NPCCharacter/skills/skill) 20 | - [Traits](NPCCharacters/NPCCharacter/Traits) 21 | - [Trait](NPCCharacters/NPCCharacter/Traits/Trait) 22 | - [upgrade_targets](NPCCharacters/NPCCharacter/upgrade_targets) 23 | - [upgrade_target](NPCCharacters/NPCCharacter/upgrade_targets/upgrade_target) 24 | -------------------------------------------------------------------------------- /_csharp-api/engine/scriptcomponentbehaviour.md: -------------------------------------------------------------------------------- 1 | # ScriptComponentBehaviour 2 | 3 | ScriptComponentBehaviours can be used to do anything from animating (rotating) windmills, to creating a custom weapon spawner, or even entirely new siege machines. 4 | 5 | A basic example of a ScriptComponentBehaviour is the `LumberJack` class in `TaleWorlds.MountAndBlade.dll`: 6 | 7 | ```csharp 8 | public class Lumberjack : ScriptComponentBehaviour 9 | { 10 | private bool _initialized; 11 | 12 | protected internal override void OnTick(float dt) 13 | { 14 | base.OnTick(dt); 15 | if (!this._initialized) 16 | { 17 | this._initialized = true; 18 | base.GameEntity.CreateSimpleSkeleton("human_skeleton"); 19 | base.GameEntity.CopyComponentsToSkeleton(); 20 | base.GameEntity.Skeleton.SetAnimationAtChannel("lumberjack", 0, 1f, -1f, 0f); 21 | MetaMesh copy = MetaMesh.GetCopy("peasent_hatchet", true, false); 22 | base.GameEntity.AddMultiMeshToSkeletonBone(copy, 27); 23 | } 24 | } 25 | } 26 | ``` 27 | 28 | ** Note: It is probably better to override `OnInit()` instead of `OnTick()` here. Since this is how it was written by TaleWorlds, this example will remain as-is for the time being. 29 | 30 | Possible Reason: Meshes can not be Edited/Set etc in OnInit u have to wait atleast a Tick, else ur Game Crashes 31 | 32 | -------------------------------------------------------------------------------- /_intro/folder-structure.md: -------------------------------------------------------------------------------- 1 | # 文件夹结构 2 | 3 | 所有文件夹都不是必须的,对于SubModule来说,唯一的要求就是启动器必须能够监测到SubModule文件夹自身,以及有效的 [SubModule.xml](../_xmldocs/submodule.md) 文件。 4 | 5 | 完整的Mod文件结构与内容可以参考 6 | `盘符:\\安装目录\Mount & Blade II Bannerlord\Modules\Native\` 7 | 8 | 9 | * `AssetPackages` - Contains TPAC files (may be Taleworlds Package). The TPAC format was introduced at some time during the multiplayer beta, replacing the outdated BRF format of Warband and CRF format of early beta, and is still used today. Can be explored via an unofficial tool [TpacTool](https://github.com/szszss/TpacTool) 10 | * `someasset.tpac` 11 | * `Atmospheres` - [Refer to [Atmosphere]](../_xmldocs/atmosphere.md) 12 | * `Interpolated` 13 | * `interpolatedatmosphere.xml` 14 | * `atmosphere.xml` 15 | 16 | * `bin` - 编译好的二进制文件放在这里 - [参见 \[基础的 C\# Mod制作\]](../_tutorials/basic-csharp-mod.md) 17 | * `Win64_Shipping_Client` 18 | * `MyModule.dll` 19 | 20 | * `GUI` - 大多数与Gauntlet有关的内容放在这里。 21 | * `Brushes` - 存放Gauntlet Brushes。 22 | * `Prefabs` - 存放Gauntlet Movies。 23 | 24 | * `ModuleData` - 任何与你的Mod有关的XML格式数据存放在这里。 \(例如:items/cultures/gametexts\) 25 | 26 | * `SceneObj` - 存放场景。 27 | 28 | ```text 29 | - MyModule 30 | - AssetPackages 31 | -- assetpackage.tpac 32 | - Atmospheres 33 | - Interpolated 34 | -- interpolatedatmosphere.xml 35 | -- atmosphere.xml 36 | - bin 37 | - Win64_Shipping_Client 38 | -- MyModule.dll 39 | - GUI 40 | - Brushes 41 | - Prefabs 42 | - ModuleData 43 | - SceneObj 44 | - SubModule.xml 45 | ``` 46 | -------------------------------------------------------------------------------- /_gauntlet/screenbase.md: -------------------------------------------------------------------------------- 1 | # ScreenBase 2 | 3 | 你可以通过screen组织并生成你的 [ViewModels](viewmodel.md) 和 [Movies](movie.md)。 4 | 5 | 为了防止出现问题,推荐使用以下模板创建screen: 6 | 7 | ```csharp 8 | public class MyExampleScreen : ScreenBase 9 | { 10 | 11 | private MyExampleVM _dataSource; 12 | private GauntletLayer _gauntletLayer; 13 | private GauntletMovie _movie; 14 | 15 | protected override void OnInitialize() 16 | { 17 | base.OnInitialize(); 18 | _dataSource = new MyExampleVM(); 19 | _gauntletLayer = new GauntletLayer(100) 20 | { 21 | IsFocusLayer = true 22 | }; 23 | AddLayer(_gauntletLayer); 24 | _gauntletLayer.InputRestrictions.SetInputRestrictions(); 25 | _movie = _gauntletLayer.LoadMovie("MyExampleMovie", _dataSource); 26 | } 27 | 28 | protected override void OnActivate() 29 | { 30 | base.OnActivate(); 31 | ScreenManager.TrySetFocus(_gauntletLayer); 32 | } 33 | 34 | protected override void OnDeactivate() 35 | { 36 | base.OnDeactivate() 37 | _gauntletLayer.IsFocusLayer = false; 38 | ScreenManager.TryLoseFocus(_gauntletLayer); 39 | } 40 | 41 | protected override void OnFinalize() 42 | { 43 | base.OnFinalize(); 44 | RemoveLayer(_gauntletLayer); 45 | _dataSource = null; 46 | _gauntletLayer = null; 47 | } 48 | } 49 | ``` 50 | 51 | ## Screen入栈 52 | 53 | 要将你的screen加入screen栈,你可以这样做: 54 | 55 | ```csharp 56 | ScreenManager.PushScreen(ViewCreatorManager.CreateScreenView()); 57 | ``` 58 | -------------------------------------------------------------------------------- /_xmldocs/Items/CraftedItem/README.md: -------------------------------------------------------------------------------- 1 | # CraftedItem 2 | 3 | ## Example Entry 4 | Source: Modules/SandBoxCore/ModuleData/spitems.xml 5 | ```xml 6 | 10 | 11 | 14 | 16 | 17 | 18 | ``` 19 | 20 | ## Parent node 21 | - [Items](../../Items) 22 | 23 | ## Child node 24 | - [Pieces](Pieces) 25 | 26 | ## Attributes 27 | [id](#id) | [name](#name) | [crafting_template](#crafting_template) | [culture](#culture) | [is_merchandise](#is_merchandise) 28 | 29 | - #### id 30 | **类型:** `string` 31 | **例子:** `sturgia_axe_3_t3` 32 | *The ID of the item* 33 | 34 | - #### name 35 | **类型:** `string` 36 | **例子:** `{=wW3iouiU}Hijab` 37 | *Note: The prefix in the `{=}` format is the translation id found in strings.txt* 38 | *TODO: Find out if this is auto generated.* 39 | 40 | - #### crafting_template 41 | **类型:** `string` 42 | **possible values:** `'TwoHandedPolearm', 'OneHandedAxe', 'Mace', 'TwoHandedAxe', 'OneHandedSword', 'TwoHandedSword', 'Pike', 'Dagger', 'Javelin', 'ThrowingAxe', 'ThrowingKnife'` 43 | **例子:** `TwoHandedPolearm` 44 | 45 | - #### culture 46 | **类型:** `string` 47 | **possible values:** `'Culture.aserai', 'Culture.sturgia', 'Culture.battania', 'Culture.looters', 'Culture.khuzait', 'Culture.vlandia', 'Culture.empire', 'Culture.neutral_culture'` 48 | **例子:** `Culture.aserai` 49 | 50 | - #### is_merchandise 51 | **类型:** `boolean` 52 | **例子:** `false` 53 | *If the item is marketable* -------------------------------------------------------------------------------- /_csharp-api/mountandblade/mbsubmodulebase.md: -------------------------------------------------------------------------------- 1 | # MBSubModuleBase 2 | 3 | 你可以通过继承 `MBSubModuleBase 类` 来处理MOD的加载,可以说这是你MOD的入口。这个类中有一些很有用的重载,比如 `OnSubModuleLoad()` 和 `OnApplicationTick()`。 4 | 5 | **一定注意在 `SubModule.xml` 里写上正确完整的类名,不然运行时会出问题。** 6 | 7 | 这是一个例子([SubModule.xml](../../_xmldocs/submodule.md)):例中的 `ExampleMod.MySubModule` 就是一个正确的类名。 8 | 9 | ## 可重载的函数 10 | 11 | 下面列出了所有可以重载的函数,并且一般情况下它们就是以这个顺序被调用。这只是一个大概的指南,当你遇到运行顺序导致的问题时,这不能取代Debug。 12 | 13 | - `OnSubModuleLoad()` - 游戏处于加载界面时最先被调用的函数,你应该在这个函数中完成初始化的主要部分 14 | - `OnApplicationTick(float)` - 这个函数每一帧都会被调用一次,为了性能考虑,在这个函数中要尽量避免加入一些复杂且费时的操作 15 | - `float` - 完成当前帧耗费的时间(毫秒) 16 | - `OnBeforeInitialModuleScreenSetAsRoot()` - 在主菜单出现前一刻被调用的函数,当你的MOD需要加载一些别的东西的时候挺有用的 17 | - `OnGameStart(Game, IGameStarter)` - 当用户在主菜单选择一个游戏模式(submodule)后会立刻被调用 18 | - `Game` - [详情: Game](../core/game.md) 19 | - `IGameStarter` - N/A 20 | - `BeginGameStart(Game)` - 当所选的游戏模式加载完成后立刻被调用 21 | - `Game` - [详情: Game](../core/game.md) 22 | - `OnGameLoaded(Game, object)` - 当加载了一个存档后被调用 23 | - `Game` - [详情: Game](../core/game.md) 24 | - `object` - N/A 25 | - `OnCampaignStart(Game, object)` - 当任意游戏模式启动后被调用 26 | - `Game` - [详情: Game](../core/game.md) 27 | - `object` - N/A 28 | - `OnGameInitializationFinished(Game)` - 当某个游戏模式初始化完成后被调用 29 | - `Game` - [详情: Game](../core/game.md) 30 | - `DoLoading(Game)` - 当加载结束时被调用,这个不是很确定 31 | - `Game` - [详情: Game](../core/game.md) 32 | - `OnNewGameCreated(Game, object)` - 当战役模式中开始一个新游戏时被调用 33 | - `Game` - [详情: Game](../core/game.md) 34 | - `object` - N/A 35 | - `OnMissionBehaviourInitialize(Mission)` - 当一个任务(mission)开始后,行为(behaviours)初始化前被调用 36 | - `Mission` - [详情: Mission](mission.md) 37 | - `OnGameEnd(Game)` - 当退出一个任务或战役时被调用 38 | - `Game` - [详情: Game](../core/game.md) 39 | - `OnSubModuleUnloaded()` - 当退出游戏时被调用 40 | 41 | 42 | - `OnMultiplayerGameStart(Game, object)` - 多人游戏相关,未测试 43 | - `Game` - [See: Game](../core/game.md) 44 | - `object` - N/A -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 骑马与砍杀2 领主 Mod 制作文档 2 | 3 | 原文档: [Bannerlord Documentation](https://docs.bannerlordmodding.com/) 4 | 作者: [Bannerlord Modding](https://github.com/Bannerlord-Modding) 5 | 译者: [衣谷作坊-Oliver](mailto:munoliver007@gmail.com), [世俗骑士](mailto:843750340@qq.com),[上官云泽](mailto:1143232792@qq.com). 6 | 7 | ## Mod 制作简介 8 | 9 | * [开始](_intro/getting-started.md) 10 | * [文件结构](_intro/folder-structure.md) 11 | * [高级用法](_intro/advanced.md) 12 | 13 | ## 教程 14 | 15 | * [基本C\# Mod 入门](_tutorials/basic-csharp-mod.md) \(需要一定基础的 C\#\) 16 | * [不需要C\#的UI系统 Mod 入门](_tutorials/modding-gauntlet-without-csharp.md) \(简单\) 17 | * [将你的mod打包上传至Vortex](_tutorials/packing_mods_for_vortex.md) \(简单\) 18 | * [修改/增加 定居点](_tutorials/new_settlements.md) (简单) 19 | 20 | ## [C# API Documentation](_csharp-api/) 21 | 22 | * [战役系统](_csharp-api/campaignsystem/) 23 | * [核心](_csharp-api/core/) 24 | * [引擎](_csharp-api/engine/) 25 | * [输入系统](_csharp-api/inputsystem/) 26 | * [库](_csharp-api/library/) 27 | * [本地化](_csharp-api/localization/) 28 | * [MountAndBlade](_csharp-api/mountandblade/) 29 | * [网络](_csharp-api/network/) 30 | * [平台服务](_csharp-api/platformservice/) 31 | * [保存系统](_csharp-api/savesystem/) 32 | * [TwoDimension](_csharp-api/twodimension/) 33 | 34 | ## [Gauntlet Documentation](_gauntlet/) 35 | 36 | * [GauntletLayer](_gauntlet/gauntletlayer.md) 37 | * [GauntletMovie](_gauntlet/gauntletmovie.md) 38 | * [GauntletView](_gauntlet/gauntletview.md) 39 | * [ScreenBase](_gauntlet/screenbase.md) 40 | * [ScreenManager](_gauntlet/screenmanager.md) 41 | * [ViewModel](_gauntlet/viewmodel.md) 42 | * [Widget](_gauntlet/widget.md) 43 | * [Movies](_gauntlet/movie.md) (.xml) 44 | * [Brushes](_gauntlet/brush.md) (.xml) 45 | 46 | ## [XML Documentation](_xmldocs) 47 | 48 | * [环境](_xmldocs/atmosphere.md) (.xml) 49 | * [文化](_xmldocs/cultures.md) (.xml) 50 | * [物品](_xmldocs/items.md) (.xml) 51 | * [NPC角色](_xmldocs/npccharacters.md) (.xml) 52 | * [场景](_xmldocs/scene.md) (.xml) 53 | * [子模块](_xmldocs/submodule.md) (.xml) 54 | -------------------------------------------------------------------------------- /_csharp-api/localization/MBTextManager.md: -------------------------------------------------------------------------------- 1 | # MBTextManager 2 | 3 | ## General Info 4 | The MBTextManager is a public static class, that is used to make in-game texts localizable. 5 | It contains games text processong logics and could be used to set global text variables. You can find more information on text variables [here](TextObject.md#text-variables). 6 | 7 | ## Setting gloabal text variables 8 | You can set text variable to MBTextManager using method `SetTextVariable`: 9 | ```csharp 10 | MBTextManager.SetTextVariable(tag, textObject); 11 | ``` 12 | It has several overloaded versions with different value argument types. 13 | 14 | Any variable set to the MBTextManager will be used by game text processor for any TextObject as if it was defined for that TextObject itself: 15 | ```csharp 16 | StringHelpers.SetCharacterProperties("CURRENT_LIEGE", forLord.MapFaction.Leader.CharacterObject, null, null, false); 17 | StringHelpers.SetCharacterProperties("NEW_LIEGE", newLiege.CharacterObject, null, null, false); 18 | 19 | ... 20 | 21 | persuasionTask2.SpokenLine = 22 | new TextObject("{=CymOFgzv}I gave an oath to {CURRENT_LIEGE.LINK} - but {?LORD.GENDER}her{?}his{\\?} disregard for the common people of this realm does give me pause."); 23 | ``` 24 | In this example method `StringHelpers.SetCharacterProperties` is used to store certain character properties to the MBTextManager variable array, making them global. They are then used to form new TextObject for a persuasion dialog line. 25 | 26 | Please note that TextObject instance must not have any defined attributes (its own text variables) in order to have access to global variables. 27 | 28 | ## TextContext 29 | Any variable set to MBTextManager is stored in the private readonly field named TextContext. It serves as an advanced ditionary of text variables and functions (need more info on that matter), and is only cleared on `Campaign.OnDestroy()`. Keep in mind that text variables could be freely rewrited at any time with new values. 30 | -------------------------------------------------------------------------------- /ru/_intro/folder-structure.md: -------------------------------------------------------------------------------- 1 | # Структура папок 2 | 3 | Создавать все папки не обязательно. Единственное требование, чтобы Лаунчер обнаружил мод - это папка SubModule и файл [SubModule.xml](../_xmldocs/submodule.md). 4 | 5 | Полный пример структуры и содержимого папок рассмотрим на примере - `«Имя диска»:\\«Место установки»\Mount & Blade II Bannerlord\Modules\Native\` 6 | 7 | ## Описания папок и примеры файлов 8 | 9 | * `AssetPackages` - Содержит файлы TPAC (формат архивов у Taleworlds). Формат TPAC был представлен во время релиза многопользовательской бета-версии Bannerlord, заменив устаревший формат .BRF у Warband и формат CRF ранней бета-версии, и до сих пор используется по сей день. Можно исследовать с помощью неофициального инструмента [TpacTool](https://github.com/szszss/TpacTool). 10 | * `someasset.tpac` 11 | * `Atmospheres` - [Обратитесь к [Atmosphere.xml]](../_xmldocs/atmosphere.md) 12 | * `Interpolated` 13 | * `interpolatedatmosphere.xml` 14 | * `atmosphere.xml` 15 | * `bin` - Здесь должны находиться скомпилированные двоичные файлы - [Обратитесь к [Базовый C# Мод]](../_tutorials/basic-csharp-mod.md) 16 | * `Win64_Shipping_Client` 17 | * `MyModule.dll` 18 | * `GUI` - Здесь большинство вещей, связанных с Gauntlet (пользовательский интерфейс). 19 | * `Brushes` - стили для элементов. 20 | * `Prefabs` - текстовое описание окна, с элементами вроде текста, слайдеров или текстбокса. 21 | * `ModuleData` - Здесь находятся общие данные, связанные с вашим модом, в формате XML (например, предметы/культуры/игровые тексты). 22 | * `SceneObj` - Здесь ваши сцены. 23 | 24 | ```text 25 | - MyModule 26 | - AssetPackages 27 | -- assetpackage.tpac 28 | - Atmospheres 29 | - Interpolated 30 | -- interpolatedatmosphere.xml 31 | -- atmosphere.xml 32 | - bin 33 | - Win64_Shipping_Client 34 | -- MyModule.dll 35 | - GUI 36 | - Brushes 37 | - Prefabs 38 | - ModuleData 39 | - SceneObj 40 | - SubModule.xml 41 | ``` 42 | 43 | ### ``Переведено сайтом commando.com.ua`` -------------------------------------------------------------------------------- /_xmldocs/submodule.md: -------------------------------------------------------------------------------- 1 | # SubModule \(XML\) 2 | 3 | ## 字段描述 4 | 5 | * `Name` - 模组的名称。 6 | * `Id` - 模组的ID \(不要使用空格\)。 7 | * `Version` - 模组的当前版本。 8 | * `SinglePlayerModule` - 单人游戏中模组是否可用。 9 | * `MultiPlayerModule` - 多人游戏中模组是否可用。 10 | * `DependedModules` - 此模组正常工作需要的依赖模组。 11 | * `SubModules` - 该模组由哪些子模组 \(DLLs\)组成。 12 | * `Xmls` - 包含ModuleData文件夹中的XML文件路径。 13 | 14 | ## 重要提示 15 | 16 | 对于两个独立的mod,如果XML中的id相同,它们的内容将会合并 **而不是** 互相覆盖。然而,假如两个物体在XML文件中具有相同的id(例如:两个item),它们会按照启动器中Mod的排列顺序覆盖。了解这一点对于重写native中的内容非常有用。 17 | 18 | `MPClassDivisions` 当前存在问题。 19 | 20 | ## 例子 21 | 22 | ```xml 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | ``` 62 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/gamemenu.md: -------------------------------------------------------------------------------- 1 | # GameMenu 2 | 3 | 4 | 战役中所有的菜单选项都由`GameMenuManager`管理。你必须通过提供`Campaign`类中的方法,来加入新菜单。 5 | 6 | 加入新的菜单: 7 | ```csharp 8 | CampaignGameStarter.AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, MenuOverlayType overlay = MenuOverlayType.None, MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null) 9 | 10 | delegate void OnInitDelegate(MenuCallbackArgs args); 11 | ``` 12 | 13 | 覆盖层(overlay)定义了例子中右上角字符列表是否可见。 14 | 15 | 16 | 为菜单加入新的选项: 17 | ```csharp 18 | CampaignGameStarter.AddGameMenuOption(string menuId, string optionId, string optionText, OnConditionDelegate condition, OnConsequenceDelegate consequence, bool isLeave = false, int index = -1) 19 | 20 | bool OnConditionDelegate(MenuCallbackArgs args); 21 | void OnConsequenceDelegate(MenuCallbackArgs args); 22 | ``` 23 | 24 | 您可以在现有菜单中添加选项。使用这个index参数时,可以方便地插入在其它选项之前(默认情况下,它会在末尾插入)。 25 | 26 | 提供的条件方法(condition method)具有双重职责: 27 | * 启用/禁用选项(通过返回值) 28 | * 设置图标(通过提供的参数) 29 | 30 | 图标可以通过将 `optionLeaveType` 设置为恰当的值来改变。 可使用的图标在 `Mount & Blade II Bannerlord\GUI\GauntletUI\SpriteParts\ui_group1\GameMenu`目录下,相关的信息可在 `Mount & Blade II Bannerlord\Modules\Native\GUI\Brushes\GameMenu.xml`查看。 当然,你自己的模组可以重写这些东西,但是不能额外添加更多的`LeaveTypes`。 31 | | Type | Image | 32 | | ------------------- | ----- | 33 | | Default | | 34 | | Mission | | 35 | | Submenu | | 36 | | BribeAndEscape | | 37 | | Escape | | 38 | | Craft | | 39 | | ForceToGiveGoods | | 40 | | ForceToGiveTroops | | 41 | | RansomAndBribe | | 42 | | LeaveTroopsAndFlee | | 43 | | OrderTroopsToAttack | | 44 | | Raid | | 45 | | HostileAction | | 46 | | Recruit | | 47 | | Trade | | 48 | | Wait | | 49 | | Leave | | 50 | | Continue | | 51 | | Manage | | 52 | | WaitQuest | | 53 | | Surrender | | 54 | | Conversation | | 55 | | DefendAction | | 56 | -------------------------------------------------------------------------------- /ru/_intro/getting-started.md: -------------------------------------------------------------------------------- 1 | # Начало 2 | 3 | ## Важно 4 | 5 | Прежде чем продолжить, важно хорошо понять файл [SubModule.xml](../_xmldocs/submodule.md), так как этот файл сообщает игре, что он должен загружать, когда выбран ваш мод. 6 | 7 | ## Инструменты 8 | 9 | ### C# IDE 10 | 11 | * [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) (не требуется для базовых модов) 12 | 13 | ### Текстовые редакторы 14 | 15 | Подойдет любой текстовый редактор, но рекомендуется один из следующих... 16 | 17 | * [Visual Studio Code](https://code.visualstudio.com/download) 18 | * [Sublime Text](https://www.sublimetext.com/) 19 | * [Notepad++](https://notepad-plus-plus.org/downloads/) 20 | 21 | ## Моддинг без C# 22 | 23 | Есть несколько аспектов игры, которые вы можете модифицировать без знания C#. Сюда входят сцены, предметы, культуры, персонажи, пользовательские интерфейсы Gauntlet и многое другое. 24 | 25 | ## Моддинг с C# 26 | 27 | Система моддинга, основанная на модулях, делает моддинг в Bannerlord намного проще, чем в предыдущих играх этой серии, и значительно усложняет ваши моды. 28 | 29 | ## Создание модуля 30 | 31 | В Bannerlord самостоятельный мод называется Модулем, и единственная необходимая часть - это сама папка SubModule и файл `SubModule.xml`, который сообщает программе запуска о вашем моде. 32 | 33 | 1. Создайте новую папку в каталоге `Modules` в файлах игры, имя папки должно совпадать с именем вашего SubModule. 34 | 2. Создайте файл `SubModule.xml` в новой папке. Вы можете [увидеть пример](../_xmldocs/submodule.md) или найти полную документацию [здесь](../_xmldocs/submodule.md). 35 | 36 | ## Следующие шаги 37 | 38 | - Обратитесь к статье [Структура папок](folder-structure.md) для получения дополнительной информации о том, какие дополнительные каталоги нужно добавить, в зависимости от предполагаемого содержимого вашего мода. 39 | - Обратитесь к статье [Базовый C#](../_tutorials/basic-csharp-mod.md) Мод за примером того, как установить, собрать и запустить код в Bannerlord. 40 | - Обратитесь к статье [Моддинг Пользовательского Интерфейса Gauntlet без C#](../_tutorials/modding-gauntlet-without-csharp.md) для получения информации о том, как модифицировать интерфейсы Gauntlet без использования C#. 41 | 42 | ### ``Переведено сайтом commando.com.ua`` -------------------------------------------------------------------------------- /_tutorials/modding-gauntlet-without-csharp.md: -------------------------------------------------------------------------------- 1 | # 不需要C#的UI系统Mod入门 # 2 | 3 | ## 重要提示 4 | ### 本教程中,你 **不能** 使用任何依赖性的模组 *(译者注:即其它模组运行需要的前置模组,如Native)* 5 | ### 尽管这方面应该不会有什么问题。 6 | 7 | ### Mods which plan to "overwrite" Gauntlet UIs from Official Modules **MUST** be loaded **BEFORE** that Official Module. For this reason, it is highly recommended that you do not use `DependedModules` for these types of mods. Hopefully this will be addressed by TaleWorlds in the future. 8 | 9 | 接下来的指南将在不使用任何C#的情况下,一步一步地教你创建可以重写任何Gauntlet UI的Mod。在这个例子中,我们将使用一些自定义的文本重写任务UI。 10 | 11 | ## 准备 12 | 13 | #### 在本教程中, 我们将要做的Mod命名为 `ExampleUIMod`. 14 | 15 | ### 设置好你的模组 \(SubModule.xml\) 16 | 17 | 1. 到游戏目录下,找到 `Modules` 文件夹。 18 | 2. 创建新文件夹,命名为 `ExampleUIMod` (必须和你在步骤#5中使用同样的 Id) 19 | 3. 创建新文件夹,命名为 `GUI` 并打开。 20 | 4. 在GUI文件夹中,创建文件夹并命名为`Prefabs`。我们等会儿会用到它。 21 | 5. 回到步骤#2中你所创建的模组文件夹 *(即ExampleUIMod,译者注)*,并且创建文件`SubModule.xml`,然后把如下代码粘贴到文件里: 22 | ```xml 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ``` 34 | 6. 运行启动器,保证你的Mod能够在`Singleplayer` > `Mods`下出现。 35 | 36 | 要获取更多模组文件结构的信息, [点击这里](../_intro/folder-structure.md) 37 | 38 | ## 重写一个Gauntlet UI 39 | 40 | 注意: 你可以重写任何 Gauntlet UI. 然而,在本教程中, 我们只重写任务UI。 41 | 42 | 1. 到目录`Modules\SandBox\GUI\Prefabs\QuestsScreen` 并且复制 `QuestsScreen.xml` 文件到剪贴板。 43 | 2. 到“设置好你的模组”步骤#4中,你所创建的`Prefabs`文件夹下,粘贴`QuestsScreen.xml` 文件。 44 | 3. 在文本编辑器中打开粘贴的文件。 45 | 4. 搜索定位 (Ctrl+F) `Text="@QuestTitleText"`。 46 | 5. 替换 `@QuestTitleText` (包括 @ 符号) 为你想要的标题。 47 | 6. 保存文件。 48 | 7. 打开霸主启动器并且切换至 `Singleplayer` > `Mods` 界面,确保你的Mod打了勾,然后启动游戏,随便选个存档开始游戏。 49 | 8. 打开任务UI,你应该能够在屏幕的中上方看到你添加的的文本。 50 | 9. 你已经成功创建了你第一个霸主Gauntlet Mod! 51 | 52 | ## 如何启用&使用动态UI编辑 53 | 54 | 动态UI编辑,是使你生活**大大**轻松的游戏特性。不幸的是,它不是你在基础版本的游戏内部就能启用的。 55 | 56 | 要启用它, 你必须 [下载 DeveloperConsole Mod](https://www.nexusmods.com/mountandblade2bannerlord/mods/4). 57 | 58 | 只要你下载 & 安装好了 Developer Console Mod, 按以下步骤操作,就能在游戏中启用动态编辑。 59 | 60 | 1. 打开游戏启动器,确保 `Singleplayer` > `Mods`界面的 `Developer Console`和你的Gauntlet UI Mod打上勾。 61 | 2. Developer Console Mod 使用 `CTRL` + `~`(波浪符) 快捷键开启控制台。如果你发现快捷键不起作用, 尝试按下CTRL,然后按下 你键盘上Tab和Esc之间的那个键。 62 | 3. 现在你已经看见了控制台,你会想键入`ui.toggle_debug_mode`命令来启用动态UI编辑特性。 63 | 4. 任何你对UI的改动,都应该会自动更新到游戏中。 64 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/Flags/README.md: -------------------------------------------------------------------------------- 1 | # 旗帜 Flags 2 | 3 | ## 父节点 Parent node 4 | - [物品 Item](../../Item) 5 | 6 | ## 子节点 Child nodes 7 | - *无 None* 8 | 9 | ## 属性 Attributes 10 | [Civilian](#civilian) | [UseTeamColor](#useteamcolor) | [DoesNotHideChest](#doesnothidechest) | [DropOnWeaponChange](#droponweaponchange) | [ForceAttachOffHandPrimaryItemBone](#forceattachoffhandprimaryitembone) | [HeldInOffHand](#heldinoffhand) | [HasToBeHeldUp](#hastobeheldup) | [WoodenParry](#woodenparry) | [DoNotScaleBodyAccordingToWeaponLength](#donotscalebodyaccordingtoweaponlength) | [QuickFadeOut](#quickfadeout) | [CannotBePickedUp](#cannotbepickedup) | [DropOnAnyAction](#droponanyaction) | [ForceAttachOffHandSecondaryItemBone](#forceattachoffhandsecondaryitembone) 11 | 12 | - #### Civilian 13 | **类型:** `boolean` 14 | **接受的值:** `'true', 'false'` 15 | **范例:** `true` 16 | *待查明作用* 17 | 18 | - #### UseTeamColor 19 | **类型:** `boolean` 20 | **接受的值:** `'true', 'false'` 21 | **范例:** `true` 22 | *待查明作用* 23 | 24 | - #### DoesNotHideChest 25 | **类型:** `boolean` 26 | **接受的值:** `'true', 'false'` 27 | **范例:** `true` 28 | *待查明作用* 29 | 30 | - #### DropOnWeaponChange 31 | **类型:** `boolean` 32 | **接受的值:** `'true', 'false'` 33 | **范例:** `true` 34 | *待查明作用* 35 | 36 | - #### ForceAttachOffHandPrimaryItemBone 37 | **类型:** `boolean` 38 | **接受的值:** `'true', 'false'` 39 | **范例:** `true` 40 | *待查明作用* 41 | 42 | - #### HeldInOffHand 43 | **类型:** `boolean` 44 | **接受的值:** `'true', 'false'` 45 | **范例:** `true` 46 | *待查明作用* 47 | 48 | - #### HasToBeHeldUp 49 | **类型:** `boolean` 50 | **接受的值:** `'true', 'false'` 51 | **范例:** `true` 52 | *待查明作用* 53 | 54 | - #### WoodenParry 55 | **类型:** `boolean` 56 | **接受的值:** `'true', 'false'` 57 | **范例:** `true` 58 | *待查明作用* 59 | 60 | - #### DoNotScaleBodyAccordingToWeaponLength 61 | **类型:** `boolean` 62 | **接受的值:** `'true', 'false'` 63 | **范例:** `true` 64 | *待查明作用* 65 | 66 | - #### QuickFadeOut 67 | **类型:** `boolean` 68 | **接受的值:** `'true', 'false'` 69 | **范例:** `true` 70 | *待查明作用* 71 | 72 | - #### CannotBePickedUp 73 | **类型:** `boolean` 74 | **接受的值:** `'true', 'false'` 75 | **范例:** `true` 76 | *能不能捡起来* 77 | 78 | - #### DropOnAnyAction 79 | **类型:** `boolean` 80 | **接受的值:** `'true', 'false'` 81 | **范例:** `true` 82 | *待查明作用* 83 | 84 | - #### ForceAttachOffHandSecondaryItemBone 85 | **类型:** `boolean` 86 | **接受的值:** `'true', 'false'` 87 | **范例:** `true` 88 | *待查明作用* 89 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/missionbehaviour/missionlogic.md: -------------------------------------------------------------------------------- 1 | # MissionLogic 2 | MissionLogic is an abstract class that inherits [MissionBehaviour](./). In addition to several additional callbacks, mission logics also have overridable methods that affect the logic of mission. 3 | 4 | ## Callbacks 5 | - `AccelerateHorseKeyPressAnswer()` - Seems to be a deprecated callback. Use of this is not recommended. 6 | - `OnBattleEnded()` - Called when player chooses to leave a mission with battle before it ends naturally. 7 | - `OnMissionResultReady(MissionResult)` - Called when a mission is complete and MissionResult is created. Note that this is called before `ShowBattleResults`. 8 | - `MissionResult` - Calculated mission result data. 9 | - `OnRetreatMission()` - Called when player retreats from a mission. Currently, missions with battle and arena missions seem to be missions where a player can retreat. 10 | - `ShowBattleResults()` - Called when a mission is complete and timer for the end mission call starts. This is called before end of mission callbacks. 11 | 12 | ## Overrides 13 | - `bool IsAgentInteractionAllowed()` - Called to determine if agents are interactable. Return true to allow interaction. Note that all mission logics need to return true for the end result to be true. 14 | - `bool IsOrderShoutingAllowed()` - Called to determine if order voices are allowed. Return true to allow voices. Note that all mission logics need to return true for the end result to be true. 15 | - `bool MissionEnded(ref MissionResult)` - Can be overrided to determine end of a mission. This is called every mission tick in additional to state based checks. Return true to trigger mission end. Note that only one mission logic returning true would be enough and first mission logic returning true would determine the `MissionResult`. 16 | - `MissionResult` - MissionResult instance to store result data. This parameter is passed with `ref` keyword. 17 | - `InquiryData OnEndMissionRequest(out bool)` - Called when player wants to leave the mission. An `InquiryData` can be returned to show a confirmation box. Note that the first non-null `InquiryData` returned by a mission logic will be shown and this callback won't be called for the rest. 18 | - `bool` - Determines if the player can leave the mission. This parameter is passed with `out` keyword. Set as true if the player can leave. Note that first mission logic setting it to false will prevent player from leaving and this callback won't be called for the rest. 19 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Horse/README.md: -------------------------------------------------------------------------------- 1 | # 马匹 Horse 2 | 3 | ## Parent Node 4 | - [ItemComponent](../../ItemComponent) 5 | 6 | ## Child Node 7 | - [Materials](Materials) 8 | 9 | ## Attributes 10 | [生物类型 monster](#monster) | [操纵性 maneuver](#maneuver) | [速度 speed](#speed) | [冲撞伤害 charge_damage](#charge_damage) | [体长 body_length](#body_length) | [能不能骑 is_mountable](#is_mountable) | [额外生命值 extra_health](#extra_health) | [骨骼大小 skeleton_scale](#skeleton_scale) | [伤害修正 modifier_group](#modifier_group) | [is_pack_animal](#is_pack_animal) | [decorator_key_min](#decorator_key_min) | [decorator_key_max](#decorator_key_max) | [mane_mesh](#mane_mesh) 11 | 12 | - #### monster 13 | **类型:** `string` 14 | **接受值:** `'Monster.horse', 'Monster.camel', 'Monster.mule', 'Monster.mule_unmountable', 'Monster.camel_unmountable', 'Monster.horse_2', 'Monster.cat', 'Monster.dog', 'Monster.sheep', 'Monster.cow', 'Monster.hog', 'Monster.goose', 'Monster.chicken'` 15 | **例子:** `Monster.horse` 16 | *骑乘的类型,比如马啊骆驼啊之类的* 17 | 18 | - #### maneuver 19 | **类型:** `int` 20 | **例子:** `73` 21 | *操纵性* 22 | 23 | - #### speed 24 | **类型:** `int` 25 | **例子:** `73` 26 | *速度* 27 | 28 | - #### charge_damage 29 | **类型:** `int` 30 | **例子:** `73` 31 | *冲撞伤害* 32 | 33 | - #### body_length 34 | **类型:** `int` 35 | **例子:** `73` 36 | *身体长度* 37 | 38 | - #### is_mountable 39 | **类型:** `boolean` 40 | **接受值:** `'true', 'false'` 41 | **例子:** `false` 42 | *能不能骑(骑牛与砍杀)* 43 | 44 | - #### extra_health 45 | **类型:** `int` 46 | **例子:** `81` 47 | *额外的生命中?正负皆可* 48 | 49 | - #### skeleton_scale 50 | **类型:** `string` 51 | **接受值:** `'aserai_horse', 'battania_horse', 'empire_horse', 'khuzait_horse', 'sturgia_horse', 'vlandia_horse'` 52 | **例子:** `aserai_horse` 53 | *预定义的骨骼缩放比例. 待查明数字是否有效以及定义这些常量的位置* 54 | 55 | - #### modifier_group 56 | **类型:** `string` 57 | **接受值:** `'horse'` 58 | **例子:** `horse` 59 | *不知道干嘛的(译者按:难道和盔甲一样有伤害减免?)* 60 | 61 | - #### is_pack_animal 62 | **类型:** `boolean` 63 | **接受值:** `'true', 'false'` 64 | **例子:** `false` 65 | *不知道干嘛的s* 66 | 67 | - #### decorator_key_min 68 | **类型:** `hex` 69 | **例子:** `0F` 70 | *不知道干嘛的* 71 | 72 | - #### decorator_key_max 73 | **类型:** `hex` 74 | **例子:** `0F` 75 | *不知道干嘛的* 76 | 77 | - #### mane_mesh 78 | **类型:** `id` 79 | **例子:** `horse_mane` 80 | *Mesh ID of the manes* 81 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/TournamentGame.md: -------------------------------------------------------------------------------- 1 | # TournamentGame 2 | This class is used to handle tournaments, their participants, and the inherent setup. 3 | to modify some of the behaviours, a Harmony patch might be required. 4 | 5 | **NOTE**: *This page is incomplete, so if you find anymore information on the subject, please create a pull request and add to this growing Modding Documentation!* 6 | 7 | ## Accessible Methods: 8 | #### `protected TournamentGame(Town town, ItemObject prize = null)` 9 | Internal method called after AddTournament and CreateTournament to set up the prize. 10 | 11 | ## Accessible Attributes: 12 | #### `public const int ParticipantNumber` 13 | The number of participants, currently hardcoded to 16 but patcheable. 14 | 15 | #### GET `public Town Town` 16 | The settlement where the TournamentGame is happening. 17 | #### GET `public CampaignTime CreationTime` 18 | The creation time of the TournamentGame. 19 | #### GET/SET `public QualificationMode Mode` 20 | The qualification mode, Either 'TeamScore' or 'IndividualScore', modifiable. 21 | #### GET `public virtual int MaxTeamSize` 22 | The maximum size of a team in every stage of the tournament. 23 | #### GET `public virtual int MaxTeamNumberPerMatch` 24 | The maximum number of teams per match in every stage of the tournament. 25 | #### GET `public ItemObject Prize` 26 | The prize of the tournament. 27 | #### GET `public virtual float TournamentWinRenown` 28 | The renown gained for winning the tournament. 29 | #### GET `public static List GetParticipantCharacters( Settlement settlement, int maxParticipantCount, bool includePlayer = true, bool includeHeroes = true )` 30 | This method defines, when a tournament starts, the participants. Called when a player joins a tournament or a tournament is simulated. 31 | #### `public abstract TextObject GetMenuText()` 32 | This method defines the text on the menu when joining a tournament. 33 | #### `public abstract void OpenMission( Settlement settlement, bool isPlayerParticipating )` 34 | This method is called when starting a tournament, wether simulated or with player participation. 35 | #### `public void PrepareForTournamentGame( bool isPlayerParticipating )` 36 | This method is called when starting a tournament, wether simulated or with player participation. 37 | 38 | Example usage: 39 | ```csharp 40 | foreach (var settlement in Settlement.All) { 41 | if (settlement.HasTournament) { 42 | var tournament = Campaign.Current.TournamentManager.GetTournamentGame(settlement.Town); 43 | showMessage("Tournament at : " + settlement.Town.StringId + " with up to " + tournament.MaxTeamNumberPerMatch + " teams per match."); 44 | } 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/campaigngamestarter.md: -------------------------------------------------------------------------------- 1 | # CampaignGameStarter 2 | This class can be used to introduce behaviours, dialog, menus and models for campaigns, and implements the IGameStarter interface. This is useful in the `OnGameStart` method in [MBSubModuleBase](mbsubmodulebase.md), which is shown in the example. 3 | 4 | **NOTE**: *This page is incomplete, so if you find anymore information on the subject, please create a pull request and add to this growing Modding Documentation!* 5 | 6 | ## Accessible Methods: 7 | #### `public void ClearEmptyObjects()` 8 | (Work in progress) 9 | #### `public void AddBehavior(CampaignBehaviorBase campaignBehavior)` 10 | Adds the [Campaign Behavior](campaignbehaviorbase.md) to the current campaign. 11 | #### `public void AddModel(GameModel model)` 12 | Adds the [Game Model](../core/gamemodel.md) to the current campaign. 13 | #### `public void LoadGameTexts(string xmlPath)` 14 | (Work in progress) Loads XML file at the inputted path, introducing more texts to the game. These texts are in the same format as the *comment_strings.xml* file, with their purpose currently not determined. 15 | #### `public void LoadGameMenus(Type typeOfGameMenusCallbacks, string xmlPath)` 16 | (Work in progress) Loads XML file at the inputted path, introducing more menus to the game. 17 | #### `public void AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, GameMenu.MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null)` 18 | See [GameMenu](gamemenu.md) for use. 19 | #### `public void AddWaitGameMenu(string idString, string text, OnInitDelegate initDelegate, OnConditionDelegate condition, OnConsequenceDelegate consequence, OnTickDelegate tick, GameMenu.MenuAndOptionType type, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, float targetWaitHours = 0f, GameMenu.MenuFlags flags = GameMenu.MenuFlags.none, object relatedObject = null)` 20 | (Work in progress) 21 | #### `public void AddGameMenuOption(string menuId, string optionId, string optionText, GameMenuOption.OnConditionDelegate condition, GameMenuOption.OnConsequenceDelegate consequence, bool isLeave = false, int index = -1, bool isRepeatable = false)` 22 | See [GameMenu](gamemenu.md) for use. 23 | ## Accessible Attributes: 24 | **NOTE**: *All of these are get/read only* 25 | #### `public readonly bool IsTutorial` 26 | Whether or not the campaign starts with a tutorial. 27 | #### `public ICollection CampaignBehaviors` 28 | Collection of all registered [Campaign Behaviours](campaignbehaviorbase.md). 29 | #### `public IEnumerable Models` 30 | Enumerable Set of all registered [Game Models](../core/gamemodel.md) 31 | 32 | ## Example Use: 33 | This is used within our [MBSubModuleBase]() class: 34 | ```csharp 35 | protected override void OnGameStart(Game game, IGameStarter gameStarter) 36 | { 37 | if(game.GameType is Campaign) 38 | { 39 | //Current game is a campaign, so IGameStarter object must be CampaignGameStarter 40 | CampaignGameStarter campaignStarter = (CampaignGameStarter) gameStarter; 41 | //Can now use CampaignGameStarter 42 | } 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/campaignbehaviorbase.md: -------------------------------------------------------------------------------- 1 | # CampaignBehaviorBase 2 | This is an abstract class within [TaleWorlds.CampaignSystem](./README.md), and can be inherited to code for unique behaviours within the game's campaign. 3 | 4 | ## Abstract Methods: 5 | #### ```public abstract void RegisterEvents()``` 6 | When defining this method, you can introduce consequences to certain events, by use of the `CampaignEvents.On...` methods. A simple example would be: 7 | ```csharp 8 | public override void RegisterEvents() 9 | { 10 | CampaignEvents.OnClanDestroyedEvent.AddNonSerializedListener(this, new Action( 11 | clan => { 12 | String clanName = clan.Name.ToString(); 13 | InformationManager.DisplayMessage(new InformationMessage("The " + clanName + " was destroyed!")); 14 | })); 15 | } 16 | ``` 17 | The above example registers an event, such that when a clan is destroyed, a message is broadcasted to the chat. The `AddNonSerializedListener` method called here requires the second argument to be an action, which is described [here](https://docs.microsoft.com/en-us/dotnet/api/system.action-1?view=netframework-4.8). 18 | 19 | #### ```public abstract void SyncData(IDataStore dataStore)``` 20 | 21 | Here you can manipulate data that your `Behavior` requires persist between saves. However, most `Behavior` won't need it and you can leave it empty if you wish. 22 | 23 | If you do require it, the general form looks like this: 24 | 25 | ```csharp 26 | public override void SyncData(IDataStore dataStore) 27 | { 28 | dataStore.SyncData(string_id_for_var, ref the_variable_itself); 29 | } 30 | ``` 31 | 32 | For example, here is the storage of a counter of an event: 33 | 34 | ```csharp 35 | // inside your class 36 | private int _numVillagesRaided; 37 | 38 | public override void SyncData(IDataStore dataStore) 39 | { 40 | dataStore.SyncData("_numVillagesRaided", ref _numVillagesRaided); 41 | } 42 | ``` 43 | 44 | Perhaps you might increase this number every time the player raids a village, which will now persist between saves, and if they do it enough maybe give them something, like some gold or extra Roguery experience, or whatever you want. 45 | 46 | The syntax is very simple, the first argument is a string identifier for what you are storing. This only needs to be unique within a given `Behavior` class, so you don't have to worry about having the same name as in someone else's `Behavior`. The second argument is a reference to the variable itself to save or load. You don't need to worry about which is happening, the game will handle it. If the player loads a save, it will write it to that variable, and if they save their game, it will read from it and into the save. 47 | 48 | ## Registering Campaign Behaviors: 49 | Within your [MBSubModuleBase](../mountandblade/mbsubmodulebase.md) class, you can utilise the `OnGameStart` Method to add the behavoir to a campaign. An example is given below: 50 | ```csharp 51 | protected override void OnGameStart(Game game, IGameStarter gameStarter) 52 | { 53 | if(game.GameType is Campaign) 54 | { 55 | //The current game is a campaign 56 | CampaignGameStarter campaignStarter = (CampaignGameStarter) gameStarter; 57 | campaignStarter.AddBehavior(new ExampleBehavior()); 58 | //ExampleBehavoir is our custom class which extends CampaignBehaviorBase 59 | } 60 | } 61 | ``` 62 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Armor/README.md: -------------------------------------------------------------------------------- 1 | # 防具 Armor 2 | 3 | ## 父节点 Parent Node 4 | - [ItemComponent](../../ItemComponent) 5 | 6 | ## 子节点 Child Node 7 | - *无 None* 8 | 9 | ## 属性 Attributes 10 | [头部护甲 head_armor](#head_armor) | [男女不同模型 has_gender_variations](#has_gender_variations) | [遮盖头发模式 hair_cover_type](#hair_cover_type) | [修正类型 modifier_group](#modifier_group) | [材质类型 material_type](#material_type) | [遮盖胡子模式 beard_cover_type](#beard_cover_type) | [躯干护甲 body_armor](#body_armor) | [腿部护甲 leg_armor](#leg_armor) | [手部护甲 arm_armor](#arm_armor) | [覆盖躯干 covers_body](#covers_body) | [(?) body_mesh_type](#body_mesh_type) | [覆盖双腿 covers_legs](#covers_legs) | [覆盖双手 covers_hands](#covers_hands) | [(?) mane_cover_type](#mane_cover_type) | [family_type](#family_type) | [操作性修正 maneuver_bonus](#maneuver_bonus) | [速度修正 speed_bonus](#speed_bonus) | [冲刺修正 charge_bonus](#charge_bonus) | [缰绳模型 reins_mesh](#reins_mesh) | [覆盖头部 covers_head](#covers_head) 11 | 12 | - #### head_armor 13 | **类型:** `int` 14 | **范例:** `64` 15 | *头部护甲值* 16 | 17 | - #### has_gender_variations 18 | **类型:** `boolean` 19 | **范例:** `true` 20 | *男女是否使用不同模型* 21 | 22 | - #### hair_cover_type 23 | **类型:** `string` 24 | **接受值:** `'all', 'type1', 'type2', 'type3'` 25 | **范例:** `all` 26 | *待查明type1,type2,type3分别是啥样的* 27 | 28 | - #### modifier_group 29 | **类型:** `string` 30 | **接受值:** `'cloth_unarmoured', 'leather', 'plate', 'chain', 'cloth'` 31 | **范例:** `leather` 32 | *可能影响伤害吸收?* 33 | 34 | - #### material_type 35 | **类型:** `string` 36 | **接受值:** `'Cloth', 'Leather', 'Plate', 'Chainmail'` 37 | **范例:** `Cloth` 38 | *护甲的材质* 39 | 40 | - #### beard_cover_type 41 | **类型:** `string` 42 | **接受值:** `'type3', 'type2', 'none', 'all', 'type1'` 43 | **范例:** `none` 44 | *类似遮盖头发模式* 45 | 46 | - #### body_armor 47 | **类型:** `int` 48 | **范例:** `23` 49 | *躯干护甲值* 50 | 51 | - #### leg_armor 52 | **类型:** `int` 53 | **范例:** `23` 54 | *腿部护甲值* 55 | 56 | - #### arm_armor 57 | **类型:** `int` 58 | **范例:** `23` 59 | *手部护甲值* 60 | 61 | - #### covers_body 62 | **类型:** `boolean` 63 | **接受值:** `'true', 'false'` 64 | **范例:** `true` 65 | *护甲是否覆盖躯干* 66 | 67 | - #### body_mesh_type 68 | **类型:** `string` 69 | **接受值:** `'shoulders'` 70 | **范例:** `shoulders` 71 | *待查明作用* 72 | 73 | - #### covers_legs 74 | **类型:** `boolean` 75 | **接受值:** `'true', 'false'` 76 | **范例:** `true` 77 | *是否覆盖双腿* 78 | 79 | - #### covers_hands 80 | **类型:** `boolean` 81 | **接受值:** `'true', 'false'` 82 | **范例:** `true` 83 | *是否覆盖双手* 84 | 85 | - #### mane_cover_type 86 | **类型:** `string` 87 | **接受值:** `'none', 'all'` 88 | **范例:** `none` 89 | *待查明覆盖部位* 90 | 91 | - #### family_type 92 | **类型:** `int` 93 | **接受值:** `'1', '2'` 94 | **范例:** `1` 95 | *待查明作用* 96 | 97 | - #### maneuver_bonus 98 | **类型:** `int` 99 | **范例:** `12` 100 | *不知道是对人还是对马的操作性修正(译者认为是马铠对马的操纵性修正)* 101 | 102 | - #### speed_bonus 103 | **类型:** `int` 104 | **范例:** `11` 105 | *不知道是对人还是对马的速度修正(译者认为是马铠对马的速度修正)* 106 | 107 | - #### charge_bonus 108 | **类型:** `int` 109 | **范例:** `11` 110 | *不知道是对人还是对马的冲刺修正(译者认为是马铠对马的冲刺修正)* 111 | 112 | - #### reins_mesh 113 | **类型:** `string` 114 | **范例:** `horse_harness_vlandia_b_rein` 115 | *缰绳的模型ID* 116 | 117 | - #### covers_head 118 | **类型:** `boolean` 119 | **接受值:** `'true', 'false'` 120 | **范例:** `true` 121 | *是否覆盖头部* 122 | -------------------------------------------------------------------------------- /_csharp-api/savesystem/README.md: -------------------------------------------------------------------------------- 1 | # Save System 2 | 3 | ### Warning! 4 | As of e1.0.10/e1.1.0 when defining custom data that inherits the game's basic types, be extra careful. 5 | If the data will be saved to the game's internal storage, upon removing your mod the save won't be able to load because of your missing custom data. 6 | This will be the case when definining custom ``LogEntry`` types and passing them to the game (``LogEntry.AddLogEntry(customLog);``. 7 | As a workaround, you should either include a feature to fully remove your custom data from the game or provide a mod for it. 8 | 9 | 10 | ## SaveableTypeDefiner 11 | For defining custom classes and structs, implement your own ``TaleWorlds.SaveSystem.SaveableTypeDefiner``. 12 | You don't need to register it somewhere, the game will find it itself via reflection. 13 | ```csharp 14 | public class CustomSaveDefiner : SaveableTypeDefiner 15 | { 16 | // use a big number and ensure that no other mod is using a close range 17 | public CustomSaveDefiner() : base(2 _333_000) { } 18 | 19 | protected override void DefineClassTypes() 20 | { 21 | // The Id's here are local and will be related to the Id passed to the constructor 22 | AddClassDefinition(typeof(CustomMapNotification), 1); 23 | AddStructDefinition(typeof(ExampleStruct), 2); 24 | AddClassDefinition(typeof(ExampleNested), 3); 25 | AddStructDefinition(typeof(NestedStruct), 4); 26 | } 27 | 28 | protected override void DefineContainerDefinitions() 29 | { 30 | ConstructContainerDefinition(typeof(List)); 31 | } 32 | } 33 | ``` 34 | 35 | ## SaveableField and SaveableProperty 36 | To mark data in your custom class/struct as savable, use ``TaleWorlds.SaveSystem.SaveableFieldAttribute`` and ``TaleWorlds.SaveSystem.SaveablePropertyAttribute``. 37 | It seems that there is noreal difference between ``SaveableField`` and ``SaveableProperty``, but if you used one of them, stick to the type. They are not interchangeable and the data won't be loaded if types awe swicthed. 38 | 39 | ```csharp 40 | public struct ExampleStruct 41 | { 42 | // Local ID's start from one if the class/struct does not inherit from any 43 | // game's types with saveable data 44 | [SaveableField(1)] 45 | public PartyBase Attacker; 46 | } 47 | 48 | public class CustomMapNotification : InformationData 49 | { 50 | // InformationData already contains 5 definitions, so start from 6 for custom data 51 | [SaveableProperty(6)] 52 | public Hero Mercenary { get; set; } 53 | 54 | [SaveableProperty(7)] 55 | public bool IsHandled { get; set; } 56 | } 57 | 58 | public struct NestedStruct 59 | { 60 | [SaveableField(1)] 61 | public bool Flag; 62 | } 63 | public class ExampleNested 64 | { 65 | [SaveableField(1)] 66 | public NestedStruct Data; 67 | } 68 | ``` 69 | 70 | ## CampaignBehaviorBase.SyncData 71 | There is also "shared data" that could be used between one/miltiple ``CampaignBehaviorBase``. 72 | With it you can store custom container data, such as: 73 | * Array 74 | * List 75 | * Dictionary 76 | * Queue 77 | ```csharp 78 | public class CustomBehavior : CampaignBehaviorBase 79 | { 80 | private List _customDataMap = new List(); 81 | 82 | public override void SyncData(IDataStore dataStore) 83 | { 84 | dataStore.SyncData("customDataMap", ref _customDataMap); 85 | } 86 | } 87 | ``` 88 | 89 | 90 | ### Notes: 91 | The community should decide how to handle ``saveBaseId`` collisions. 92 | -------------------------------------------------------------------------------- /_xmldocs/NPCCharacters/NPCCharacter/README.md: -------------------------------------------------------------------------------- 1 | # NPCCharacter(NPC角色) 2 | (译者注:不单单指玩家在酒馆里招的同伴) 3 | 4 | ## 父节点 5 | - [NPCCharacters](../../NPCCharacters) 6 | 7 | ## 子节点 8 | - [equipment](equipment) 9 | - [equipmentSet](equipmentSet) 10 | - [face](face) 11 | - [skills](skills) 12 | - [Traits](Traits) 13 | - [upgrade_targets](upgrade_targets) 14 | 15 | ## 属性 16 | [id](#id) | [name](#name) | [default_group](#default_group) | [is_hero](#is_hero) | [civilianTemplate](#civiliantemplate) | [occupation](#occupation) | [culture](#culture) | [skill_template](#skill_template) | [skill_template](#skill_template_1) | [is_female](#is_female) | [level](#level) | [is_basic_troop](#is_basic_troop) | [upgrade_requires](#upgrade_requires) | [formation_position_preference](#formation_position_preference) | [battleTemplate](#battletemplate) | [age](#age) | [voice](#voice) 17 | 18 | - #### id 19 | **数据类型:** `string` 20 | **例子:** `npc_wanderer_equipment_template_aserai` 21 | *NPC的ID用于游戏引用人物* 22 | 23 | - #### name 24 | **数据类型:** `string` 25 | **例子:** `{=wW3iouiU}Hijab` 26 | *注意: 在 `{=}`格式中前缀,是在strings.txt中的翻译id。* 27 | 28 | - #### default_group 29 | **数据类型:** `string` 30 | **可选取值:** `Infantry` | `General` | `Ranged` | `HorseArcher` | `Cavalry` 31 | **例子:** `Infantry` 32 | *不区分大小写。 命令NPC时所属的默认组。* 33 | 34 | - #### is_hero 35 | **数据类型:** `boolean` 36 | **可接受取值:** `true` | `false` 37 | **例子:** `true` 38 | *待办: 去找找它到底有什么作用* 39 | 40 | - #### civilianTemplate 41 | **数据类型:** `reference` 42 | **例子:** `NPCCharacter.npc_wanderer_equipment_template_empire` 43 | *引用对应着某个市民装备模板.* 44 | 45 | - #### occupation 46 | **数据类型:** `string` 47 | **可选取值:** `Wanderer` | `Soldier` | `Townsfolk` | `Mercenary` | `Gangster` | `PrisonGuard` | `Judge` | `Blacksmith` | `Weaponsmith` | `NotAssigned` | `RansomBroker` | `ShopKeeper` | `ShopWorker` | `Tavernkeeper` | `TavernGameHost` | `Musician` | `TavernWench` | `Armorer` | `HorseTrader` | `GoodsTrader` | `ArenaMaster` | `Villager` | `CaravanGuard` | `BannerBearer` 48 | **例如:** `Wanderer` 49 | *NPC的职业* 50 | 51 | - #### culture 52 | **数据类型:** `string` 53 | **可选取值:** `Culture.empire` | `Culture.aserai` | `Culture.sturgia` | `Culture.khuzait` | `Culture.battania` | `Culture.vlandia` | `Culture.darshi` | `Culture.nord` | `Culture.vakken` | `Culture.neutral_culture` 54 | **例子:** `Culture.empire` 55 | *NPC所属的派系* 56 | 57 | - #### skill_template 58 | **数据类型:** `reference` 59 | **例子:** `NPCCharacter.infantry_heavyinfantry_level1_template_skills` 60 | *引用对应着某个技能加点模板* 61 | 62 | - #### is_female 63 | **数据类型:** `boolean` 64 | **可接受取值:** `true` | `false` 65 | **例子:** `true` 66 | *NPC是否为女性* 67 | 68 | - #### level 69 | **数据类型:** `int` 70 | **例子:** `5` 71 | *NPC的等级* 72 | 73 | - #### is_basic_troop 74 | **数据类型:** `boolean` 75 | **可接受取值:** `true` | `false` 76 | **例子:** `true` 77 | *待办: 搞清楚这个是干嘛的* 78 | 79 | - #### upgrade_requires 80 | **数据类型:** `ItemCategory reference` 81 | **可选取值:** `ItemCategory.horse` | `ItemCategory.war_horse` 82 | **例子:** `ItemCategory.horse` 83 | *NPC升级必须的物品* 84 | 85 | - #### formation_position_preference 86 | **数据类型:** `Formation reference` 87 | **可能取值:** `Back` 88 | **例子:** `Back` 89 | *阵地位置偏好* 90 | 91 | - #### battleTemplate 92 | **数据类型:** `NPCCharacter reference` 93 | **例子:** `NPCCharacter.npc_wanderer_equipment_template_empire` 94 | *战役装备模板* 95 | 96 | - #### age 97 | **数据类型:** `int` 98 | **例子:** `45` 99 | *NPC的年龄* 100 | 101 | - #### voice 102 | **数据类型:** `string` 103 | **可选取值:** `curt` 104 | **例子:** `curt` 105 | *NPC的声线类型* 106 | 107 | -------------------------------------------------------------------------------- /_tutorials/new_settlements.md: -------------------------------------------------------------------------------- 1 | # How settlements work 2 | The way the game adds settlements is by combining two XML based files: One to define what type of settlement it is (hideout, village, city, castle etc.), who owns it and other relevant parameters such as prosperity, production, which town a village belongs to etc. 3 | This definition happens in the base game under Modules/SandBox/ModuleData/settlements.xml 4 | Beside this file is a distance cache Modules/SandBox/ModuleSata/Settlements_distance_cache.bin, which can be generated in code. 5 | 6 | This definition does not however define the actual visuals of the settlement. This is done inside Modules/SandBox/SceneObj/Main_map/scene.xscene file. 7 | 8 | # Notes on future SDK support 9 | From other code in the available DLLs it is evident that settlement modding is supposed to occur by using an editor. This editor helps place settlements, define their visuals and also generates the aforementioned distance cache. 10 | For now, none of that exists and one has to resort to pure XML modding. 11 | 12 | # Notes on the distance cache 13 | It is unclear what the distance cache actually does. Without updating it AI seems to visit added settlements just fine, they recruit troops there, offload prisoners and buy goods. Players can also enter the new settlements just fine. 14 | The distance cache might be associated with some AI decision making, but it is unclear. The distance cache is created by the method SaveSettlementDistanceCache() in SettlementPositionScript, which is a class that is not used in the game currently, supposedly originating from the aforementioned map editor. 15 | The class can be found in SandBox.View.dll. 16 | 17 | # How to override the default settlements of the game 18 | When creating a mod it is possible to override the definitions from the SandBox module. It is not however possible to append (add) things to the files, so if you want to make changes to settlements 19 | you need to make changes to everything. 20 | 21 | Start by copying Modules/SandBox/ModuleData/settlements.xml into Modules/YourModName/ModuleData/settlements.xml as well as Modules/SandBox/SceneObj/Main_map (a folder) to Modules/YourModName/SceneObj/Main_map. 22 | 23 | If you can avoid it, don't use the regular notepad for XML editing. Instead use a proper XML editing tool or a more capable text editor such as Notepad++. 24 | 25 | Inside Modules/YourModName/submodule.xml add the following XmlNode 26 | 27 | ``` 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ``` 36 | The Main_map is loaded automatically. 37 | 38 | Within settlements.xml you can now copy e.g. a town and customize it however you want, or change some of the existing towns (by e.g. changing the owner, changing starting prosperity, changing production of it etc.). 39 | It is *imperative* that every entry in settlements.xml has its own id. 40 | 41 | Within your mods Main_map/scene.xscene file there needs to be a game_entity for each entry in your settlements.xml file. Make sure not to have any duplicate id's. 42 | 43 | 44 | An example for a new entry (i.e. adding to the existing file, not entirely replacing its contents) to settlements.xml that adds a town and two villages [can be found here](https://pastebin.com/BuSbQ6x2). 45 | 46 | Note that, the two entries for villages village_M1_1 and village_M1_2 have entries for which town they are bound to: 47 | 48 | ``` 49 | trade_bound="Settlement.town_M1" bound="Settlement.town_M1" 50 | ``` 51 | 52 | This is useful for villages bound to castles, which cannot be traded with. These villages must have a settlement to trade with outside of the castle that they're bound to, so you may specify which that is here. 53 | The villages also include definitions for which good you want them to produce: 54 | 55 | ``` 56 | village_type="VillageType.fisherman" 57 | ``` 58 | Village types are defined in Modules/SandBox/ModuleData/spprojects.xml. 59 | 60 | These three new settlements need correspondin game_entity definitions in the Main_map/scene.xscene file. An example entry [can be found here](https://pastebin.com/dXcKT7wf) 61 | 62 | 63 | -------------------------------------------------------------------------------- /_tutorials/basic-csharp-mod.md: -------------------------------------------------------------------------------- 1 | # 基本 C\# Mod 2 | 3 | ## 介绍 4 | 5 | 本文档旨在一步一步教你如何创建一个简单的 C\# Mod。这个Mod将会在单人模式的标题页面增加一个叫做 `消息` 的按钮。当点击按钮的时候,将会在聊天界面输出 `Hello World`。 6 | 7 | ## 准备 8 | 9 | #### 在本教程中,我们的项目名字叫做 `ExampleMod`。 10 | 11 | ### 配置你的Module \(SubModule.xml\) 12 | 13 | 1. 到你的游戏目录下并且选定 `Modules` 目录; 14 | 2. 创建一个新的目录并且叫做 `ExampleMod` (这个目录名称必须和第四步里面的 Id 一致) Create a new folder and name it `ExampleMod` (Must be the same as the Id you use for Step #4); 15 | 3. 创建一个名叫 `bin` 的目录, 并且在这个目录下,创建一个新的目录 `Win64_Shipping_Client`; 16 | 4. 在 `ExampleMod` 目录下建一个新的文件 `SubModule.xml` (必须是这个名字), 同时复制如下内容进去: 17 | 18 | ```xml 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ``` 46 | 47 | **提示**: `MySubModule` 是我们在[编程]((#programming))指导部分要用到的设定的类名字。 48 | 49 | 5. 如果你在用其他名字,上述的内容要按照需要修改。 50 | 6. 启动游戏,确保你的 Mod 出现 `Singleplayer` > `Mods`。 51 | 52 | 对于Mod文件结构的信息,请参考[这里](../_intro/folder-structure.md) 53 | 54 | ### 配置项目 55 | 56 | 创建 C\# 项目之前,要明白的是,如果只是修改/增加物品,人物或场景的话,可以不需要创建项目。 57 | 58 | 1. 启动 Microsoft Visual Studio 并且选择 `创建新项目`。 59 | 2. 选择 `类库 (.NET Framework)`。 60 | 3. 给项目起名字并且选择框架 `.NET Framework 4.7.2`。如果不能选这个选项,可以从[这里](https://dotnet.microsoft.com/download/dotnet-framework/net472)下载。下载\(开发者包\) 61 | 4. 现在你的项目已经创建好,设置你的[构建路径](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-change-the-build-output-directory?view=vs-2019)到你的游戏目录下的`Modules/MyModule/bin/Win64_Shipping_Client`。 62 | 5. [引用](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019) 游戏目录(不是指Modules目录)`bin\Win64_Shipping_Client`下的所有`TaleWorlds.*` DLLs 文件。并且引用每个官方模组的 `TaleWorlds.*` DLLs文件,目录为 `Modules\ModuleName\bin\Win64_Shipping_Client`。 63 | 64 | ### Debugging 项目 (可选) 65 | 66 | #### 方法一 (推荐) 67 | 1. 打开 项目属性 到 `Debug` 选项卡。 68 | 2. 选择 `启动外部程序` 选项,同时浏览到你游戏目录下(不是Modules目录)的`bin\Win64_Shipping_Client`文件夹里面的 `Bannerlord.exe`。 69 | 3. 设置工作目录到游戏目录(不是Modules目录)下的 `bin\Win64_Shipping_Client`。 70 | 4. 添加如下的命令行参数(要确定替代 `MyModule` 的名字) 71 | * `/singleplayer _MODULES_*Native*SandBox*SandBoxCore*StoryMode*CustomBattle*MyModule*_MODULES_` 72 | 73 | #### 方法二 (如果你想从启动器窗口开始 Debugging) 74 | 1. 打开 项目属性 到 `Debug` 选项卡; 75 | 2. 选择 `打开外部程序` 选项同时浏览到你的游戏目录下(不是你的Mod目录)`bin\Win64_Shipping_Client` 文件夹下的 `TaleWorlds.MountAndBlade.Launcher.exe`; 76 | 3. 设定你的工作目录是游戏目录下的 `bin\Win64_Shipping_Client` 77 | 78 | ## 编程 79 | 80 | 1. 添加或打开 `MySubModule` 类。 81 | 2. 添加如下的引用。 82 | 83 | ```csharp 84 | using TaleWorlds.Core; 85 | using TaleWorlds.Localization; 86 | using TaleWorlds.MountAndBlade; 87 | ``` 88 | 89 | 3. 继承 `MBSubModuleBase` 类 90 | 4. 重载 `OnSubModuleLoad()` 方法 91 | 5. 添加如下代码到这个方法: 92 | 93 | ```csharp 94 | Module.CurrentModule.AddInitialStateOption(new InitialStateOption("Message", 95 | new TextObject("消息", null), 96 | 9990, 97 | () => { InformationManager.DisplayMessage(new InformationMessage("Hello World!")); }, 98 | false)); 99 | ``` 100 | 101 | 6. 编译你的项目并且确认输出到 `Modules\ExampleMod\bin\Win64_Shipping_Client` 下 102 | 7. 打开霸主启动器,并且选择 `Singleplayer` > `Mods` 然后选择你的 Mod, 然后启动游戏。 103 | 8. 在标题页面,你应该能看到一个按钮叫做 `消息` ,点击你应该能看到 `Hello World` 出现在屏幕左下角。 104 | 9. 现在你已经成功创建了第一个骑马与砍杀2:霸主的Mod! 105 | 106 | 107 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Weapon/README.md: -------------------------------------------------------------------------------- 1 | # Weapon 2 | 3 | ## Parent Node 4 | - [ItemComponent](../../ItemComponent) 5 | 6 | ## Child Node 7 | - [WeaponFlags](WeaponFlags) 8 | 9 | ## Attributes 10 | [武器类别 weapon_class](#weapon_class) | [平衡 weapon_balance](#weapon_balance) | [thrust_speed](#thrust_speed) | [速度 speed_rating](#speed_rating) | [投射物速度 missile_speed](#missile_speed) | [长度 weapon_length](#weapon_length) | [挥砍伤害 swing_damage](#swing_damage) | [挥砍伤害的类型 swing_damage_type](#swing_damage_type) | [武器使用 item_usage](#item_usage) | [材质 physics_material](#physics_material) | [弹药类型 ammo_class](#ammo_class) | [弹药限制 ammo_limit](#ammo_limit) | [准确度 accuracy](#accuracy) | [戳刺伤害 thrust_damage](#thrust_damage) | [戳刺伤害类型 thrust_damage_type](#thrust_damage_type) | [重心 center_of_mass](#center_of_mass) | [弹药量 stack_amount](#stack_amount) | [旋转角度 rotation](#rotation) | [掠过的声音 passby_sound_code](#passby_sound_code) | [旋转速度 rotation_speed](#rotation_speed) | [飞行的声音 flying_sound_code](#flying_sound_code) | [击中后的角度 sticking_rotation](#sticking_rotation) | [击中后的位置 sticking_position](#sticking_position) | [轨迹粒子效果 trail_particle_name](#trail_particle_name) | [位置 position](#position) | [躯干护甲 body_armor](#body_armor) | [耐久度 hit_points](#hit_points) 11 | 12 | - #### weapon_class 13 | **类型:** `string` 14 | **接受值:** `'OneHandedAxe', 'Bow', 'OneHandedSword', 'TwoHandedPolearm', 'Crossbow', 'Stone', 'Arrow', 'Boulder', 'Bolt', 'LargeShield', 'Banner'` 15 | **例子:** `OneHandedAxe` 16 | *武器的类别* 17 | 18 | - #### weapon_balance 19 | **类型:** `int` 20 | **例子:** `100` 21 | *武器的平衡* 22 | 23 | - #### thrust_speed 24 | **类型:** `int` 25 | **例子:** `12` 26 | *Thrust speed of the weapon* 27 | 28 | - #### speed_rating 29 | **类型:** `int` 30 | **例子:** `60` 31 | *武器速度* 32 | 33 | - #### missile_speed 34 | **类型:** `int` 35 | **例子:** `60` 36 | *射出的投射物速度* 37 | 38 | - #### weapon_length 39 | **类型:** `int` 40 | **例子:** `60` 41 | *武器长度* 42 | 43 | - #### swing_damage 44 | **类型:** `int` 45 | **例子:** `60` 46 | *挥砍伤害值* 47 | 48 | - #### swing_damage_type 49 | **类型:** `string` 50 | **接受值:** `'Pierce', 'Blunt', 'Cut'` 51 | **例子:** `Pierce` 52 | *挥砍伤害的类型* 53 | 54 | - #### item_usage 55 | **类型:** `string` 56 | **接受值:** `'torch', 'bow', 'long_bow', 'onehanded_block_shield_swing', 'polearm_block_thrust', 'crossbow_fast', 'crossbow', 'stone', '', 'heavy_stone', 'arrow_top', 'arrow_right', 'hand_shield', 'shield', 'banner'` 57 | **例子:** `heavy_stone` 58 | *武器是咋用的* 59 | 60 | - #### physics_material 61 | **类型:** `string` 62 | **接受值:** `'metal_weapon', 'wood_weapon', 'missile', 'ballista_missile', 'burning_ballista', 'boulder_stone', 'burning_jar', 'wood_shield', 'metal_shield'` 63 | **例子:** `metal_shield` 64 | *武器的材质(诸如铁制盾,铁制武器,木制武器)* 65 | 66 | - #### ammo_class 67 | **类型:** `string` 68 | **接受值:** `'Arrow', 'Bolt', 'Stone', 'Boulder'` 69 | **例子:** `Arrow` 70 | *弹药类型(箭矢、弩矢等)* 71 | 72 | - #### ammo_limit 73 | **类型:** `int` 74 | **例子:** `1` 75 | *弹药限制,不知道是'一个弹匣'还是'一次射出'。* 76 | 77 | - #### accuracy 78 | **类型:** `int` 79 | **例子:** `21` 80 | *远程武器的准确度* 81 | 82 | - #### thrust_damage 83 | **类型:** `int` 84 | **例子:** `21` 85 | *戳刺伤害* 86 | 87 | - #### thrust_damage_type 88 | **类型:** `string` 89 | **接受值:** `'Pierce', 'Blunt', 'Cut'` 90 | **例子:** `Pierce` 91 | *戳刺伤害类型* 92 | 93 | - #### center_of_mass 94 | **类型:** `vector3d` 95 | **例子:** `0.15,0,0` 96 | *武器中心位置,不知道干嘛用的* 97 | 98 | - #### stack_amount 99 | **类型:** `int` 100 | **例子:** `23` 101 | *应该是一袋箭有多少支这种* 102 | 103 | - #### rotation 104 | **类型:** `vector3d` 105 | **例子:** `100,30,20` 106 | *不知道干嘛用的(译者按:可能是飞斧之类扔出后模型的旋转角度向量)* 107 | 108 | - #### passby_sound_code 109 | **类型:** `string` 110 | **例子:** `event:/mission/combat/missile/passby` 111 | *投射物掠过人物发出的声音* 112 | 113 | - #### rotation_speed 114 | **类型:** `double` 115 | **例子:** `0.5` 116 | *不知道干嘛用的(译者按:可能是飞斧之类扔出后模型的旋转速度)* 117 | 118 | - #### flying_sound_code 119 | **类型:** `string` 120 | **例子:** `event:/mission/combat/missile/foley/passby` 121 | *投射物飞行发出的声音* 122 | 123 | - #### sticking_rotation 124 | **类型:** `vector3d` 125 | **例子:** `90,0,0` 126 | *不知道干嘛用的(译者按:与之前的旋转角度类似,结合下一个属性,可能是击中后模型的旋转角度,飞斧击中盾牌后全都是同一个角度)* 127 | 128 | - #### sticking_position 129 | **类型:** `vector3d` 130 | **例子:** `90,0,0` 131 | *不知道干嘛用的(译者按:似乎是旋转中心?结合上一个属性,可能是击中后模型的相对位置)* 132 | 133 | - #### trail_particle_name 134 | **类型:** `string` 135 | **例子:** `psys_game_missile_flame` 136 | *弹药飞行轨迹的粒子效果* 137 | 138 | - #### position 139 | **类型:** `vector3d` 140 | **例子:** `-0.04, -0.05, 0.01` 141 | *位置,暂时不知道是啥位置* 142 | 143 | - #### body_armor 144 | **类型:** `int` 145 | **例子:** `82` 146 | *武器提供的躯干护甲值,不知道对于其他部位是否有效* 147 | 148 | - #### hit_points 149 | **类型:** `int` 150 | **例子:** `820` 151 | *盾的耐久度* -------------------------------------------------------------------------------- /_xmldocs/Items/Item/ItemComponent/Weapon/WeaponFlags/README.md: -------------------------------------------------------------------------------- 1 | # WeaponFlags 2 | 3 | ## Parent Node 4 | - [Weapon](../../Weapon) 5 | 6 | ## Child Node 7 | - *None* 8 | 9 | ## Attributes 10 | [MeleeWeapon](#meleeweapon) | [RangedWeapon](#rangedweapon) | [HasString](#hasstring) | [StringHeldByHand](#stringheldbyhand) | [NotUsableWithOneHand](#notusablewithonehand) | [TwoHandIdleOnMount](#twohandidleonmount) | [AutoReload](#autoreload) | [UnloadWhenSheathed](#unloadwhensheathed) | [PenaltyWithShield](#penaltywithshield) | [WideGrip](#widegrip) | [CantReloadOnHorseback](#cantreloadonhorseback) | [Consumable](#consumable) | [UseHandAsThrowBase](#usehandasthrowbase) | [AmmoSticksWhenShot](#ammostickswhenshot) | [MultiplePenetration](#multiplepenetration) | [Burning](#burning) | [LeavesTrail](#leavestrail) | [CanPenetrateShield](#canpenetrateshield) | [MissileWithPhysics](#missilewithphysics) | [AmmoCanBreakOnBounceBack](#ammocanbreakonbounceback) | [AffectsArea](#affectsarea) | [AmmoBreaksOnBounceBack](#ammobreaksonbounceback) | [AttachAmmoToVisual](#attachammotovisual) | [CanBlockRanged](#canblockranged) | [HasHitPoints](#hashitpoints) 11 | 12 | - #### MeleeWeapon 13 | **类型:** `boolean` 14 | **接受值:** `'true', 'false'` 15 | **例子:** `true` 16 | *If the weapon is a melee weapon* 17 | 18 | - #### RangedWeapon 19 | **类型:** `boolean` 20 | **接受值:** `'true', 'false'` 21 | **例子:** `true` 22 | *If the weapon is a ranged weapon* 23 | 24 | - #### HasString 25 | **类型:** `boolean` 26 | **接受值:** `'true', 'false'` 27 | **例子:** `true` 28 | *If the ranged weapon has a string. Should be set to true for both Bows and Crossbows* 29 | 30 | - #### StringHeldByHand 31 | **类型:** `boolean` 32 | **接受值:** `'true', 'false'` 33 | **例子:** `true` 34 | *If the string is held by hand. Should be set to true with Bows* 35 | 36 | - #### NotUsableWithOneHand 37 | **类型:** `boolean` 38 | **接受值:** `'true', 'false'` 39 | **例子:** `true` 40 | *If the weapon cannot be used in 1 hand* 41 | 42 | - #### TwoHandIdleOnMount 43 | **类型:** `boolean` 44 | **接受值:** `'true', 'false'` 45 | **例子:** `true` 46 | *This is set to true with most bows and crossbows. TODO: figure out what this exactly does.* 47 | 48 | - #### AutoReload 49 | **类型:** `boolean` 50 | **接受值:** `'true', 'false'` 51 | **例子:** `true` 52 | *If set to false an action is required to reload the weapon. (crossbows)* 53 | 54 | - #### UnloadWhenSheathed 55 | **类型:** `boolean` 56 | **接受值:** `'true', 'false'` 57 | **例子:** `true` 58 | *If the weapon should remove any loaded projectile when sheathed* 59 | 60 | - #### PenaltyWithShield 61 | **类型:** `boolean` 62 | **接受值:** `'true', 'false'` 63 | **例子:** `true` 64 | *If the weapon has a damage penalty when using with shield* 65 | 66 | - #### WideGrip 67 | **类型:** `boolean` 68 | **接受值:** `'true', 'false'` 69 | **例子:** `true` 70 | *TODO: figure out what this does* 71 | 72 | - #### CantReloadOnHorseback 73 | **类型:** `boolean` 74 | **接受值:** `'true', 'false'` 75 | **例子:** `true` 76 | *If the weapon can be reloaded on horseback* 77 | 78 | - #### Consumable 79 | **类型:** `boolean` 80 | **接受值:** `'true', 'false'` 81 | **例子:** `true` 82 | *If the weapon can be consumed. Set to true for arrows and throwables.* 83 | 84 | - #### UseHandAsThrowBase 85 | **类型:** `boolean` 86 | **接受值:** `'true', 'false'` 87 | **例子:** `true` 88 | *If the weapon is thrown from the hand* 89 | 90 | - #### AmmoSticksWhenShot 91 | **类型:** `boolean` 92 | **接受值:** `'true', 'false'` 93 | **例子:** `true` 94 | *TODO: figure out what this exactly does* 95 | 96 | - #### MultiplePenetration 97 | **类型:** `boolean` 98 | **接受值:** `'true', 'false'` 99 | **例子:** `true` 100 | *If the projectile can pierce through multiple entities* 101 | 102 | - #### Burning 103 | **类型:** `boolean` 104 | **接受值:** `'true', 'false'` 105 | **例子:** `true` 106 | *If the projectile is on fire. TODO: figure out if this also inflicts fire damage, or sets fire to stuff* 107 | 108 | - #### LeavesTrail 109 | **类型:** `boolean` 110 | **接受值:** `'true', 'false'` 111 | **例子:** `true` 112 | *If the weapon leaves a trail. TODO: figure out what this exactly does* 113 | 114 | - #### CanPenetrateShield 115 | **类型:** `boolean` 116 | **接受值:** `'true', 'false'` 117 | **例子:** `true` 118 | *If the projectile can penetrate a shield* 119 | 120 | - #### MissileWithPhysics 121 | **类型:** `boolean` 122 | **接受值:** `'true', 'false'` 123 | **例子:** `true` 124 | *If physics are attached to a projectile. TODO: figure out if this is used to damage props as well.* 125 | 126 | - #### AmmoCanBreakOnBounceBack 127 | **类型:** `boolean` 128 | **接受值:** `'true', 'false'` 129 | **例子:** `true` 130 | *TODO: figure out what this exactly does* 131 | 132 | - #### AffectsArea 133 | **类型:** `boolean` 134 | **接受值:** `'true', 'false'` 135 | **例子:** `true` 136 | *TODO: figure out if this is AOE damage?* 137 | 138 | - #### AmmoBreaksOnBounceBack 139 | **类型:** `boolean` 140 | **接受值:** `'true', 'false'` 141 | **例子:** `true` 142 | *TODO: figure out what this exactly does* 143 | 144 | - #### AttachAmmoToVisual 145 | **类型:** `boolean` 146 | **接受值:** `'true', 'false'` 147 | **例子:** `true` 148 | *TODO: figure out what this exactly does* 149 | 150 | - #### CanBlockRanged 151 | **类型:** `boolean` 152 | **接受值:** `'true', 'false'` 153 | **例子:** `true` 154 | *If an item can block projectiles (shields)* 155 | 156 | - #### HasHitPoints 157 | **类型:** `boolean` 158 | **接受值:** `'true', 'false'` 159 | **例子:** `true` 160 | *If an item has hitpoints (shields)* 161 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/agent.md: -------------------------------------------------------------------------------- 1 | Work In Progress by Watikita, V1.1 2 | # Agent [Type] 3 | 4 | 你可以把媒介(`agent`)想象成游戏里任何**能走动**的实体。 5 | 6 | 比方说可以是玩家,NPC,甚至是一匹马。 7 | 8 | ## Relevant methods and properties 9 | 10 | | Syntax | Return Type | Does What? | Available Values/Extensions | Example | 11 | |-----------------------------|-----------------------------|---------------------------------------------------------|----------------------------------------|-------------------------------------------------| 12 | | unit.Age | public float | Get/Set the age of the agent | N/A | `float age = unit.Age` | 13 | | unit.AgentRole | public AgentRole | Get/Set the role of the agent | I have no idea. | I have no idea. | 14 | | unit.Scale | public float | Get the scaling factor of the agent | N/A | `float scale = unit.Scale` | 15 | | unit.AIStateFlags | public AIStateFlag | Get or sets the [state flag] of the AI | Alarmed, Cautious, Guard, None, Paused | `unit.AIStateFlags = Agent.AIStateFlag.Alarmed` | 16 | | unit.AttackDirection | public AttackDirection | Get the direction the Agent is attacking towards | Top, Left, Down, Right | | 17 | | unit.Character | public BasicCharacterObject | Used to link between Hero.MainHero and the player Agent | [unit.Character] | | 18 | | unit.ClearAttachedWeapons | public void | Clears the weapons attached to the Agent | N/A | Method | 19 | | unit.ClearAttachedEquipment | public void | Clears the equipment attached to the Agent | N/A | Method | 20 | | unit.ClothingColor1 | public Color | Gets the clothing color of the agent | N/A | I have no idea. | 21 | | unit.Controller | public Contorller | Get/Set the controller of the agent | Player, AI | I have no idea. | 22 | | unit.CrouchMode | public bool | Returns true if the agent is crouched | N/A | bool crouch = unit.CrouchMode; | 23 | 24 | ## Relevant boolean properties 25 | 26 | 27 | ## Tips 28 | 29 | * You can get the player agent through the `Agent.Main` property (assuming they are alive). 30 | 31 | # Agent [Class] 32 | The agent class is the class used to access the universal types of properties that all Agents have. 33 | 34 | ## Nested Enums 35 | 36 | | Name | Type | Contains / Does | Arguments/Enum listings | Tips | 37 | |----------------------|------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------| 38 | | Agent.AiStateFlag | Enum | A set of all available State Flags | Alarmed, Cautious, Guard, None, Paused, UseObjectMoving, UseObjectUsing, UseObjectWaiting | | 39 | | Agent.ControllerType | Enum | A set of all available Control Types, if control type is player the agent is player-controlled | AI, Count, None, Player | Can be also use with Agent.Main.ControllerType to set to player controller | 40 | | Agent.CreationType | Enum | A set of all available Creation Types, only use is finding Horses afaik | FromCharacterObj, FromHorseObj, FromRooster, Invalid | | 41 | | Agent.KillInfo | Enum | A set of information related to how an Agent was killed, should dedicate an entire section | ALL weapon types, each has their own listings that return strings/ints | | 42 | | Agent.GuardMode | Enum | A set of all the defensive directions one could guard from | Top, Left, Down, Right | | 43 | | Agent.UsageDirection | Enum | A set of all directions and actions one could use do any held item. | AttackAny, AttackTop, AttackLeft, AttackCenter, AttackDown, AttackRight, DefendAny, DefendTop, DefendLeft, DefendCenter, DefendDown, DefendRight | | 44 | -------------------------------------------------------------------------------- /_xmldocs/Items/Item/README.md: -------------------------------------------------------------------------------- 1 | # 物品 Item 2 | 3 | ## 例子 4 | Source: Modules/SandBoxCore/ModuleData/spitems.xml 5 | ```xml 6 | 13 | 14 | 20 | 21 | 23 | 24 | ``` 25 | 26 | ## Parent node 27 | - [物品(类别) Items](../../Items) 28 | 29 | ## Child nodes 30 | - [物品组件 ItemComponent](ItemComponent) 31 | - [旗帜 Flags](Flags) 32 | 33 | ## Attributes 34 | [名称 name](#name) | [网格 mesh](#mesh) | [文化 culture](#culture) | [重量 weight](#weight) | [外观 appearance](#appearance) | [类型 Type](#type) | [多人模式物品 multiplayer_item](#multiplayer_item) | [子类型 subtype](#subtype) | [难度 difficulty](#difficulty) | [(?) lod_atlas_index](#lod_atlas_index) | [是否商品 is_merchandise](#is_merchandise) | [模型名 body_name](#body_name) | [(?) recalculate_body](#recalculate_body) | [(?) prefab](#prefab) | [价值 value](#value) | [收起位置 item_holsters](#item_holsters) | [弹药位置偏移 AmmoOffset](#ammooffset) | [(?) holster_position_shift](#holster_position_shift) | [(?) holster_body_name](#holster_body_name) | [容器模型 holster_mesh](#holster_mesh) | [容器(带武器)模型 holster_mesh_with_weapon](#holster_mesh_with_weapon) | [投射物模型 flying_mesh](#flying_mesh) | [盾牌碰撞模型 shield_body_name](#shield_body_name) | [(?) using_tableau](#using_tableau) | [(?) has_lower_holster_priority](#has_lower_holster_priority) | [物品类别 item_category](#item_category) | [是否食物 IsFood](#isfood) 35 | 36 | - #### name 37 | **类型:** `string` 38 | **范例:** `{=wW3iouiU}Hijab` 39 | *注意: 例子中的前缀 `{=}` 是string.txt中定义的翻译文本ID* 40 | *尚不知晓翻译文本ID是否为自动生成的* 41 | 42 | - #### mesh 43 | **类型:** `string` 44 | **范例:** `headscarf_d` 45 | *字符串为模型的ID* 46 | *尚未找出模型的存储位置* 47 | 48 | - #### culture 49 | **类型:** `string` 50 | **可能的值:** `'Culture.aserai', 'Culture.sturgia', 'Culture.battania', 'Culture.looters', 'Culture.khuzait', 'Culture.vlandia', 'Culture.empire', 'Culture.neutral_culture'` 51 | **范例:** `Culture.aserai` 52 | 53 | - #### weight 54 | **类型:** `double` 55 | **范例:** `0.5` 56 | 57 | - #### appearance 58 | **类型:** `double` 59 | **范例:** `0.5` 60 | *待办: 找出这个属性的具体作用* 61 | 62 | - #### Type 63 | **类型:** `ArmourType` 64 | **可能的值:** `'HeadArmor', 'headArmor', 'Cape', 'BodyArmor', 'HandArmor', 'LegArmor', 'OneHandedWeapon', 'Bow', 'Polearm', 'Crossbow', 'Thrown', 'Arrows', 'Bolts', 'Shield', 'Horse', 'HorseHarness', 'Goods', 'Banner', 'Animal'` 65 | **范例:** `HeadArmor` 66 | 67 | - #### multiplayer_item 68 | **类型:** `boolean` 69 | **可能的值:** `'true', 'false'` 70 | **范例:** `false` 71 | 72 | - #### subtype 73 | **类型:** `string` 74 | **可能的值:** `'head_armor', 'body_armor', 'bow', 'two_handed_wpn', 'arrows', 'horse'` 75 | **范例:** `head_armor` 76 | *待办: 查明作用* 77 | 78 | - #### difficulty 79 | **类型:** `int` 80 | **可能的值:** `0-100` 81 | **范例:** `80` 82 | 83 | - #### lod_atlas_index 84 | **类型:** `int` 85 | **范例:** `2` 86 | *待办: 查明作用* 87 | 88 | - #### is_merchandise 89 | **类型:** `boolean` 90 | **范例:** `false` 91 | *定义这件物品是否是商品(是否买得到)* 92 | 93 | - #### body_name 94 | **类型:** `id` 95 | **范例:** `bo_mace_a` 96 | *可能是武器的碰撞模型? 待办: 查明作用* 97 | 98 | - #### recalculate_body 99 | **类型:** `boolean` 100 | **可能的值:** `'true', 'false'` 101 | **范例:** `false` 102 | *待办: 查明作用* 103 | 104 | - #### prefab 105 | **类型:** `id` 106 | **范例:** `torch_a_wm_only_flame` 107 | *待办: 查明作用 可能是粒子效果?* 108 | 109 | - #### value 110 | **类型:** `int` 111 | **范例:** `150` 112 | *市场均价* 113 | 114 | - #### item_holsters 115 | **类型:** `string` 116 | **可能的值:** `'abdomen_left', 'bow_back_2:bow_hip:bow_hip_2:bow_back', 'bow_back:bow_back_2:bow_hip:bow_hip_2', 'sword_left_hip', 'polearm_back:polearm_back_2', 'bow_hip:bow_hip_2:bow_back:bow_back_2', 'crossbow_back:bow_hip:mace_right_hip:bow_hip_2', 'throwing_stone:throwing_stone_2', '', 'quiver_back_top:quiver_back_top_2', 'quiver_back_middle:quiver_bolts_2:quiver_bolts', 'quiver_back_lower:quiver_back_lower_2', 'quiver_back_middle:quiver_bolts:quiver_bolts_2', 'quiver_bolts:quiver_bolts_2:quiver_back_middle:quiver_back_top', 'quiver_back_middle:quiver_back_top:quiver_bolts:quiver_bolts_2', 'shield_round:shield_4', 'shield_oval:shield_4:shield_3:shield_2', 'shield:shield_2:shield_3:shield_4', 'shield_kite:shield_2:shield_3:shield_4'` 117 | **范例:** `abdomen_left` 118 | *收起状态下的携带位置* 119 | 120 | - #### AmmoOffset 121 | **类型:** `vector3d` 122 | **范例:** `0.0, 0.02131, 0.24675` 123 | *投射物的起始位置?* 124 | 125 | - #### holster_position_shift 126 | **类型:** `vector3d` 127 | **范例:** `0.0,0.0,-0.0` 128 | *待办: 查明作用(某种位置偏移)* 129 | 130 | - #### holster_body_name 131 | **类型:** `string` 132 | **范例:** `bo_axe_short` 133 | *待办: 查明作用(模型)* 134 | 135 | - #### holster_mesh 136 | **类型:** `string` 137 | **范例:** `stone_holster` 138 | *比如箭袋的模型* 139 | 140 | - #### holster_mesh_with_weapon 141 | **类型:** `string` 142 | **范例:** `stone_holster` 143 | *比如插着剑的剑鞘的模型* 144 | 145 | - #### flying_mesh 146 | **类型:** `string` 147 | **范例:** `arrow_bl_flying` 148 | *投射物模型* 149 | 150 | - #### shield_body_name 151 | **类型:** `string` 152 | **范例:** `bo_sturgia_shield_a` 153 | *盾牌的碰撞模型* 154 | 155 | - #### using_tableau 156 | **类型:** `boolean` 157 | **范例:** `true` 158 | *Whether the item has a tableau(不确定Tableau是什么)* 159 | 160 | - #### has_lower_holster_priority 161 | **类型:** `boolean` 162 | **范例:** `true` 163 | *待办: 查明作用* 164 | 165 | - #### item_category 166 | **类型:** `id` 167 | **可能的值:** `'horse', 'sumpter_horse', 'war_horse', 'wool', 'silver', 'jewelry', 'salt', 'cotton', 'flax', 'clay', 'pottery', 'linen', 'leather', 'velvet', 'cheese', 'butter', 'fish', 'grape', 'date_fruit', 'olives', 'beer', 'wine', 'oil', 'fur', 'animal', 'sheep', 'cow', 'hog'` 168 | **范例:** `horse` 169 | *交易界面的类型* 170 | 171 | - #### IsFood 172 | **类型:** `boolean` 173 | **范例:** `true` 174 | *能不能吃* 175 | -------------------------------------------------------------------------------- /_csharp-api/localization/TextObject.md: -------------------------------------------------------------------------------- 1 | # TextObject 2 | 3 | ## General Info 4 | The TextObject class is required to make in-game texts localizable. It would be a nice approach to use this class for any information that may ever be shown to a player. 5 | TextObject requires a string as a main value argument. It may be created using int or float arguments, in which case they are converted to string in the constructor. 6 | 7 | ## String IDs 8 | To become fully localizable, strings used in TextObjects should start with stringID: 9 | ```csharp 10 | private const string exampleString = "{=stringID}Some text"; 11 | public static readonly TextObject exampleTextObject = new TextObject (exampleString); 12 | ``` 13 | String ID is a string key of arbitrary length and content with no spaces. It is inadvisable to use long stringIDs, as it said to affect performance. 14 | Also, string IDs are global, so even if two different strings with same string ID are created and used in different game modules, 15 | they would still conflict (and some pretty bad things may happen then). Therefore, it is inadvisable to regulary use semantically meaningful keys as string IDs. 16 | Instead, use X-digit alphanumeric string codes for that, which look as follows: `{=zmR6sT03}`. 17 | As of now, TaleWords and most of the game modders use 8-digit alphanumeric string codes to generate string IDs in most cases. 18 | You can use this service to generate random keys: https://www.random.org/strings/ . Of course random matches are still possible, but quite unlikely. 19 | 20 | More information about using string IDs in the game’s XML files can be found in [Localization](README.md#notes-on-string-ids). 21 | 22 | ## Text variables 23 | Strings used in TextObjects could contain variables, which themselves are TextObjects. Variables are stored in the public property named Attributes: 24 | ```csharp 25 | public Dictionary Attributes 26 | ``` 27 | ### Defining text variables 28 | There are two ways to define a text variable for TextObject. You can do it in constructor, or with `SetTextVariable` method: 29 | ```csharp 30 | private const string SOME_STRING = "{=r6NczU68} Some text {TEXT_VARIABLE} more text {OTHER_TEXT_VARIABLE}."; 31 | 32 | public static TextObject GetSomeStringAsTextObject() 33 | { 34 | TextObject result = new TextObject(SOME_STRING, new Dictionary() { ["TEXT_VARIABLE"] = new TextObject("Variable value") }); 35 | string s = "Other variable value"; 36 | result.SetTextVariable("OTHER_TEXT_VARIABLE", s); 37 | return result; 38 | } 39 | ``` 40 | ### Complex text variables and cases 41 | As all text variables are TextObjects themselves, they could be quite complex. 42 | Note that any variables set to the nested TextObject could be used as properties in external TextObject. 43 | It is also worth noting that TextObjects do have basic built-in inline conditional processor. 44 | Consider following example: 45 | ```csharp 46 | private const string MAIN_STRING = 47 | "{=stringIDMain}I spent {NESTED_TEXT_OBJECT} this example! " + 48 | "By the way, using of number {VARIABLE_TAG} requires {VARIABLE_TAG.NESTED_PROPERTY} after it! " + 49 | "{BIT_FLAG}Conditional text example for when value of bitFlag = 1{?}Another conditional text example for when value of bitFlag = 0{\\?}."; 50 | 51 | private const string NESTED_STRING = "{=stringIDNested}{MINUTES} minutes to come up with and write"; 52 | private const string NESTED_PROPERTY_SINGULAR = "{=ie0XDdqR}singular noun"; 53 | private const string NESTED_PROPERTY_PLURAL = "{=oRPbCfYq}plural noun"; 54 | 55 | public static TextObject GetMainTextObject(int variable, bool flag) 56 | { 57 | TextObject mainTextObject = new TextObject(MAIN_STRING); 58 | TextObject nestedTextObject = new TextObject(NESTED_STRING, 59 | new Dictionary() { ["MINUTES"] = new TextObject(variable) }); 60 | mainTextObject.SetTextVariable("NESTED_TEXT_OBJECT", nestedTextObject); 61 | 62 | TextObject variableTextObject = new TextObject(variable); 63 | variableTextObject.SetTextVariable("NESTED_PROPERTY", variable == 1 ? NESTED_PROPERTY_SINGULAR : NESTED_PROPERTY_PLURAL); 64 | mainTextObject.SetTextVariable("VARIABLE_TAG", variableTextObject); 65 | mainTextObject.SetTextVariable("BIT_FLAG", flag ? 1 : 0); 66 | return mainTextObject; 67 | } 68 | ``` 69 | Then using of ` GetMainTextObject(40, true).ToString();` would return following string: 70 | ```csharp 71 | "I spent 40 minutes to come up with and write this example! By the way, using of number 40 requires plural noun after it! Conditional text example for when value of bitFlag = 1." 72 | ``` 73 | ### Note on nested properties 74 | Using of nested properties for complex objects could be very helpful to anyone translating your mod. Consider following example from TaleWorlds code: 75 | ```csharp 76 | TextObject textObject = new TextObject("{=jF4Nl8Au}{NPC_LIEGE.NAME}, {LIEGE_RELATIONSHIP}? Long may {?NPC_LIEGE.GENDER}she{?}he{\\?} live."); 77 | StringHelpers.SetCharacterProperties("NPC_LIEGE", Hero.OneToOneConversationHero.Clan.Leader.CharacterObject, null, textObject, false); 78 | ``` 79 | Method `StringHelpers.SetCharacterProperties` here is used to set several character-related attributes, that are used in the TextObject string. 80 | In this example character's Name and Gender are used. 81 | Adding such info to any string mentioning a character would be wise desision, as even if English phrasing you use does not require, for example, gender info, 82 | translation of the sentence to other language may have. 83 | 84 | Be wary though, that using multiple levels of nesting for properties is not supported, so using of something like `{NPC.CLAN.NAME}` is impossible - 85 | game text processor would return an empty sting, if you use several dots with one variable tag. 86 | ### Global text variables 87 | Sometimes you would need to use same info in several TextObjects. 88 | In that case you can define global text variable, that will be used by text processor for any TextObject when `.ToString()` method is called. To do so you will have to use 89 | ```csharp 90 | MBTextManager.SetTextVariable(StringTag, TextVariable); 91 | ``` 92 | [MBTextManager](MBTextManager.md) is a public static class. Any variable set to it will be used by game text processor for any TextObject as if it was defined for that TextObject itself. If you intend to use global text variables in the TextObject, you should not set any local text variables to it. Game text processor only uses variables stored in the MBTextManager if TextObject instance does not have it's own attributes. 93 | 94 | ## Default language 95 | Default language for the game is English, so any localizable string you use in design time should be defined in English. That way it would never be read from any game files, 96 | but instead would be built in your assembly. See more information on mantaining your XML files with game strings in [Localization](README.md#notes-on-std_module_strings_xml 97 | ). 98 | -------------------------------------------------------------------------------- /_csharp-api/inputsystem/input.md: -------------------------------------------------------------------------------- 1 | # Input 2 | 3 | `Input`这个静态类型用来提供输入功能。基本的输入系统并不是基于事件绑定的,而是采用轮询的方式。这部分内容比较直观,一般来说看函数名就知道用法,但也会有几个坑。 4 | 5 | ## Key Reading 6 | 7 | There's a number of useful methods that detect keys being pressed down in different ways, all seeming to return a 'bool'. Most common are `IsKeyDown`, `IsKeyPressed` and `IsKeyReleased` 8 | 9 | You can call them like so: `Input.IsKeyDown(InputKey.TheKeyCode)`. See here for a list of all keycodes: [link](#key-codes) 10 | 11 | You can also use the extension methods `IsDown`/`IsPressed`/`IsReleased` as such `KeyCode.A.IsPressed()` 12 | 13 | Below, you may find an in-depth documentation of each. 14 | 15 | #### Namespace 16 | 17 | This page assumes an import like so: `using TaleWorlds.InputSystem;` 18 | 19 | ### public static bool Input.IsKeyDown([InputKey](#key-codes) key) 20 | This checks to see if the specified [key] is currently being pressed, it returns true as long as the [key] is held down. 21 | 22 | Example: 23 | 24 | ```CSharp 25 | 26 | if(Input.IsKeyDown(InputKey.Y)) 27 | { 28 | 29 | //doSomething 30 | 31 | } 32 | ``` 33 | 34 | ### public static bool Input.IsKeyDownImmediate([InputKey](#key-codes) key) 35 | This acts as an intermediary check between `IsKeyDown` and `IsKeyPressed` 36 | 37 | Example: 38 | 39 | ```CSharp 40 | 41 | if(Input.IsKeyDownImmediate(InputKey.Y)) 42 | { 43 | 44 | //doSomething 45 | 46 | } 47 | ``` 48 | 49 | ### public static bool Input.IsKeyPressed([InputKey](#key-codes) key) 50 | This checks to see if the specified [key] has been pressed, it returns a bool once. 51 | 52 | Example: 53 | 54 | ```CSharp 55 | 56 | if(Input.IsKeyPressed(InputKey.Y)) 57 | { 58 | 59 | //doSomething 60 | 61 | } 62 | ``` 63 | ### public static bool Input.IsKeyReleased([InputKey](#key-codes) key) 64 | This checks to see if the specified [key] is not currently being pressed, it returns a bool once. 65 | 66 | Example: 67 | 68 | ```CSharp 69 | 70 | if(Input.IsKeyReleased(InputKey.Y)) 71 | { 72 | 73 | //doSomething 74 | 75 | } 76 | ``` 77 | #### To see how one could document the stages of a key using the above 3 methods: [example](#monitoring-a-keys-state) 78 | 79 | ### public static bool Input.IsControlOrShiftNotDown() 80 | I do not believe there is any other method more self-explanatory than this. Returns true while neither Control or Shift are down. 81 | 82 | ### public static bool Input.IsPressed([InputKey](#key-codes) key) 83 | Checks to see if a they specified [key] is currently pressed. Unlike IsDown, it can be used as Input.IsPressed() but not as an extension. 84 | 85 | ### public static Vector2 Input.GetKeyState([InputKey](#key-codes) key) 86 | Checks and returns the current state of the specified [key] as a Vector2. 87 | I am not aware how this can be used. 88 | 89 | Example: 90 | ```CSharp 91 | using System.Numerics; // WARNING, this assumes the existance of System.Numerics.Vectors.dll, 92 | // which has to be installed manually. 93 | using Taleworlds.InputSystem; 94 | 95 | Vector2 test = new Vector2(Input.GetKeyState(InputKey.A)); 96 | 97 | Vector2 compare = new Vector2(10, 10); 98 | 99 | if (Equals(test, compare)) 100 | InformationManager.DisplayMessage(new InformationMessage("Help please I'm forced to write this doc!")); 101 | 102 | ``` 103 | ### public static string Input.GetKeyboardText() 104 | Returns the text currently existing in the user's clipboard as a string. 105 | 106 | ### public static bool Input.IsMouseActive 107 | Checks to see if the mouse is currently active, if so returns `true`. 108 | 109 | ### public static bool Input.IsMouseScrollChanged 110 | Checks to see if the mouse scroll wheel is currently rotating, if so returns `true`. 111 | 112 | ### public static float Input.MouseMoveX 113 | Returns the horizontal position of the mouse as a float. 114 | 115 | ### public static float Input.MouseMoveY 116 | Returns the vertical position of the mouse as a float. 117 | 118 | ## Examples 119 | ### Monitoring a key's state 120 | ```CSharp 121 | protected override void OnApplicationTick(float dt) 122 | { 123 | int x = 0; 124 | int y = 0; 125 | int z = 0; 126 | //If X has been pressed, increment x by 1 127 | if(Input.IsKeyPressed(InputKey.X)) 128 | x++; 129 | //For each tick that X is being held down, increment y by 1 130 | if(Input.IsKeyDown(InputKey.X)) 131 | y++; 132 | //For each tick that X is untouched, increment z by 1 133 | if(Input.IsKeyReleased(InputKey.X)) 134 | z++; 135 | } 136 | ``` 137 | 138 | ## Key Codes 139 | 140 | As of Bannerlord 1.2.1 the following key codes are available: 141 | 142 | ```CSharp 143 | public enum InputKey 144 | { 145 | Invalid, 146 | Escape, 147 | D1, 148 | D2, 149 | D3, 150 | D4, 151 | D5, 152 | D6, 153 | D7, 154 | D8, 155 | D9, 156 | D0, 157 | Minus, 158 | Equals, 159 | BackSpace, 160 | Tab, 161 | Q, 162 | W, 163 | E, 164 | R, 165 | T, 166 | Y, 167 | U, 168 | I, 169 | O, 170 | P, 171 | OpenBraces, 172 | CloseBraces, 173 | Enter, 174 | LeftControl, 175 | A, 176 | S, 177 | D, 178 | F, 179 | G, 180 | H, 181 | J, 182 | K, 183 | L, 184 | SemiColon, 185 | Apostrophe, 186 | Tilde, 187 | LeftShift, 188 | BackSlash, 189 | Z, 190 | X, 191 | C, 192 | V, 193 | B, 194 | N, 195 | M, 196 | Comma, 197 | Period, 198 | Slash, 199 | RightShift, 200 | NumpadMultiply, 201 | LeftAlt, 202 | Space, 203 | CapsLock, 204 | F1, 205 | F2, 206 | F3, 207 | F4, 208 | F5, 209 | F6, 210 | F7, 211 | F8, 212 | F9, 213 | F10, 214 | Numpad7, 215 | Numpad8, 216 | Numpad9, 217 | NumpadMinus, 218 | Numpad4, 219 | Numpad5, 220 | Numpad6, 221 | NumpadPlus, 222 | Numpad1, 223 | Numpad2, 224 | Numpad3, 225 | Numpad0, 226 | NumpadPeriod, 227 | Extended, 228 | F11, 229 | F12, 230 | NumpadEnter, 231 | RightControl, 232 | NumpadSlash, 233 | RightAlt, 234 | NumLock, 235 | Home, 236 | Up, 237 | PageUp, 238 | Left, 239 | Right, 240 | End, 241 | Down, 242 | PageDown, 243 | Insert, 244 | Delete, 245 | ControllerLStick, 246 | ControllerRStick, 247 | LeftMouseButton, 248 | RightMouseButton, 249 | MiddleMouseButton, 250 | X1MouseButton, 251 | X2MouseButton, 252 | MouseScrollUp, 253 | MouseScrollDown, 254 | ControllerLStickUp, 255 | ControllerLStickDown, 256 | ControllerLStickLeft, 257 | ControllerLStickRight, 258 | ControllerRStickUp, 259 | ControllerRStickDown, 260 | ControllerRStickLeft, 261 | ControllerRStickRight, 262 | ControllerLUp, 263 | ControllerLDown, 264 | ControllerLLeft, 265 | ControllerLRight, 266 | ControllerRUp, 267 | ControllerRDown, 268 | ControllerRLeft, 269 | ControllerRRight, 270 | ControllerLBumper, 271 | ControllerRBumper, 272 | ControllerLOption, 273 | ControllerROption, 274 | ControllerLThumb, 275 | ControllerRThumb, 276 | ControllerLTrigger, 277 | ControllerRTrigger, 278 | } 279 | ``` 280 | -------------------------------------------------------------------------------- /_csharp-api/localization/README.md: -------------------------------------------------------------------------------- 1 | # Localization 2 | 3 | ## Related contents 4 | * [TextObject](TextObject.md) 5 | * [MBTextManager](MBTextManager.md) 6 | 7 | ## Developing localizable module 8 | Any game text can be implemented in such a way that it could be localized. In order to achieve that, when developing the module you should follow three basic rules: 9 | 1. Strings that can be visible in the interface should be stored in objects of the [TextObject](TextObject.md) class. 10 | 2. Each such line must have unique ID. 11 | 3. Every localizable string should be included in `std_module_strings_xml.xml` file under `..\Mount & Blade II Bannerlord\Modules\YourModName\ModuleData\Languages\` folder. 12 | 13 | ### Notes on using TextObjects 14 | Please, consider using additional [properties](TextObject.md#complex-text-variables-and-cases) when setting info on complex objects to the TextObject. That could do your life easier and be absolute lifesaver to the people who will translate the mod. For example, if you need to mention a character in some line, you could just store his name in the result TextObject and it would deal the trick, but translating of the line to other languages could become problematic. Alternatively, you could store in the TextObject several character properties, including Name and Gender. Then even if you don't need gender in that particular line in English, it may be used as a conditional factor in the translation. 15 | 16 |
17 | Here is an example of using properties and the conditionals in the TextObject string. 18 | 19 | ```csharp 20 | public const string conditionalString = 21 | "{=conditionalStringID}This proposal is on cooldown for {NUMBER_OF_DAYS} {?NUMBER_OF_DAYS.PLURAL_FORM}days{?}day{\\?}."; 22 | 23 | public static readonly TextObject conditionalTextObject = new TextObject(conditionalString); 24 | 25 | public static void SetNumericVariable(TextObject textObject, string variableKey, int variableValue) 26 | { 27 | if (string.IsNullOrEmpty(variableKey)) 28 | { 29 | return; 30 | } 31 | TextObject explainedTextObject = new TextObject(variableValue); 32 | explainedTextObject.SetTextVariable("PLURAL_FORM", variableValue != 1 ? 1 : 0); 33 | if (textObject is null) 34 | { 35 | MBTextManager.SetTextVariable(variableKey, explainedTextObject); 36 | } 37 | else 38 | { 39 | textObject.SetTextVariable(variableKey, explainedTextObject); 40 | } 41 | } 42 | ``` 43 | Calling 44 | ```csharp 45 | SetNumericVariable(conditionalTextObject, "NUMBER_OF_DAYS", 21); 46 | conditionalTextObject.ToString() 47 | ``` 48 | would return `"This proposal is on cooldown for 21 days."`, while calling 49 | ```csharp 50 | SetNumericVariable(conditionalTextObject, "NUMBER_OF_DAYS", 1); 51 | conditionalTextObject.ToString() 52 | ``` 53 | would return `"This proposal is on cooldown for 1 day."`. 54 |
55 | 56 | Worth a note that default game processing language is English, so it is advisable to use English lines in development. 57 | 58 | ### Notes on String IDs 59 | String ID is a string key of arbitrary length and content with no spaces or special symbols. It is inadvisable to use long stringIDs, as it said to affect performance. Also, string IDs are global, so even if two different strings with same string ID are created and used in different game modules, they would still conflict (and some pretty bad things may happen then). Therefore, it is inadvisable to regulary use semantically meaningful keys as string IDs. Instead, use X-digit alphanumeric string codes for that, which look as follows: {=zmR6sT03}. As of now, TaleWords and most of the game modders use 8-digit alphanumeric string codes to generate random string IDs. You can use this service to generate random keys: https://www.random.org/strings/ . This, however, is the basis for further reflection on the matter for the modding community, as while random matches are quite unlikely, they are still possible and could lead to the very unpleasant bugs. 60 | 61 | Any localizable string should **start** with a string ID: 62 | ```csharp 63 | private const string exampleString = "{=stringID}Some text"; 64 | public static readonly TextObject exampleTextObject = new TextObject (exampleString); 65 | ``` 66 | 67 | ### Notes on std_module_strings_xml 68 | Every localizable string should be included in the `std_module_strings_xml.xml` file under `..\Mount & Blade II Bannerlord\Modules\YourModName\ModuleData\Languages\` folder. 69 | Default game language is English and text processor expects every line you define in the code to be English. So creating `std_module_strings_xml.xml` with `` will be just for reference - no game texts will actually be loaded from it, but it may be used by module translators to create their language-specific versions (aka translations). 70 | 71 | Here is an example of `std_module_strings_xml.xml` for the above `exampleString` and `conditionalString`: 72 | ```xml 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | ``` 84 | 85 | ## Translating game module 86 | To translate game module you have to create a copy of every XML file under 87 | ``` 88 | ..\Mount & Blade II Bannerlord\Modules\ModName\ModuleData\Languages\ 89 | ``` 90 | folder and place it under 91 | ``` 92 | ..\Mount & Blade II Bannerlord\Modules\ModName\ModuleData\Languages\LanguageTagShort\ 93 | ``` 94 | folder. 95 | Then you will have to manually change `` from `"English"` to the language ID you would like to translate to. As of e.1.4.2 game automatically detects every language ID from every file of every module and adds it to the game menu. In earlier versions, while this also happened, changing in-game language to the new one could have resulted in crash, if that language ID was not also added in `..\Mount & Blade II Bannerlord\GUI\Fonts\Languages.xml`. 96 | 97 | Be wary that every language ID is a separate entity for the game, even if they are semantically means the same language, so, for example, if you have some xml files that use ``, they will be incompatible with xml files that use `` and only one set of them (currently selected in options) would be used, while every line from the other set will revert to default language. 98 | 99 | After you determined with the language ID, each text line should be translated with the original line IDs and all the variables preserved. For the above example: 100 | ```xml 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | ``` 112 | When translating, be careful - spacings, punctuation, and using upper or lower case symbols could matter. 113 | -------------------------------------------------------------------------------- /_csharp-api/mountandblade/missionbehaviour/README.md: -------------------------------------------------------------------------------- 1 | # MissionBehaviour 2 | 3 | Mission Behaviours are used to control the [Mission](../mission.md). This can be anything from spawning [Agents](../agent.md) to adding boundaries for the Mission. A mission can have any amount of mission behaviours. 4 | 5 | [MissionLogic](missionlogic.md) and [MissionViews](missionview.md) are both types of MissionBehaviours (they inherit MissionBehaviour). 6 | 7 | ## Properties 8 | - `BehaviourType` - Type of the mission behaviour. Currently can be Logic or Other. MissionLogic instances have Logic as set. For other mission behaviours, use of Other is recommended. 9 | - `DebugInput` - IInputContext instance for debugging. Note that released builds may not have a working instance. 10 | - `Mission` - [Mission](../mission.md) of this mission behaviour. If you add same mission behaviour instance to multiple missions, this property will hold the last one. Note that using same mission behaviour instance with multiple missions is not recommended unless you know what you are doing. 11 | 12 | ## Mission Callbacks 13 | - `OnAfterMissionCreated()` - Called right after the mission is created on C# side. Call of this callback will be the first method call of the mission beaviour. However, mission behaviours added after the mission is created won't have this callback called. 14 | - `OnBehaviourInitialize()` - Called right after the mission is fully created. This is the recommended callback for initialization. If a mission behaviour (including official ones) is added after the mission creation, this callback should be called manually. 15 | - `OnCreated()` - Called whenever a mission behaviour is added to a mission. 16 | - `EarlyStart()` - Called at the mission start, right before `AfterStart` callback. 17 | - `AfterStart()` - Called at the mission start. 18 | - `OnRenderingStarted()` - Called when rendering of the scene is started. 19 | - `OnPreMissionTick(float)` - Called at the start of tick on the engine side. 20 | - `float` - Time passed since last tick. 21 | - `OnPreDisplayMissionTick(float)` - Called at the start of tick mission tick. Note that this is called before agents and teams are ticked and also before `OnMissionTick`. 22 | - `float` - Time passed since last tick. 23 | - `OnMissionTick(float)` - Called once every frame. 24 | - `float` - Time passed since last tick. 25 | - `OnMissionActivate()` - Called when a deactivated mission is activated. 26 | - `OnMissionDeactivate()` - Callend when a mission is deactivated. 27 | - `OnMissionModeChange(MissionMode, bool)` - Called when mode of a mission is changed. 28 | - `MissionMode` - Old mode. 29 | - `bool` - True if it is the start of mission. 30 | - `OnClearScene()` - Called when the scene is being cleared. Note that this is called after after `OnRemove` and `OnDelete` called for all agents in the scene. This is the recommend callback for resetting mission behaviour when mission is reset. 31 | - `HandleOnCloseMission()` - Called when a mission is about to end. It is not recommend to override and use this callback. Prefer other callbacks like `OnEndMission` for end of the mission tasks. 32 | - `OnEndMission()` - Called when mission is ending. This is the recommend callback for end of the mission tasks. It is also recommended to unregister events in this callback if any registered. 33 | - `OnRemoveBehaviour()` - Called when a mission behaviour is removed from a mission. Note that mission behaviours are removed at the end of a mission, after resources are cleared and after `OnEndMission` callback. 34 | 35 | ## Agent Callbacks 36 | - `OnAgentCreated(Agent)` - Called after an agent created on the engine side. Called before OnAgentBuild. This is the recommended callback to add components to an agent. 37 | - `Agent` - Created agent. 38 | - `OnAgentBuild(Agent, Banner)` - Called after an agent is build and ready to be used but before it starts being used. This is the recommended callback for setting up spawned agents for the mission. 39 | - `Agent` - Built agent. 40 | - `Banner` - Banner of agent. Note that agents that do not have their own banners use banner of their team. 41 | - `OnAgentShootMissile(Agent, EquipmentIndex, Vec3, Vec3, Mat3, bool, int)` - Called whenever an agent shoots a missile. 42 | - `Agent` - Shooter agent. 43 | - `EquipmentIndex` - Index of the weapon used. Note that for weapons that use another item as ammunition, like bows and crossbows, this is the index of the weapon, not ammunition. 44 | - `Vec3` - Starting position. 45 | - `Vec3` - Velocity of missile as a vector. 46 | - `Mat3` - Orientation of the missile. Note that this is not the direction of movement but the orientation of the missile itself. 47 | - `bool` - True if the missile has a rigid body. 48 | - `int` - Index of the missile. Seems to be only used to sync server and client and -1 if not coming from the server. 49 | - `OnMissileCollisionReaction(Mission.MissileCollisionReaction, Agent, Agent, sbyte)` - Called after a missile reaction is calculated, generally after a missile hit. 50 | - `Mission.MissileCollisionReaction` - Calculated reaction. 51 | - `Agent` - Attacker agent. Can be null. 52 | - `Agent` - Defender agent. Can be null. 53 | - `sbyte` - Index of the bone missile attached to. 54 | - `OnMissileHit(Agent, Agent, bool)` - Called whenever a missile hits something. 55 | - `Agent` - Attacker agent. Can be null. 56 | - `Agent` - Defender agent. Can be null. 57 | - `bool` - True if hit is canceled. Currently a hit is canceled when it is friendly fire and friendly fire is not enabled. 58 | - `OnRegisterBlow(Agent, Agent, GameEntity, Blow, AttackCollisionData)` - Called after all the calculations for a hit is made. 59 | - `Agent` - Attacker agent. 60 | - `Agent` - Defender agent. Can be null. 61 | - `GameEntity` - Entity that has been hit. Can be null. 62 | - `Blow` - Information about the blow. 63 | - `AttackCollisionData` - Information about the attack. Also holds result of calculation. 64 | - `OnAgentHit(Agent, Agent, int, int, int)` - Called whenever an agent is hit. 65 | - `Agent` - Agent that is hit. 66 | - `Agent` - Attacker agent. Can be null. 67 | - `int` - Calculated damage. 68 | - `int` - Weapon kind index of the weapon. Note that this is the kind index of missile for ranged weapons, not the weapon used to shoot it. 69 | - `int` - Weapon usage index of the weapon. 70 | - `OnScoreHit(Agent, Agent, int, bool, float, float, float, AgentAttackType, float, int)` - Called whenever an agent is hit, right after `OnAgentHit`. 71 | - `Agent` - Agent that is hit. 72 | - `Agent` - Attacker agent. Can be null. 73 | - `int` - Weapon kind index of the weapon. Note that this is the kind index of missile for ranged weapons, not the weapon used to shoot it. 74 | - `bool` - True if the hit is blocked. 75 | - `float` - Calculated damage. 76 | - `float` - Damage bonus from relative movement speed of agents. This value is the multiplier giving just the bonus, for example 0.2 would mean 20% bonus damage from movement speed. Note that ranged hits do not have a movement speed bonus. 77 | - `float` - Distance of the ranged hit. 78 | - `AgentAttackType` - Type of the attack. 79 | - `float` - Difficulty of the shot. Calculated only for ranged hits. 80 | - `int` - Weapon usage index of the weapon. 81 | - `OnAgentMount(Agent)` - Called when an agent mounts a mount. 82 | - `Agent` - Rider agent. 83 | - `OnAgentDismount(Agent)` - Called when an agent dismounts a mount. 84 | - `Agent` - Rider agent. 85 | - `OnAgentControllerChanged(Agent)` - Called when controller of an agent is changed. 86 | - `Agent` - Agent whose controller is changed. 87 | - `OnItemPickup(Agent, SpawnedItemEntity)` - Called whenever an agent picks an item up. 88 | - `Agent` - Agent who picked up. 89 | - `SpawnedItemEntity` - Item that has been picked up. 90 | - `OnFocusGained(Agent, IFocusable, bool)` - Called when an object gains the focus of an agent. 91 | - `Agent` - Seems to be always main agent. 92 | - `IFocusable` - Object that has gained the focus. For conversations, listener or speaker agent depending on who is talking. For other situations can be other agents, objects or mounts. 93 | - `bool` - True if the object that gained focus is interactable. Agents, mounts and usable objects seem to be interactable at the moment. 94 | - `OnFocusLost(Agent, IFocusable)` - Called when an object loses its focus. 95 | - `Agent` - Seems to be always main agent. 96 | - `IFocusable` - Object that loses focus. 97 | - `Agent` - Interacting agent. 98 | - `Agent` - Target agent. 99 | - `OnObjectUsed(Agent, UsableMissionObject)` - Called when an agent uses an object. 100 | - `Agent` - User agent. 101 | - `UsableMissionObject` - Used object. 102 | - `OnObjectStoppedBeingUsed(Agent, UsableMissionObject)` - Called when an agent stops using an object. 103 | - `Agent` - User agent. 104 | - `UsableMissionObject` - Used object. 105 | - `bool IsThereAgentAction(Agent, Agent)` - Called to determine if an agent is interactable by another agent. Note that any of the behaviours returning True will result in a True for final calculation. 106 | - `OnAgentInteraction(Agent, Agent)` - Called when agent interacts with another agent. Currently seems to be called only when the target agent is human. 107 | - `Agent` - Interactor agent. 108 | - `Agent` - Target agent. 109 | - `OnAssignPlayerAsSergeantOfFormation(Agent)` - Called when an agent is assigned as sergeant of the formation. Currently it seems be called only when a player is assigned as sergeant. 110 | - `Agent` - Sergeant agent. 111 | - `OnAgentPanicked(Agent)` - Called when an agent is panicked. Currently, an agent starts fleeing when it is panicked. 112 | - `Agent` - Panicked agent. 113 | - `OnAgentAlarmedStateChanged(Agent, Agent.AIStateFlag)` - Called when an agents alarm state is changed. 114 | - `Agent` - Agent whose alarm state is changed. 115 | - `Agent.AIStateFlag` - Added state flag. 116 | - `OnGetAgentState(Agent, bool)` - Called when an agent's state after a killing blow is determined. 117 | - `Agent` - Agent whose state is determined. 118 | - `bool` - True if surgery is excersized. Seems to be used for granting experience to surgery. 119 | - `OnEarlyAgentRemoved(Agent, Agent, AgentState, KillingBlow)` - Called when an agent's state change to something other than Active. Called before OnAgentRemoved. 120 | - `Agent` - Agent whose state is changed. 121 | - `Agent` - Agent causing the state change, e.g. attacker. Can be null. 122 | - `AgentState` - New state of the agent. 123 | - `KillingBlow` - Information about the blow if change was due to a hit. 124 | - `OnAgentRemoved(Agent, Agent, AgentState, KillingBlow)` - Called when an agent's state change to something other than `Active`. 125 | - `Agent` - Agent whose state is changed. 126 | - `Agent` - Agent causing the state change, e.g. attacker. Can be null. 127 | - `AgentState` - New state of the agent. 128 | - `KillingBlow` - Information about the blow if change was due to a hit. 129 | - `OnAgentDeleted(Agent)` - Called when an agent is about to be deleted. This is called after `OnAgentRemoved` callbacks. 130 | - `Agent` - Deleted agent. 131 | 132 | ## Others 133 | - `OnAddTeam(Team)` - Called when a team is being added to a mission. Called before `AfterAddTeam`. 134 | - `Team` - Added team. 135 | - `AfterAddTeam(Team)` - Called after a team is added to a mission. 136 | - `Team` - Added team. 137 | - `OnFormationUnitsSpawned(Team)` - Called when units of a formation are spawned. 138 | - `Team` - Team this formation belongs to. 139 | - `OnObjectDisabled(DestructableComponent)` - Called when an object is disabled. Currently seems to be called when a destructable object is destroyed. 140 | - `DestructableComponent` - Disabled object. 141 | -------------------------------------------------------------------------------- /_csharp-api/campaignsystem/hero.md: -------------------------------------------------------------------------------- 1 | # Hero : [MBObjectBase](), [ITrackableCampaignObject](), [ITrackableBase]() 2 | 3 | Heroes are all the unique characters in the game. This class contains all the information of these characters and allows you to change them. 4 | 5 | | Using / Namespaces |
Taleworlds.Core
|
Saveable
| 6 | | :------------------------------------------------------------------------------ | ----------------------------------------------- | --------------------------------------: | 7 | | `System` | | 20204 | 8 | | `System.Collections.Generic` | | | 9 | | `System.Linq` | | | 10 | | `System.Xml.Serialization` | | | 11 | | `Heplers` | | | 12 | | [TaleWorlds.CampaignSystem.Actions](./actions/ChangeOwnerOfSettlementAction.md) | | | 13 | | [TaleWorlds.CampaignSystem.CharacterDevelopment.Managers]() | | | 14 | | [TaleWorlds.Core](../core/README.md) | | | 15 | | [TaleWorlds.Library](../library/README.md) | | | 16 | | [TaleWorlds.Localization](../localization/README.md) | | | 17 | | [TaleWorlds.SaveSystem](../savesystem/README.md) | | | 18 | | | 19 | 20 | ## Example of usage 21 | 22 | TODO 23 | 24 | ## Variables 25 | 26 | | Mods | Name | Type | Notes | Value | 27 | | ----------------- | ----------------------------- | -------------------------------------------------------------- | ------------------------------------------ | ----- | 28 | | public const | RelationLimit | `int` | Max value for relation | 100 | 29 | | public const | RelationNeutralLimit | `int` | Max value for relation with neutral heroes | 10 | 30 | | public | LastTimeStampForActivity | `int` | Last activity timestamp | | 31 | | const | MaximumNumberOfVolunteers | `int` | TODO | 6 | 32 | | public | VolunteerTypes; | [CharacterObject]()`[]` | TODO | | 33 | | public | NumberOfCreatedParties | `int` | Number of parties | | 34 | | private readonly | _occupiedByAnEvent | `List` | TODO | | 35 | | private | _passedTimeAtHomeSettlement; | `float` | Time at home settlement | | 36 | | private | _characterObject | [CharacterObject]() | Character object info | | 37 | | public | FirstName | [TextObject]() | First name | | 38 | | public | Name | [TextObject]() | Name | | 39 | | public | Detected | `bool` | Have you met with hero | | 40 | | public | DaysLeftToRespawn | `int` | Days for respawn | | 41 | | private | _heroStates | [CharacterStates](##-`enum`-CharacterStates) | Hero's state | | 42 | | private | _heroTraits | [CharacterTraits]() | Hero's traits | | 43 | | private | _heroPerks | [CharacterPerks]() | Hero's perks | | 44 | | private | _heroSkills | [CharacterSkills]() | Hero's skills | | 45 | | private | _charAttributeValues | `int[6]` | Character attributes points | | 46 | | public | NeverBecomePrisoner | `bool` | Will never be prisoner? | | 47 | | private | _alwaysUnconscious; | `bool` | TODO | | 48 | | public | AlwaysDie | `bool` | Is hero always dir (for what?) | | 49 | | public | LastVisitTimeOfHomeSettlement | `float` | Last visit home settlement | | 50 | | public | Level | `int` | Level of hero | | 51 | | const | HeroWoundedHealthLevel | `int` | Value, below which hero is wounded | 20 | 52 | | private | _companionOf | [Clan]() | Clan that include hero? | | 53 | | private | _cachedLastSeenInformation | [HeroLastSeenInformation](##-`struct`-HeroLastSeenInformation) | Heros's last seen info | | 54 | | IsMercenary | IsMercenary | `bool` | Is hero mercenary | | 55 | | SpcDaysInLocation | SpcDaysInLocation | `int` | TODO | | 56 | | private | _health | `int` | Health | | 57 | | private | _birthDay | [CampaignTime]() | BearthDay | | 58 | | private | _deathDay | [CampaignTime]() | Day of death | | 59 | | private | _power | `int` | Power | | 60 | | public | VisitedSettlements | `Dictionary<`[Settlement]()`, float>` | Visited settlements | | 61 | | private | _clan | [Clan]() | Hero's clan | | 62 | | private | _supporterOf | [Clan]() | TODO | | 63 | | private | _governorOf | [Town]() | Governor of | | 64 | | private | _ownedWorkshops | `List<`[Workshop]()`>` | Owned workshops | | 65 | | private | _ownedCommonAreas | `List<`[CommonArea]()`>` | Owned areas | | 66 | | private | _ownedParties | `List<`[PartyBase]()`>` | Owned parties | | 67 | | public | Culture | [CultureObject]() | Culture | | 68 | | public | _partyBelongedTo | [MobileParty]() | TODO | | 69 | | private | _stayingInSettlementOfNotable | [Settlement]() | TODO | | 70 | | public | SpecialItems | `List<`(ItemObject)[]`>` | TODO | | 71 | | private | _controversy | `float` | TODO | | 72 | | private | _hasMet | `bool` | Has hero met | | 73 | | private | _bornSettlement | [Settlement]() | Born settlement | | 74 | | private | _gold | `int` | Gold | | 75 | | public | RandomValue | `int` | ?? | | 76 | | public | RandomValueDeterministic | `int` | ?? | | 77 | | public | RandomValueRarelyChanging | `int` | ?? | | 78 | | private | _father | [Hero]() | Father | | 79 | | private | _mother | [Hero]() | Mother | | 80 | | private readonly | _exSpouses | `List<`[Hero]()`>` | ?? | | 81 | | public | ExSpouses | [MBReadOnlyList]()`<`[Hero]()`>` | Ex. spouses | | 82 | | private | _spouse | [Hero]() | Spouse | | 83 | | private readonly | _children | `List`[Hero]()`>` | Children | | 84 | | public | IsFertile | bool | Can hero have children | | 85 | | public | IsPregnant | bool | Is hero pregnant now | | 86 | | private reeadonly | _heroDeveloper | [HeroDeveloper]() | TODO | | 87 | | | 88 | 89 | 90 | ## Properties 91 | 92 | - `internal StaticBodyProperties StaticBodyProperties` { get; set; } 93 | - `CanHaveRecruits` - A boolean that details if this hero can have recruits. Preachers, Rural Notables, Mercenaries, Gang Leaders, Merchants, and Headmen can have recruits. This property can only be read, not changed. 94 | 95 | ## Functions 96 | 97 | Work in progress 98 | 99 | 100 | ## `struct` HeroLastSeenInformation 101 | 102 | | Name | Type | Notes | 103 | | ------------------ | ---------------- | ----- | 104 | | LastSeenPlace | [Settlement]() | TODO | 105 | | LastSeenDate | [CampaignTime]() | TODO | 106 | | IsNearbySettlement | bool | TODO | 107 | | | 108 | 109 | ## `enum` CharacterStates 110 | 111 | * NotSpawned 112 | * Active 113 | * Fugitive 114 | * Prisoner 115 | * Released 116 | * Dead 117 | * Disabled 118 | 119 | ## `enum` FactionRank 120 | 121 | * None = -1 122 | * Vassal 123 | * Leader 124 | -------------------------------------------------------------------------------- /_xmldocs/SPCultures/Culture/README.md: -------------------------------------------------------------------------------- 1 | # Culture 2 | 3 | ## Parent node 4 | - [SPCultures](../../SPCultures) 5 | 6 | ## Child node 7 | - [female_names](female_names) 8 | - [male_names](male_names) 9 | - [clan_names](clan_names) 10 | 11 | ## Attributes 12 | [id](#id) | [name](#name) | [is_main_culture](#is_main_culture) | [color](#color) | [color2](#color2) | [elite_basic_troop](#elite_basic_troop) | [basic_troop](#basic_troop) | [melee_militia_troop](#melee_militia_troop) | [ranged_militia_troop](#ranged_militia_troop) | [melee_elite_militia_troop](#melee_elite_militia_troop) | [ranged_elite_militia_troop](#ranged_elite_militia_troop) | [can_have_settlement](#can_have_settlement) | [town_edge_number](#town_edge_number) | [villager_party_template](#villager_party_template) | [default_party_template](#default_party_template) | [caravan_party_template](#caravan_party_template) | [elite_caravan_party_template](#elite_caravan_party_template) | [militia_party_template](#militia_party_template) | [rebels_party_template](#rebels_party_template) | [prosperity_bonus](#prosperity_bonus) | [encounter_background_mesh](#encounter_background_mesh) | [default_face_key](#default_face_key) | [text](#text) | [tournament_master](#tournament_master) | [villager](#villager) | [caravan_master](#caravan_master) | [armed_trader](#armed_trader) | [caravan_guard](#caravan_guard) | [veteran_caravan_guard](#veteran_caravan_guard) | [duel_preset](#duel_preset) | [prison_guard](#prison_guard) | [guard](#guard) | [steward](#steward) | [blacksmith](#blacksmith) | [weaponsmith](#weaponsmith) | [townswoman](#townswoman) | [townswoman_infant](#townswoman_infant) | [townswoman_child](#townswoman_child) | [townswoman_teenager](#townswoman_teenager) | [townsman](#townsman) | [townsman_infant](#townsman_infant) | [townsman_child](#townsman_child) | [townsman_teenager](#townsman_teenager) | [ransom_broker](#ransom_broker) | [gangleader_bodyguard](#gangleader_bodyguard) | [merchant_notary](#merchant_notary) | [artisan_notary](#artisan_notary) | [preacher_notary](#preacher_notary) | [rural_notable_notary](#rural_notable_notary) | [shop_worker](#shop_worker) | [tavernkeeper](#tavernkeeper) | [taverngamehost](#taverngamehost) | [musician](#musician) | [tavern_wench](#tavern_wench) | [armorer](#armorer) | [horseMerchant](#horsemerchant) | [merchant](#merchant) | [beggar](#beggar) | [female_beggar](#female_beggar) | [female_dancer](#female_dancer) | [gear_practice_dummy](#gear_practice_dummy) | [weapon_practice_stage_1](#weapon_practice_stage_1) | [weapon_practice_stage_2](#weapon_practice_stage_2) | [weapon_practice_stage_3](#weapon_practice_stage_3) | [gear_dummy](#gear_dummy) | [militia_bonus](#militia_bonus) | [is_bandit](#is_bandit) | [bandit_chief](#bandit_chief) | [bandit_raider](#bandit_raider) | [bandit_bandit](#bandit_bandit) | [bandit_boss](#bandit_boss) | [bandit_boss_party_template](#bandit_boss_party_template) 13 | 14 | - #### id 15 | **类型:** `string` 16 | **例子:** `empire` 17 | *The ID of the culture (faction)* 18 | 19 | - #### name 20 | **类型:** `string` 21 | **例子:** `{=FjwRsf1C}Vlandia` 22 | *Note: The prefix in the `{=}` format is the translation id found in strings.txt* 23 | *TODO: Find out if this is auto generated.* 24 | 25 | - #### is_main_culture 26 | **类型:** `boolean` 27 | **接受值:** `true` | `false` 28 | **例子:** `false` 29 | *If the culture is a major (true) or a minor (false) faction* 30 | 31 | - #### color 32 | **类型:** `hex` 33 | **例子:** `FF4E3A55` 34 | *The color of the faction. TODO: figure out where the colour is displayed* 35 | 36 | - #### color2 37 | **类型:** `hex` 38 | **例子:** `FF4E3A55` 39 | *The secondary color of the faction. TODO: figure out where the colour is displayed* 40 | 41 | - #### elite_basic_troop 42 | **类型:** `reference` 43 | **例子:** `NPCCharacter.imperial_vigla_recruit` 44 | *Reference to the NPCCharacter XML node. The Elite Recruit troop of the faction.* 45 | 46 | - #### basic_troop 47 | **类型:** `reference` 48 | **例子:** `NPCCharacter.imperial_recruit` 49 | *Reference to the NPCCharacter XML node. The Recruit troop of the faction.* 50 | 51 | - #### melee_militia_troop 52 | **类型:** `reference` 53 | **例子:** `NPCCharacter.imperial_recruit` 54 | *Reference to the NPCCharacter XML node.* 55 | 56 | - #### ranged_militia_troop 57 | **类型:** `reference` 58 | **例子:** `NPCCharacter.imperial_recruit` 59 | *Reference to the NPCCharacter XML node.* 60 | 61 | - #### melee_elite_militia_troop 62 | **类型:** `reference` 63 | **例子:** `NPCCharacter.imperial_recruit` 64 | *Reference to the NPCCharacter XML node.* 65 | 66 | - #### ranged_elite_militia_troop 67 | **类型:** `reference` 68 | **例子:** `NPCCharacter.imperial_recruit` 69 | *Reference to the NPCCharacter XML node.* 70 | 71 | - #### can_have_settlement 72 | **类型:** `reference` 73 | **接受值:** `true` | `false` 74 | **例子:** `true` 75 | *If the faction can have settlements on the map.* 76 | 77 | - #### town_edge_number 78 | **类型:** `int` 79 | **例子:** `16` 80 | *TODO: figure out what this does.* 81 | 82 | - #### villager_party_template 83 | **类型:** `reference` 84 | **例子:** `PartyTemplate.villager_empire_template` 85 | *Villagers template reference to PartyTemplate XML node* 86 | 87 | - #### default_party_template 88 | **类型:** `reference` 89 | **例子:** `PartyTemplate.villager_empire_template` 90 | *Default template reference to PartyTemplate XML node* 91 | 92 | - #### caravan_party_template 93 | **类型:** `reference` 94 | **例子:** `PartyTemplate.villager_empire_template` 95 | *Caravan template reference to PartyTemplate XML node* 96 | 97 | - #### elite_caravan_party_template 98 | **类型:** `reference` 99 | **例子:** `PartyTemplate.villager_empire_template` 100 | *Elite Caravan template reference to PartyTemplate XML node* 101 | 102 | - #### militia_party_template 103 | **类型:** `reference` 104 | **例子:** `PartyTemplate.villager_empire_template` 105 | *Militia template reference to PartyTemplate XML node* 106 | 107 | - #### rebels_party_template 108 | **类型:** `reference` 109 | **例子:** `PartyTemplate.villager_empire_template` 110 | *Rebels template reference to PartyTemplate XML node* 111 | 112 | - #### prosperity_bonus 113 | **类型:** `int` 114 | **例子:** `1` 115 | *Bonus to the prosperity of a faction* 116 | 117 | - #### encounter_background_mesh 118 | **类型:** `reference` 119 | **例子:** `encounter_empire` 120 | *Encounter background* 121 | 122 | - #### default_face_key 123 | **类型:** `face_code` 124 | **例子:** `000fa92e90004202aced5d976886573d5d679585a376fdd605877a7764b8987c00000000000007520000037f0000000f00000037049140010000000000000000` 125 | *Default face keys for faction* 126 | 127 | - #### text 128 | **类型:** `string` 129 | **例子:** `{=X0kKBzsW}Lorem Ipsum Dol Amor` 130 | *Description of the faction* 131 | 132 | - #### tournament_master 133 | **类型:** `reference` 134 | **例子:** `NPCCharacter.tournament_master_empire` 135 | *Reference to the tournament master NPCCharacter XML node.* 136 | 137 | - #### villager 138 | **类型:** `reference` 139 | **例子:** `NPCCharacter.villager_empire` 140 | *Reference to the NPCCharacter XML node.* 141 | 142 | - #### caravan_master 143 | **类型:** `reference` 144 | **例子:** `NPCCharacter.villager_empire` 145 | *Reference to the NPCCharacter XML node.* 146 | 147 | - #### armed_trader 148 | **类型:** `reference` 149 | **例子:** `NPCCharacter.villager_empire` 150 | *Reference to the NPCCharacter XML node.* 151 | 152 | - #### caravan_guard 153 | **类型:** `reference` 154 | **例子:** `NPCCharacter.villager_empire` 155 | *Reference to the NPCCharacter XML node.* 156 | 157 | - #### veteran_caravan_guard 158 | **类型:** `reference` 159 | **例子:** `NPCCharacter.villager_empire` 160 | *Reference to the NPCCharacter XML node.* 161 | 162 | - #### duel_preset 163 | **类型:** `reference` 164 | **例子:** `NPCCharacter.villager_empire` 165 | *Reference to the NPCCharacter XML node.* 166 | 167 | - #### prison_guard 168 | **类型:** `reference` 169 | **例子:** `NPCCharacter.villager_empire` 170 | *Reference to the NPCCharacter XML node.* 171 | 172 | - #### guard 173 | **类型:** `reference` 174 | **例子:** `NPCCharacter.villager_empire` 175 | *Reference to the NPCCharacter XML node.* 176 | 177 | - #### steward 178 | **类型:** `reference` 179 | **例子:** `NPCCharacter.villager_empire` 180 | *Reference to the NPCCharacter XML node.* 181 | 182 | - #### blacksmith 183 | **类型:** `reference` 184 | **例子:** `NPCCharacter.villager_empire` 185 | *Reference to the NPCCharacter XML node.* 186 | 187 | - #### weaponsmith 188 | **类型:** `reference` 189 | **例子:** `NPCCharacter.villager_empire` 190 | *Reference to the NPCCharacter XML node.* 191 | 192 | - #### townswoman 193 | **类型:** `reference` 194 | **例子:** `NPCCharacter.villager_empire` 195 | *Reference to the NPCCharacter XML node.* 196 | 197 | - #### townswoman_infant 198 | **类型:** `reference` 199 | **例子:** `NPCCharacter.villager_empire` 200 | *Reference to the NPCCharacter XML node.* 201 | 202 | - #### townswoman_child 203 | **类型:** `reference` 204 | **例子:** `NPCCharacter.villager_empire` 205 | *Reference to the NPCCharacter XML node.* 206 | 207 | - #### townswoman_teenager 208 | **类型:** `reference` 209 | **例子:** `NPCCharacter.villager_empire` 210 | *Reference to the NPCCharacter XML node.* 211 | 212 | - #### townsman 213 | **类型:** `reference` 214 | **例子:** `NPCCharacter.villager_empire` 215 | *Reference to the NPCCharacter XML node.* 216 | 217 | - #### townsman_infant 218 | **类型:** `reference` 219 | **例子:** `NPCCharacter.villager_empire` 220 | *Reference to the NPCCharacter XML node.* 221 | 222 | - #### townsman_child 223 | **类型:** `reference` 224 | **例子:** `NPCCharacter.villager_empire` 225 | *Reference to the NPCCharacter XML node.* 226 | 227 | - #### townsman_teenager 228 | **类型:** `reference` 229 | **例子:** `NPCCharacter.villager_empire` 230 | *Reference to the NPCCharacter XML node.* 231 | 232 | - #### ransom_broker 233 | **类型:** `reference` 234 | **例子:** `NPCCharacter.villager_empire` 235 | *Reference to the NPCCharacter XML node.* 236 | 237 | - #### gangleader_bodyguard 238 | **类型:** `reference` 239 | **例子:** `NPCCharacter.villager_empire` 240 | *Reference to the NPCCharacter XML node.* 241 | 242 | - #### merchant_notary 243 | **类型:** `reference` 244 | **例子:** `NPCCharacter.villager_empire` 245 | *Reference to the NPCCharacter XML node.* 246 | 247 | - #### artisan_notary 248 | **类型:** `reference` 249 | **例子:** `NPCCharacter.villager_empire` 250 | *Reference to the NPCCharacter XML node.* 251 | 252 | - #### preacher_notary 253 | **类型:** `reference` 254 | **例子:** `NPCCharacter.villager_empire` 255 | *Reference to the NPCCharacter XML node.* 256 | 257 | - #### rural_notable_notary 258 | **类型:** `reference` 259 | **例子:** `NPCCharacter.villager_empire` 260 | *Reference to the NPCCharacter XML node.* 261 | 262 | - #### shop_worker 263 | **类型:** `reference` 264 | **例子:** `NPCCharacter.villager_empire` 265 | *Reference to the NPCCharacter XML node.* 266 | 267 | - #### tavernkeeper 268 | **类型:** `reference` 269 | **例子:** `NPCCharacter.villager_empire` 270 | *Reference to the NPCCharacter XML node.* 271 | 272 | - #### taverngamehost 273 | **类型:** `reference` 274 | **例子:** `NPCCharacter.villager_empire` 275 | *Reference to the NPCCharacter XML node.* 276 | 277 | - #### musician 278 | **类型:** `reference` 279 | **例子:** `NPCCharacter.villager_empire` 280 | *Reference to the NPCCharacter XML node.* 281 | 282 | - #### tavern_wench 283 | **类型:** `reference` 284 | **例子:** `NPCCharacter.villager_empire` 285 | *Reference to the NPCCharacter XML node.* 286 | 287 | - #### armorer 288 | **类型:** `reference` 289 | **例子:** `NPCCharacter.villager_empire` 290 | *Reference to the NPCCharacter XML node.* 291 | 292 | - #### horseMerchant 293 | **类型:** `reference` 294 | **例子:** `NPCCharacter.villager_empire` 295 | *Reference to the NPCCharacter XML node.* 296 | 297 | - #### merchant 298 | **类型:** `reference` 299 | **例子:** `NPCCharacter.villager_empire` 300 | *Reference to the NPCCharacter XML node.* 301 | 302 | - #### beggar 303 | **类型:** `reference` 304 | **例子:** `NPCCharacter.villager_empire` 305 | *Reference to the NPCCharacter XML node.* 306 | 307 | - #### female_beggar 308 | **类型:** `reference` 309 | **例子:** `NPCCharacter.villager_empire` 310 | *Reference to the NPCCharacter XML node.* 311 | 312 | - #### female_dancer 313 | **类型:** `reference` 314 | **例子:** `NPCCharacter.villager_empire` 315 | *Reference to the NPCCharacter XML node.* 316 | 317 | - #### gear_practice_dummy 318 | **类型:** `reference` 319 | **例子:** `NPCCharacter.villager_empire` 320 | *Reference to the NPCCharacter XML node.* 321 | 322 | - #### weapon_practice_stage_1 323 | **类型:** `reference` 324 | **例子:** `NPCCharacter.villager_empire` 325 | *Reference to the NPCCharacter XML node.* 326 | 327 | - #### weapon_practice_stage_2 328 | **类型:** `reference` 329 | **例子:** `NPCCharacter.villager_empire` 330 | *Reference to the NPCCharacter XML node.* 331 | 332 | - #### weapon_practice_stage_3 333 | **类型:** `reference` 334 | **例子:** `NPCCharacter.villager_empire` 335 | *Reference to the NPCCharacter XML node.* 336 | 337 | - #### gear_dummy 338 | **类型:** `reference` 339 | **例子:** `NPCCharacter.villager_empire` 340 | *Reference to the NPCCharacter XML node.* 341 | 342 | - #### militia_bonus 343 | **类型:** `int` 344 | **例子:** `1` 345 | *TODO: figure out what exactly this bonus does.* 346 | 347 | - #### is_bandit 348 | **类型:** `int` 349 | **接受值:** `true` | `false` 350 | **default:** `false` 351 | **例子:** `1` 352 | *TODO: figure out what exactly this bonus does.* 353 | 354 | - #### bandit_chief 355 | **类型:** `reference` 356 | **例子:** `NPCCharacter.villager_empire` 357 | *Reference to the NPCCharacter XML node.* 358 | 359 | - #### bandit_raider 360 | **类型:** `reference` 361 | **例子:** `NPCCharacter.villager_empire` 362 | *Reference to the NPCCharacter XML node.* 363 | 364 | - #### bandit_bandit 365 | **类型:** `reference` 366 | **例子:** `NPCCharacter.villager_empire` 367 | *Reference to the NPCCharacter XML node.* 368 | 369 | - #### bandit_boss 370 | **类型:** `reference` 371 | **例子:** `NPCCharacter.villager_empire` 372 | *Reference to the NPCCharacter XML node.* 373 | 374 | - #### bandit_boss_party_template 375 | **类型:** `reference` 376 | **例子:** `PartyTemplate.sea_raiders_boss_party_template` 377 | *Bandit boss party template reference to PartyTemplate XML node* 378 | --------------------------------------------------------------------------------