From a8da0c35045ddb1660e4b0549be57a88f48db432 Mon Sep 17 00:00:00 2001 From: Zhuoran Wu Date: Wed, 22 Apr 2020 16:05:36 -0700 Subject: [PATCH 1/3] sync 04-22 --- README.md | 55 ++-- _csharp-api/campaignsystem/gamemenu.md | 23 +- _csharp-api/core/basiccharacterobject.md | 7 +- _csharp-api/core/informationmanager.md | 6 +- _csharp-api/engine/gameentity.md | 12 +- _csharp-api/inputsystem/input.md | 8 +- _csharp-api/library/moduleinfo.md | 8 +- _csharp-api/mountandblade/agent.md | 9 +- .../mountandblade/mbinitialscreenbase.md | 7 +- _csharp-api/mountandblade/mbsubmodulebase.md | 59 ++-- _csharp-api/mountandblade/mission.md | 9 +- _gauntlet/movie.md | 18 +- _gauntlet/screenbase.md | 11 +- _gauntlet/screenmanager.md | 5 +- _gauntlet/widget.md | 40 ++- _intro/advanced.md | 11 +- _intro/folder-structure.md | 34 +- _intro/getting-started.md | 41 ++- _tutorials/basic-csharp-mod.md | 87 +++--- _tutorials/modding-gauntlet-without-csharp.md | 76 +++-- _tutorials/packing_mods_for_vortex.md | 28 +- _xmldocs/Items/CraftedItem/README.md | 20 +- _xmldocs/Items/Item/Flags/README.md | 116 +++---- .../Items/Item/ItemComponent/Armor/README.md | 159 +++++----- .../Items/Item/ItemComponent/Food/README.md | 16 +- .../MeshMultipliers/MeshMultiplier/README.md | 8 +- .../Horse/Materials/Material/README.md | 4 +- .../Items/Item/ItemComponent/Horse/README.md | 92 +++--- _xmldocs/Items/Item/ItemComponent/README.md | 18 +- .../Items/Item/ItemComponent/Weapon/README.md | 176 +++++------ .../Weapon/WeaponFlags/README.md | 168 +++++----- _xmldocs/Items/Item/README.md | 184 +++++------ _xmldocs/Items/README.md | 16 +- _xmldocs/NPCCharacters/NPCCharacter/README.md | 130 ++++---- _xmldocs/SPCultures/Culture/README.md | 294 +++++++++--------- _xmldocs/Scenes/Scene/README.md | 30 +- _xmldocs/items.md | 35 +-- _xmldocs/submodule.md | 39 ++- 38 files changed, 1021 insertions(+), 1038 deletions(-) diff --git a/README.md b/README.md index 7c69ca63..9572aa6c 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,34 @@ -# Home +# 骑马与砍杀2 领主 Mod 制作文档 -## Introduction to Modding +原文档: [Bannerlord Documentation](https://docs.bannerlordmodding.com/) +作者: [Bannerlord Modding](https://github.com/Bannerlord-Modding) +译者: [衣谷作坊-Oliver](mailto:munoliver007@gmail.com), [世俗骑士](mailto:843750340@qq.com),[上官云泽](mailto:1143232792@qq.com). -* [Getting Started](_intro/getting-started.md) -* [Folder Structure](_intro/folder-structure.md) -* [Advanced](_intro/advanced.md) +## Mod 制作简介 -## Tutorials +* [开始](_intro/getting-started.md) +* [文件结构](_intro/folder-structure.md) +* [高级用法](_intro/advanced.md) -* [Basic C# Mod](_tutorials/basic-csharp-mod.md) (Requires a basic understanding of C#) -* [Modding Gauntlet UIs Without C#](_tutorials/modding-gauntlet-without-csharp.md) (Easy) -* [Packing your Mods for Vortex](_tutorials/packing_mods_for_vortex.md) (Easy) -* [Modifying/Adding Settlements](_tutorials/new_settlements.md) (Easy) +## 教程 + +* [基本C\# Mod 入门](_tutorials/basic-csharp-mod.md) \(需要一定基础的 C\#\) +* [不需要C\#的UI系统 Mod 入门](_tutorials/modding-gauntlet-without-csharp.md) \(简单\) +* [将你的mod打包上传至Vortex](_tutorials/packing_mods_for_vortex.md) \(简单\) +* [修改/增加 定居点](_tutorials/new_settlements.md) (简单) ## [C# API Documentation](_csharp-api/) -* [CampaignSystem](_csharp-api/campaignsystem/) -* [Core](_csharp-api/core/) -* [Engine](_csharp-api/engine/) -* [InputSystem](_csharp-api/inputsystem/) -* [Library](_csharp-api/library/) -* [Localization](_csharp-api/localization/) +* [战役系统](_csharp-api/campaignsystem/) +* [核心](_csharp-api/core/) +* [引擎](_csharp-api/engine/) +* [输入系统](_csharp-api/inputsystem/) +* [库](_csharp-api/library/) +* [本地化](_csharp-api/localization/) * [MountAndBlade](_csharp-api/mountandblade/) -* [Network](_csharp-api/network/) -* [PlatformService](_csharp-api/platformservice/) -* [SaveSystem](_csharp-api/savesystem/) +* [网络](_csharp-api/network/) +* [平台服务](_csharp-api/platformservice/) +* [保存系统](_csharp-api/savesystem/) * [TwoDimension](_csharp-api/twodimension/) ## [Gauntlet Documentation](_gauntlet/) @@ -41,10 +45,9 @@ ## [XML Documentation](_xmldocs) -* [Atmosphere](_xmldocs/atmosphere.md) (.xml) -* [Cultures](_xmldocs/cultures.md) (.xml) -* [Items](_xmldocs/items.md) (.xml) -* [NPCCharacters](_xmldocs/npccharacters.md) (.xml) -* [Scene](_xmldocs/scene.md) (.xml) -* [SubModule](_xmldocs/submodule.md) (.xml) - +* [环境](_xmldocs/atmosphere.md) (.xml) +* [文化](_xmldocs/cultures.md) (.xml) +* [物品](_xmldocs/items.md) (.xml) +* [NPC角色](_xmldocs/npccharacters.md) (.xml) +* [场景](_xmldocs/scene.md) (.xml) +* [子模块](_xmldocs/submodule.md) (.xml) diff --git a/_csharp-api/campaignsystem/gamemenu.md b/_csharp-api/campaignsystem/gamemenu.md index b6b8cee0..579a0953 100644 --- a/_csharp-api/campaignsystem/gamemenu.md +++ b/_csharp-api/campaignsystem/gamemenu.md @@ -1,17 +1,19 @@ # GameMenu -All the menus in the campaign are handled by the `GameMenuManager`. To add new menus however you must use the provided methods by the `Campaign` class. -To add a new menu use: +战役中所有的菜单选项都由`GameMenuManager`管理。你必须通过提供`Campaign`类中的方法,来加入新菜单。 + +加入新的菜单: ```csharp CampaignGameStarter.AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, MenuOverlayType overlay = MenuOverlayType.None, MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null) delegate void OnInitDelegate(MenuCallbackArgs args); ``` -The overlay defines if for example the upper right characters list is visible or not. +覆盖层(overlay)定义了例子中右上角字符列表是否可见。 + -To add a new option to a menu use: +为菜单加入新的选项: ```csharp CampaignGameStarter.AddGameMenuOption(string menuId, string optionId, string optionText, OnConditionDelegate condition, OnConsequenceDelegate consequence, bool isLeave = false, int index = -1) @@ -19,14 +21,13 @@ bool OnConditionDelegate(MenuCallbackArgs args); void OnConsequenceDelegate(MenuCallbackArgs args); ``` -You can add options to existing menus and for this the index comes in handy to insert it before other options (by default it insert at the end). - -The provided condition method does double-duty as it: -* enables / disables the option (via it's return value) -* sets the icon (via the provided args) +您可以在现有菜单中添加选项。使用这个index参数时,可以方便地插入在其它选项之前(默认情况下,它会在末尾插入)。 -The icon can be changed by setting `optionLeaveType` to something appropriate. The used images are found under `Mount & Blade II Bannerlord\GUI\GauntletUI\SpriteParts\ui_group1\GameMenu` and the correspondence can be viewed in `Mount & Blade II Bannerlord\Modules\Native\GUI\Brushes\GameMenu.xml`. This can of course be overrides in your own module, but additional `LeaveTypes` are not possible. +提供的条件方法(condition method)具有双重职责: +* 启用/禁用选项(通过返回值) +* 设置图标(通过提供的参数) +图标可以通过将 `optionLeaveType` 设置为恰当的值来改变。 可使用的图标在 `Mount & Blade II Bannerlord\GUI\GauntletUI\SpriteParts\ui_group1\GameMenu`目录下,相关的信息可在 `Mount & Blade II Bannerlord\Modules\Native\GUI\Brushes\GameMenu.xml`查看。 当然,你自己的模组可以重写这些东西,但是不能额外添加更多的`LeaveTypes`。 | Type | Image | | ------------------- | ----- | | Default | | @@ -51,4 +52,4 @@ The icon can be changed by setting `optionLeaveType` to something appropriate. T | WaitQuest | | | Surrender | | | Conversation | | -| DefendAction | | \ No newline at end of file +| DefendAction | | diff --git a/_csharp-api/core/basiccharacterobject.md b/_csharp-api/core/basiccharacterobject.md index e7888d0f..dd23130f 100644 --- a/_csharp-api/core/basiccharacterobject.md +++ b/_csharp-api/core/basiccharacterobject.md @@ -1,12 +1,11 @@ # BasicCharacterObject -BasicCharacterObjects contain the deserialized information from the `npccharacters` XML file. This includes the BodyProperties, Equipment, Level, Skills, and Culture for each defined character. +`BasicCharacterObjects` 包含了 `npccharacters` XML 文件中的反序列化信息。每个被定义的角色有 `BodyProperties`, `Equipment`, `Level`, `Skills`, 和 `Culture` 信息。 -BasicCharacterObjects are used as the building blocks for [Agents](../mountandblade/agent.md). +`BasicCharacterObjects` 一般用来构建 [Agents](../mountandblade/agent.md) 的区块。 -You can use the [MBObjectManager](mbobjectmanager.md) to get a loaded BasicCharacterObject by using the following: +你可以用 [MBObjectManager](mbobjectmanager.md) 来获取一个加载后的 `BasicCharacterObject` ,代码如下: ```csharp MBObjectManager.Instance.GetObject("example_troop_id"); ``` - diff --git a/_csharp-api/core/informationmanager.md b/_csharp-api/core/informationmanager.md index bf274056..10208dc7 100644 --- a/_csharp-api/core/informationmanager.md +++ b/_csharp-api/core/informationmanager.md @@ -1,14 +1,14 @@ # InformationManager -The information manager is a high-level way to print text to the chat log (e.g. damage) or to display an inquiry to the player (e.g. yes/no confirmation). +InformationManager是一种向提示信息(例如:伤害)输出文本,或者向玩家显示提问(例如:是/否 确认)的的高级手段。 -## Outputting to Chat Log +## 输出至提示信息 ```csharp InformationManager.DisplayMessage() ``` -## Displaying an Inquiry +## 显示提问 ```csharp InformationManager.ShowInquiry() diff --git a/_csharp-api/engine/gameentity.md b/_csharp-api/engine/gameentity.md index 5267bea4..d6dc5156 100644 --- a/_csharp-api/engine/gameentity.md +++ b/_csharp-api/engine/gameentity.md @@ -1,22 +1,22 @@ # GameEntity -GameEntities are objects (entities) in the game. Examples include characters, buildings, trees, and horses to name a few. Every prop in the game is a GameEntity. +游戏实体 `GameEntity` 指的是游戏里的对象\(或称之为实体\)。举几个例子:角色,建筑,树木,马匹……等等等等。凡是游戏里出现的每个物件都是一个游戏实体。 -GameEntities contain Meshes, Skeletons, PhysicsBodies, and ScriptComponents along with a variety of other things for each object in the game. +每一个游戏实体,包含了:网格\(`Mesh`\),骨架\(`Skeleton`\),刚体\(`PhysicsBody`\),脚本组件\(`ScriptComponent`\)以及各种游戏里的对象附带的其他内容。 -You can add a GameEntity to a scene by editing the [Scene](../../_xmldocs/scene.md)'s `scene.xscene` file or spawn (instantiate) one directly using the following static method from the GameEntity class: +要向场景里添加一个游戏实体,除了通过编辑场景\([Scene](../../_xmldocs/scene.md)\)文件`scene.xscene`外,也可以直接通过`GameEntity`类的静态方法`Instantiate`“刷出”\(实例化出\)一个,比如: ```csharp GameEntity.Instantiate(Scene scene, string prefabName, MatrixFrame frame) ``` -Example Usage (spawning at main [Agent](../mountandblade/agent.md)): +另一个例子,往`main [Agent]`(../mountandblade/agent.md)里生成一个物体。\(注:`Agent`负责处理活物\) ```csharp GameEntity.Instantiate(Mission.Current.Scene, "ship_a", Agent.Main.Frame) ``` -## Multiplayer GameEntities +## 多人模式中的游戏实体 -Some GameEntities will not be synced between Clients, unless a SynchedMissionObject ScriptComponent is added. +某些游戏实体无法在玩家的客户端之间同步,因此你需要自己往脚本组件\(`ScriptComponent`\)里添加 `SynchedMissionObject`。 diff --git a/_csharp-api/inputsystem/input.md b/_csharp-api/inputsystem/input.md index 2b7a63a9..865843e8 100644 --- a/_csharp-api/inputsystem/input.md +++ b/_csharp-api/inputsystem/input.md @@ -1,9 +1,9 @@ # Input -This static type provides you with input functionality, the base input system has no events to bind to and supports polling only. It's largely self explanatory with a few possible gotchas. +`Input`这个静态类型用来提供输入功能。基本的输入系统并不是基于事件绑定的,而是采用轮询的方式。这部分内容比较直观,一般来说看函数名就知道用法,但也会有几个坑。 -## Key Polling +## 按键轮询 -`GetKeyDown(KeyCode)` | `GetKeyPressed(KeyCode)` | `GetKeyReleased(KeyCode)` - These are likely to be the most commonly used methods, `GetKeyDown` will return true on any number of frames so long as a key is down, this can cause undesired behaviour. If you only want to read an input once, use `GetKeyPressed` or `GetKeyReleased`. +`GetKeyDown(KeyCode)` | `GetKeyPressed(KeyCode)` | `GetKeyReleased(KeyCode)` - 这几个貌似是最常用的方法了。 关于 `GetKeyDown` 请注意:只要键盘按键处于按下状态,程序就会在每一帧持续不断地返回`true`,显然这会导致运行一些不必要的方法\(造成资源浪费\)。假如你只想触发一次按键操作,可以用`GetKeyPressed` 或者 `GetKeyReleased`。 -You can also use the extension methods `IsDown`/`IsPressed`/`IsReleased` like so `KeyCode.A.IsPressed()` \ No newline at end of file +还有几个扩展方法也可以达到按键的效果:`IsDown`/`IsPressed`/`IsReleased`。用法如: `KeyCode.A.IsPressed()`。 \ No newline at end of file diff --git a/_csharp-api/library/moduleinfo.md b/_csharp-api/library/moduleinfo.md index 1d30c6e1..1decf65d 100644 --- a/_csharp-api/library/moduleinfo.md +++ b/_csharp-api/library/moduleinfo.md @@ -1,9 +1,8 @@ # ModuleInfo -The ModuleInfo class contains information about each module. +`ModuleInfo`类里放的是Mod的详细资料。 - -You can get a list of all **loaded** mods with detailed information about them (their ModuleInfo) by doing something like this: +我们可以把所有**已加载**的Mod的详细资料\(它们各自的`ModuleInfo`\)读取到一个列表`List`里面如: ```csharp var loadedMods = new List(); @@ -14,6 +13,5 @@ foreach(var moduleName in Utilities.GetModulesNames()) loadedMods.Add(moduleInfo); } ``` -The Utilities class is part of the Talewords.Engine namespace, and the GetModulesNames() function returns a list of all the names of loaded modules. -This could be used to determine whether a module has been loaded or not, which is useful for mods that have optional dependencies. +通过这个方法,我们随后可以用来判断某个Mod加载了没有。当Mod之间存在依赖关系,但又是非必须的依赖关系时会很有用。 \ No newline at end of file diff --git a/_csharp-api/mountandblade/agent.md b/_csharp-api/mountandblade/agent.md index be6650ee..4c0697f0 100644 --- a/_csharp-api/mountandblade/agent.md +++ b/_csharp-api/mountandblade/agent.md @@ -1,10 +1,9 @@ # Agent -You can think of an agent as any **living** entity in the game. +你可以把媒介(`agent`)想象成游戏里任何**能走动**的实体。 -This might be the player, an NPC character, or even a horse. +比方说可以是玩家,NPC,甚至是一匹马。 -## Tips - -* You can get the player agent through the `Agent.Main` property (assuming they are alive). +## 小贴士 +* 你可以通过`Agent`下的`Agent.Main` 属性调用玩家媒介\(前提是玩家还活着\)。 diff --git a/_csharp-api/mountandblade/mbinitialscreenbase.md b/_csharp-api/mountandblade/mbinitialscreenbase.md index dbd8d508..d381adc7 100644 --- a/_csharp-api/mountandblade/mbinitialscreenbase.md +++ b/_csharp-api/mountandblade/mbinitialscreenbase.md @@ -1,8 +1,8 @@ # MBInitialScreenBase -You can create a custom title screen by inheriting from MBInitialScreenBase and then applying the GameStateScreen attribute to your class. +想要创建一个自定义的开场画面,你可以写一个MBInitialScreenBase的派生类,然后让这个类采用`GameStateScreen`属性。 -Here is a skeleton of what your inherited class should look like: +这个派生类的写法,可以参考以下例子: ```csharp [GameStateScreen(typeof(InitialState))] @@ -28,5 +28,4 @@ public class MyInitialScreen : MBInitialScreenBase } ``` -Replace the string `InitialScreen` with the name of your [Movie](../../_gauntlet/movie.md)'s XML file. - +然后把类名中的 `InitialScreen` 替换成相应的[影片](../../_gauntlet/movie.md)XML文件的文件名。 diff --git a/_csharp-api/mountandblade/mbsubmodulebase.md b/_csharp-api/mountandblade/mbsubmodulebase.md index e510702d..7eed1ba1 100644 --- a/_csharp-api/mountandblade/mbsubmodulebase.md +++ b/_csharp-api/mountandblade/mbsubmodulebase.md @@ -1,45 +1,44 @@ # MBSubModuleBase -You can inherit from the MBSubModuleBase class to handle the loading of your module, it is essentially the entry point to your code. There are several useful overrides, such as `OnSubModuleLoad()` and `OnApplicationTick()` that you can make use of. +你可以通过继承 `MBSubModuleBase 类` 来处理MOD的加载,可以说这是你MOD的入口。这个类中有一些很有用的重载,比如 `OnSubModuleLoad()` 和 `OnApplicationTick()`。 -**It is important to note that you must reference the class' fully qualified name in the module's `SubModule.xml` for this to work properly.** +**一定注意在 `SubModule.xml` 里写上正确完整的类名,不然运行时会出问题。** -Example `SubModule.xml` where `ExampleMod.MySubModule` is the fully qualified name for the class inheriting MBSubModuleBase: [SubModule.xml](../../_xmldocs/submodule.md) +这是一个例子([SubModule.xml](../../_xmldocs/submodule.md)):例中的 `ExampleMod.MySubModule` 就是一个正确的类名。 -## Overrides +## 可重载的函数 -This is the full list of available overrides, in (generally) the order in which they are called. This is a rough guide and is not a substitute for debugging when you're having order-of-execution issues. +下面列出了所有可以重载的函数,并且一般情况下它们就是以这个顺序被调用。这只是一个大概的指南,当你遇到运行顺序导致的问题时,这不能取代Debug。 -- `OnSubModuleLoad()` - Called during the first loading screen of the game, always the first override to be called, this is where you should be doing the bulk of your initial setup. -- `OnApplicationTick(float)` - This is called once every frame, you should avoid expensive operations being called directly here and instead do as little work as possible for performance reasons. - - `float` - The time in milliseconds the frame took to complete. -- `OnBeforeInitialModuleScreenSetAsRoot()` - Called just before the main menu first appears, helpful if your mod depends on other things being set up during the initial load. -- `OnGameStart(Game, IGameStarter)` - Called immediately upon loading after selecting a game mode (submodule) from the main menu. - - `Game` - [See: Game](../core/game.md) +- `OnSubModuleLoad()` - 游戏处于加载界面时最先被调用的函数,你应该在这个函数中完成初始化的主要部分 +- `OnApplicationTick(float)` - 这个函数每一帧都会被调用一次,为了性能考虑,在这个函数中要尽量避免加入一些复杂且费时的操作 + - `float` - 完成当前帧耗费的时间(毫秒) +- `OnBeforeInitialModuleScreenSetAsRoot()` - 在主菜单出现前一刻被调用的函数,当你的MOD需要加载一些别的东西的时候挺有用的 +- `OnGameStart(Game, IGameStarter)` - 当用户在主菜单选择一个游戏模式(submodule)后会立刻被调用 + - `Game` - [详情: Game](../core/game.md) - `IGameStarter` - N/A -- `BeginGameStart(Game)` - Called immediately after loading the selected game mode (submodule) has completed. - - `Game` - [See: Game](../core/game.md) -- `OnGameLoaded(Game, object)` - Called only after loading a save. - - `Game` - [See: Game](../core/game.md) +- `BeginGameStart(Game)` - 当所选的游戏模式加载完成后立刻被调用 + - `Game` - [详情: Game](../core/game.md) +- `OnGameLoaded(Game, object)` - 当加载了一个存档后被调用 + - `Game` - [详情: Game](../core/game.md) - `object` - N/A -- `OnCampaignStart(Game, object)` - Called once any game mode is started. - - `Game` - [See: Game](../core/game.md) +- `OnCampaignStart(Game, object)` - 当任意游戏模式启动后被调用 + - `Game` - [详情: Game](../core/game.md) - `object` - N/A -- `OnGameInitializationFinished(Game)` - Called once the initialisation for a game mode has finished. - - `Game` - [See: Game](../core/game.md) -- `DoLoading(Game)` - Called seemingly as loading is ending, not entirely sure of this one. - - `Game` - [See: Game](../core/game.md) -- `OnNewGameCreated(Game, object)` - Called when starting a new save in the campaign mode specifically. - - `Game` - [See: Game](../core/game.md) +- `OnGameInitializationFinished(Game)` - 当某个游戏模式初始化完成后被调用 + - `Game` - [详情: Game](../core/game.md) +- `DoLoading(Game)` - 当加载结束时被调用,这个不是很确定 + - `Game` - [详情: Game](../core/game.md) +- `OnNewGameCreated(Game, object)` - 当战役模式中开始一个新游戏时被调用 + - `Game` - [详情: Game](../core/game.md) - `object` - N/A -- `OnMissionBehaviourInitialize(Mission)` - Called once a mission is started and behaviours are to be initialized. - - `Mission` - [See: Mission](mission.md) -- `OnGameEnd(Game)` - Called on exiting out of a mission/campaign. - - `Game` - [See: Game](../core/game.md) -- `OnSubModuleUnloaded()` - Called when exiting Bannerlord entirely. - +- `OnMissionBehaviourInitialize(Mission)` - 当一个任务(mission)开始后,行为(behaviours)初始化前被调用 + - `Mission` - [详情: Mission](mission.md) +- `OnGameEnd(Game)` - 当退出一个任务或战役时被调用 + - `Game` - [详情: Game](../core/game.md) +- `OnSubModuleUnloaded()` - 当退出游戏时被调用 -- `OnMultiplayerGameStart(Game, object)` - Multiplayer related, haven't tested. +- `OnMultiplayerGameStart(Game, object)` - 多人游戏相关,未测试 - `Game` - [See: Game](../core/game.md) - `object` - N/A \ No newline at end of file diff --git a/_csharp-api/mountandblade/mission.md b/_csharp-api/mountandblade/mission.md index cfb000c8..96505111 100644 --- a/_csharp-api/mountandblade/mission.md +++ b/_csharp-api/mountandblade/mission.md @@ -1,10 +1,9 @@ # Mission -You can think of Missions as GameModes(Battles/TeamDeathMatch) etc. Missions are instantiated with a [Scene](../engine/scene.md), [MissionViews](missionbehaviour/missionview.md), and [MissionBehaviours](missionbehaviour/README.md). +所谓任务\(`Mission`\),可以理解成游戏模式`GameMode`(如战场`Battle`,死斗`TeamDeathMatch`之类)。当任务实例化的时候,同时还会生成的实例有:场景[Scene](../engine/scene.md),任务视图[MissionViews](missionbehaviour/missionview.md),还有任务行为[MissionBehaviours](missionbehaviour/README.md)。 -More information on missions will be available once we gain access to the `CampaignSystem` DLLs. +更多关于任务的相关信息,要等我们\(文档原作者\)获得`CampaignSystem`的DLL的访问权。 -## Tips - -* You can get the current mission instance (if any) by using `Mission.Current` property. +## 小贴士 +* 你可以通过 `Mission.Current` 属性获取当前任务下的实例\(假如有任何实例的话\)。 \ No newline at end of file diff --git a/_gauntlet/movie.md b/_gauntlet/movie.md index 138d1535..8925c09a 100644 --- a/_gauntlet/movie.md +++ b/_gauntlet/movie.md @@ -1,25 +1,25 @@ -# Movie (XML) +# Movie \(XML\) -Movies are used when you open any new [GauntletView](gauntletview.md) or [ScreenBase](screenbase.md). They are loaded through the [GauntletMovie](gauntletmovie.md) class. +当你打开任何新的 [GauntletView](gauntletview.md) 或者 [ScreenBase](screenbase.md)时可以使用Movie。 +它们通过 [GauntletMovie](gauntletmovie.md) 类加载。 -The template for a movie is as follows: +使用Movie的模板如下: ```markup - + - + - + - + ``` -You will spend most of your time adding child elements ([Widgets](widget.md)) to the `Window` element. - +你将花费大部分时间,在向`Window`元素添加子元素上。 diff --git a/_gauntlet/screenbase.md b/_gauntlet/screenbase.md index 063d2c55..a396df10 100644 --- a/_gauntlet/screenbase.md +++ b/_gauntlet/screenbase.md @@ -1,8 +1,8 @@ # ScreenBase -You can organize and instantiate your [ViewModels](viewmodel.md) and [Movies](movie.md) by using screens. +你可以通过screen组织并生成你的 [ViewModels](viewmodel.md) 和 [Movies](movie.md)。 -In order to prevent any issues, it is recommended that you use the template below when creating your screens. +为了防止出现问题,推荐使用以下模板创建screen: ```csharp public class MyExampleScreen : ScreenBase @@ -33,7 +33,7 @@ public class MyExampleScreen : ScreenBase protected override void OnDeactivate() { - base.OnDeactivate(); + base.OnDeactivate() _gauntletLayer.IsFocusLayer = false; ScreenManager.TryLoseFocus(_gauntletLayer); } @@ -48,11 +48,10 @@ public class MyExampleScreen : ScreenBase } ``` -## Pushing your Screen +## Screen入栈 -To push your screen onto the screen stack, you can do following: +要将你的screen加入screen栈,你可以这样做: ```csharp ScreenManager.PushScreen(ViewCreatorManager.CreateScreenView()); ``` - diff --git a/_gauntlet/screenmanager.md b/_gauntlet/screenmanager.md index 31f693bc..ee26febe 100644 --- a/_gauntlet/screenmanager.md +++ b/_gauntlet/screenmanager.md @@ -1,6 +1,7 @@ # ScreenManager -If you plan to do anything Gauntlet-related (e.g. UIs), you should familiarize yourself with the Screen Manager. +如果你打算做任何与Gauntlet相关的东西(例如:UI),你就必须熟悉Screen Manager。 -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. +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. +Screen Manager可以用来将screen入栈(push) \(这可能加载 [Movies](movie.md)\),检查哪个screen当前正在被指向(focused)、或在顶端(topmost),或者将已经完成的screen出栈(pop)。 diff --git a/_gauntlet/widget.md b/_gauntlet/widget.md index a8eeceb7..f9cac959 100644 --- a/_gauntlet/widget.md +++ b/_gauntlet/widget.md @@ -1,38 +1,36 @@ # Widget -Widgets are a great way to create interactable content for your UIs. This may include scrollbars, buttons, tooltips, and so on. +Widgets(以下简称控件) 是一种强大的,用于为你的UI创建可交互内容的工具。它可能包括scrollbars(滚动条), buttons(按钮), tooltips(工具栏),等等。 -## Common Predefined Widgets Include +## 常用的预定义控件包括 -* ButtonWidget -* ImageWidget -* ListPanel -* RichTextWidget -* ScrollablePanel -* ScrollBarWidget -* TextWidget -* TooltipWidget -* Widget +* ButtonWidget(按钮) +* ImageWidget (图片) +* ListPanel(列表界面) +* RichTextWidget(富文本) +* ScrollablePanel(滚动界面) +* ScrollBarWidget(滚动条) +* TextWidget(普通文本) +* TooltipWidget(工具栏) +* Widget(控件) -### Note +### 注意 +这里有非常多的控件;上面所列举的只是最常用到的控件。你可以通过反编译`TaleWorlds.GauntletUI.dll`和`TaleWorlds.MountAndBlade.GauntletUI.dll`这2个DLL文件去找到其它控件。继承于`widget`类的自定义控件的标签名将会与自定义控件类的类名相同。 -There many more widgets; the above are just the most commonly used widgets. You can find the other widgets by decompiling the `TaleWorlds.GauntletUI.dll` and `TaleWorlds.MountAndBlade.GauntletUI.dll` DLLs. Widgets inherit the `Widget` class and the tag name for that widget will be the same as class name. - -## Common Predefined Attributes for Widgets Include +## 控件常用的预定义属性包括 * Brush -* Command.Click _(Command.YourKeyHere)_ -* DataSource _(Properties with DataSourceProperty Attribute in C#)_ +* Command.Click _\(Command.自定义方法键\)_ +* DataSource _\(Properties with DataSourceProperty Attribute in C\#\)_ * DoNotAcceptEvents * HorizontalAlignment / VerticalAlignment * Id * MarginLeft / MarginRight / MarginTop / MarginBottom * Sprite * SuggestedWidth / SuggestedHeight -* Text _(Text Widgets only)_ +* Text _\(只有Text控件包含此属性\)_ * WidthSizePolicy / HeightSizePolicy -## Creating a Custom Widget - -You can create a custom widget by simply creating a class that inherits from `Widget`. After doing so, you can use your Widget inside any [Movie](movie.md). The tag name for your widget will be the same as the class name you used for it. +## 创建一个自定义控件 +你可以通过简单的继承`widget`类来创建一个自定义控件。当这一切完成以后,你可以在[Movie](movie.md)中使用你自定义的控件。你的控件的标签名将会与你自定义控件类的类名相同。 diff --git a/_intro/advanced.md b/_intro/advanced.md index a23f2263..bad9c7a4 100644 --- a/_intro/advanced.md +++ b/_intro/advanced.md @@ -1,10 +1,13 @@ -# Advanced +# 高级用法 ## [Harmony](https://github.com/pardeike/Harmony) -Harmony is a popular library used in modding for several other games. It can be used to alter functionality of applications and DLLs during runtime (these changes are not permanent and are only valid for the current session). -_Note that this may cause incompatibilities between mods if they try to patch the same method(s), so it should only be used when absolutely needed._ -A common use of this library might be to execute code before/after a particular method (prefix/postfix). However, it can also be used to replace an entire method with your own method or to patch individual IL instructions (be careful with this). +Harmony 是在多个其它游戏中得到应用的,广受欢迎的库。它可以针对运行中的程序与DLL进行功能性的修改(这些改动并非永久性的,它们只在这次运行中生效) +_注意,如果多个Mod尝试修改相同的方法,这可能导致冲突。因此,它应该只在必需时使用。_ + +关于这个库,典型的用法是在特定的方法被执行[之前/之后]再执行。 + +但是,它也可以使你自己编写的方法完全取代内置方法,或者追加独立IL instructions \(谨慎使用) \ No newline at end of file diff --git a/_intro/folder-structure.md b/_intro/folder-structure.md index 36095f65..5658aeb6 100644 --- a/_intro/folder-structure.md +++ b/_intro/folder-structure.md @@ -1,25 +1,32 @@ -# Folder Structure +# 文件夹结构 -All folders are entirely optional, the only requirement for a SubModule to be detected by the Launcher is the SubModule base directory itself and a valid [SubModule.xml](../_xmldocs/submodule.md) +所有文件夹都不是必须的,对于SubModule来说,唯一的要求就是启动器必须能够监测到SubModule文件夹自身,以及有效的 [SubModule.xml](../_xmldocs/submodule.md) 文件。 -For a full example of the folder structure and contents refer to `Drive:\\InstallLocation\Mount & Blade II Bannerlord\Modules\Native\` +完整的Mod文件结构与内容可以参考 + `盘符:\\安装目录\Mount & Blade II Bannerlord\Modules\Native\` -## Folder Descriptions & File Examples -* `AssetPackages` - Unknown at this time, likely requires the release of the editor to create/modify these files. - * `someasset.tpac` -* `Atmospheres` - [Refer to [Atmosphere]](../_xmldocs/atmosphere.md) +## 文件夹描述 & 文件样例 + +* `AssetPackages` - 暂时还不知道作用,可能需要等到官方编辑器放出才能创建/修改这些文件。 + * `someasset.tpac` + +* `Atmospheres` - [参见\[Atmosphere\]](../_xmldocs/atmosphere.md) * `Interpolated` * `interpolatedatmosphere.xml` * `atmosphere.xml` -* `bin` - Where compiled binaries should go - [Refer to [Basic C# Mod]](../_tutorials/basic-csharp-mod.md) + +* `bin` - 编译好的二进制文件放在这里 - [参见 \[基础的 C\# Mod制作\]](../_tutorials/basic-csharp-mod.md) * `Win64_Shipping_Client` * `MyModule.dll` -* `GUI` - For most things related to Gauntlet. - * `Brushes` - For Gauntlet Brushes. - * `Prefabs` - For Gauntlet Movies. -* `ModuleData` - For any general data related to your mod that is in XML format (e.g. items/cultures/gametexts). -* `SceneObj` - For your scenes. + +* `GUI` - 大多数与Gauntlet有关的内容放在这里。 + * `Brushes` - 存放Gauntlet Brushes。 + * `Prefabs` - 存放Gauntlet Movies。 + +* `ModuleData` - 任何与你的Mod有关的XML格式数据存放在这里。 \(例如:items/cultures/gametexts\) + +* `SceneObj` - 存放场景。 ```text - MyModule @@ -39,4 +46,3 @@ For a full example of the folder structure and contents refer to `Drive:\\Instal - SceneObj - SubModule.xml ``` - diff --git a/_intro/getting-started.md b/_intro/getting-started.md index a615b045..df12dd7b 100644 --- a/_intro/getting-started.md +++ b/_intro/getting-started.md @@ -1,41 +1,40 @@ -# Getting Started +# 开始第一步 -## Important +## 重要提示 -Before proceeding, it is important to have a good understanding of the [SubModule.xml](../_xmldocs/submodule.md) file, as this file tells the game what it should be loading when your mod is selected. +在进一步工作之前, 理解文件[SubModule.xml](../_xmldocs/submodule.md) 是非常重要的,因为这个文件指定了你Mod中的哪一部分会被加载。 -## Tools +## 工具 -### C# IDE +### C\# IDE -* [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) (not required for basic mods) +* [Microsoft Visual Studio](https://visualstudio.microsoft.com/downloads/) \(基础的Mod不需要用到它\) -### Text Editor +### 文本编辑器 -Any text editor will suffice, but one of these is recommended... +任何文本编辑器都足以满足要求, 但是以下是推荐使用的: * [Visual Studio Code](https://code.visualstudio.com/download) * [Sublime Text](https://www.sublimetext.com/) * [Notepad++](https://notepad-plus-plus.org/downloads/) -## Modding without C# +## 不使用 C\# 制作Mod -There are several aspects of the game you can mod without C#. This includes scenes, items, cultures, characters, Gauntlet UIs, and many more. +游戏中部分内容不需要C#即可定制,包括场景、物品、文化、角色、Gauntlet UI等等。 -## Modding with C# +## 使用 C\# 制作Mod -The module-based modding system makes modding in Bannerlord much easier than past games in the series and allows for much more complexity in your mods. +“基于模组”的Mod制作系统,使霸主的Mod制作工作比前作更加容易,并且它支持实现更复杂的Mod功能。 -## Creating a Module +## 制作一个模组 -In Bannerlord an individual mod is called a Module and the only required part is the SubModule folder itself and a `SubModule.xml` file which informs the launcher of your mod. +在霸主,一个独立运行的Mod被叫做“模组”。模组唯一必要的部分就是SubModule文件夹,和负责启动Mod的`SubModule.xml`文件。 -1. Create a new folder in the `Modules` directory in your game files, the name of the folder must be the name of your SubModule. -2. Create a `SubModule.xml` file in your new folder. You can [see an example here](../_xmldocs/submodule.md) or find the [full documentation here](../_xmldocs/submodule.md) +1.在游戏目录的`Modules`文件夹中新建文件夹,文件夹名称必须与你的SubModule保持一致。 +2. 在你的新文件夹中创建文件`SubModule.xml`,你可以 [看看这个例子](../_xmldocs/submodule.md) 或者 [获取完整参考文档](../_xmldocs/submodule.md) -## Next Steps - -- Refer to the [Folder Structure](folder-structure.md) page for additional information on what additional directories to add depending on the intended content of your mod. -- Refer to the [Basic C# Mod](../_tutorials/basic-csharp-mod.md) page for an example of how to set up, build and run code in Bannerlord. -- Refer to the [Modding Gauntlet UIs Without C#](../_tutorials/modding-gauntlet-without-csharp.md) page for information on how to mod Gauntlet UIs without using any C#. +## 下一步 +* 参考[文件结构](folder-structure.md) 页面,以获取其它文件夹路径的参考信息,帮助拓展你的Mod。 +* 参考[基础 C\# Mod](../_tutorials/basic-csharp-mod.md) 页面,它提供了一份在霸主中设置,编译,运行代码的简单例子。 +* 参考[不使用C#的Gauntlet UI定制](../_tutorials/modding-gauntlet-without-csharp.md) 页面,它提供了无需C#的Gauntlet UI定制方法。 diff --git a/_tutorials/basic-csharp-mod.md b/_tutorials/basic-csharp-mod.md index 60c163a0..44fa049d 100644 --- a/_tutorials/basic-csharp-mod.md +++ b/_tutorials/basic-csharp-mod.md @@ -1,19 +1,19 @@ -# Basic C# Mod +# 基本 C\# Mod -## Introduction +## 介绍 -The following guide will walk you through step-by-step on how to create a basic C# mod. This mod will add a button to the singleplayer title screen called `Message`. When clicked, this button will output `Hello World` to chat. +本文档旨在一步一步教你如何创建一个简单的 C\# Mod。这个Mod将会在单人模式的标题页面增加一个叫做 `消息` 的按钮。当点击按钮的时候,将会在聊天界面输出 `Hello World`。 -## Preparation +## 准备 -#### For this tutorial, we will be naming our project `ExampleMod`. +#### 在本教程中,我们的项目名字叫做 `ExampleMod`。 -### Setting up your Module (SubModule.xml) +### 配置你的Module \(SubModule.xml\) -1. Go to your game files and locate the `Modules` directory. -2. Create a new folder and name it `ExampleMod` (Must be the same as the Id you use for Step #4). -3. Create a new folder named `bin` and inside this directory, create a new folder called `Win64_Shipping_Client`. -4. Create a new `SubModule.xml` file (must be named this) inside the folder you created in Step #2 and then paste the following into it: +1. 到你的游戏目录下并且选定 `Modules` 目录; +2. 创建一个新的目录并且叫做 `ExampleMod` (这个目录名称必须和第四步里面的 Id 一致) Create a new folder and name it `ExampleMod` (Must be the same as the Id you use for Step #4); +3. 创建一个名叫 `bin` 的目录, 并且在这个目录下,创建一个新的目录 `Win64_Shipping_Client`; +4. 在 `ExampleMod` 目录下建一个新的文件 `SubModule.xml` (必须是这个名字), 同时复制如下内容进去: ```xml @@ -44,41 +44,41 @@ The following guide will walk you through step-by-step on how to create a basic ``` - **Note**: `MySubModule` is the name of the class we will be using in the [Programming](#programming) section of the tutorial. + **提示**: `MySubModule` 是我们在[编程]((#programming))指导部分要用到的设定的类名字。 -5. If you are using different names, change the above values to match that of your Module/SubModule. -6. Start the launcher and make sure your mod appears under `Singleplayer` > `Mods`. +5. 如果你在用其他名字,上述的内容要按照需要修改。 +6. 启动游戏,确保你的 Mod 出现 `Singleplayer` > `Mods`。 -For more information on the Module folder structure, [Click Here](../_intro/folder-structure.md). +对于Mod文件结构的信息,请参考[这里](../_intro/folder-structure.md) -### Setting up your Project +### 配置项目 -Before setting up a project, it is important to know that **this is not required for basic mods** (e.g. changing or adding items/characters/scenes). +创建 C\# 项目之前,要明白的是,如果只是修改/增加物品,人物或场景的话,可以不需要创建项目。 -1. Start Microsoft Visual Studio and select `Create New Project`. -2. Choose `Class Library (.NET Framework)`. -3. Name your project `ExampleMod` (if you choose another name make sure that your namespace and assembly name are correct) `.NET Framework 4.7.2` as the `Framework`. If this option is not available for you, [Download it here](https://dotnet.microsoft.com/download/dotnet-framework/net472) (Developer Pack). -4. Now that your project is setup, [set your build path](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-change-the-build-output-directory?view=vs-2019) to the `Modules/ExampleMod/bin/Win64_Shipping_Client` directory in your game files. -5. [Reference](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-add-or-remove-references-by-using-the-reference-manager?view=vs-2019) the `TaleWorlds.*` DLLs in the `bin\Win64_Shipping_Client` directory of your game files (not your module directory). Also reference the `TaleWorlds.*` DLLs for each official module in `Modules\ModuleName\bin\Win64_Shipping_Client`. +1. 启动 Microsoft Visual Studio 并且选择 `创建新项目`。 +2. 选择 `类库 (.NET Framework)`。 +3. 给项目起名字并且选择框架 `.NET Framework 4.7.2`。如果不能选这个选项,可以从[这里](https://dotnet.microsoft.com/download/dotnet-framework/net472)下载。下载\(开发者包\) +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`。 +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`。 -### Debugging your Project (Optional) +### Debugging 项目 (可选) -#### Way 1 (Preferred) -1. Open your project properties and go to the `Debug` tab. -2. Select the `Start external program` option and then browse for `Bannerlord.exe` located in the `bin\Win64_Shipping_Client` directory in your game files (not your module directory). -3. Set your working directory to the `bin\Win64_Shipping_Client` directory in your game files (not your module directory). -4. Add the following command line arguments (be sure to replace ExampleMod with the name of your module): - * `/singleplayer _MODULES_*Native*SandBoxCore*CustomBattle*SandBox*StoryMode*ExampleMod*_MODULES_` +#### 方法一 (推荐) +1. 打开 项目属性 到 `Debug` 选项卡。 +2. 选择 `启动外部程序` 选项,同时浏览到你游戏目录下(不是Modules目录)的`bin\Win64_Shipping_Client`文件夹里面的 `Bannerlord.exe`。 +3. 设置工作目录到游戏目录(不是Modules目录)下的 `bin\Win64_Shipping_Client`。 +4. 添加如下的命令行参数(要确定替代 `MyModule` 的名字) + * `/singleplayer _MODULES_*Native*SandBox*SandBoxCore*StoryMode*CustomBattle*MyModule*_MODULES_` -#### Way 2 (If you want to start your debugging from launcher window) -1. Open your project properties and go to the `Debug` tab. -2. Select the `Start external program` option and then browse for `TaleWorlds.MountAndBlade.Launcher.exe` located in the `bin\Win64_Shipping_Client` directory in your game files (not your module directory). -3. Set your working directory to the `bin\Win64_Shipping_Client` directory in your game files (not your module directory). +#### 方法二 (如果你想从启动器窗口开始 Debugging) +1. 打开 项目属性 到 `Debug` 选项卡; +2. 选择 `打开外部程序` 选项同时浏览到你的游戏目录下(不是你的Mod目录)`bin\Win64_Shipping_Client` 文件夹下的 `TaleWorlds.MountAndBlade.Launcher.exe`; +3. 设定你的工作目录是游戏目录下的 `bin\Win64_Shipping_Client` -## Programming +## 编程 -1. Create a new class in your VS Project and name it `MySubModule`, then open it. -2. Add the following using directives to your class: +1. 添加或打开 `MySubModule` 类。 +2. 添加如下的引用。 ```csharp using TaleWorlds.Core; @@ -86,20 +86,21 @@ Before setting up a project, it is important to know that **this is not required using TaleWorlds.MountAndBlade; ``` -3. Inherit from the `MBSubModuleBase` class. -4. Setup an override for the `OnSubModuleLoad()` inherited method. -5. Add the following code to your override method: +3. 继承 `MBSubModuleBase` 类 +4. 重载 `OnSubModuleLoad()` 方法 +5. 添加如下代码到这个方法: ```csharp Module.CurrentModule.AddInitialStateOption(new InitialStateOption("Message", - new TextObject("Message", null), + new TextObject("消息", null), 9990, () => { InformationManager.DisplayMessage(new InformationMessage("Hello World!")); }, false)); ``` -6. Compile your project and confirm that it was outputted to `Modules\ExampleMod\bin\Win64_Shipping_Client`. -7. Open the Bannerlord launcher and navigate to `Singleplayer` > `Mods` then make sure that your mod is ticked and start the game. -8. On the title screen, you should now see a button called `Message`, click it and you should see `Hello World` displayed in the bottom-left corner of your screen (in chat). -9. You have now successfully created your first Bannerlord mod! +6. 编译你的项目并且确认输出到 `Modules\ExampleMod\bin\Win64_Shipping_Client` 下 +7. 打开霸主启动器,并且选择 `Singleplayer` > `Mods` 然后选择你的 Mod, 然后启动游戏。 +8. 在标题页面,你应该能看到一个按钮叫做 `消息` ,点击你应该能看到 `Hello World` 出现在屏幕左下角。 +9. 现在你已经成功创建了第一个骑马与砍杀2:霸主的Mod! + diff --git a/_tutorials/modding-gauntlet-without-csharp.md b/_tutorials/modding-gauntlet-without-csharp.md index dcc6d7e6..fe2f5287 100644 --- a/_tutorials/modding-gauntlet-without-csharp.md +++ b/_tutorials/modding-gauntlet-without-csharp.md @@ -1,31 +1,28 @@ -# Modding Gauntlet Without C# +# 不需要C#的UI系统Mod入门 # -## Important +## 重要提示 +### 本教程中,你 **不能** 使用任何依赖性的模组 *(译者注:即其它模组运行需要的前置模组,如Native)* +### 尽管这方面应该不会有什么问题。 -### 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. +## 说明 -## Introduction +接下来的指南将在不使用任何C#的情况下,一步一步地教你创建可以重写任何Gauntlet UI的Mod。在这个例子中,我们将使用一些自定义的文本重写任务UI。 -The following guide will walk you through step-by-step on how to create a mod that can overwrite any Gauntlet UI without using any C#. For this example, we will be overriding the Quests UI with some custom title text. +## 准备 -## Preparation +#### 在本教程中, 我们将要做的Mod命名为 `ExampleUIMod`. -#### For this tutorial, we will be naming our project `_ExampleUIMod`. - -**Note:** The underscore in the name is used to ensure that our mod is loaded first ([see issue above](#important)). - -### Setting up your Module (SubModule.xml) - -1. Go to your game files and locate the `Modules` directory. -2. Create a new folder and name it `_ExampleUIMod` (Must be the same as the Id you use for Step #5). -3. Create a new folder named `GUI` and open it. -4. Now create a new folder in your `GUI` directory called `Prefabs`. We will come back to this folder later in the tutorial. -5. Go back to the module folder you created in Step #2 and create a new `SubModule.xml` file and then paste the following into it: +### 设置好你的模组 \(SubModule.xml\) +1. 到游戏目录下,找到 `Modules` 文件夹。 +2. 创建新文件夹,命名为 `ExampleUIMod` (必须和你在步骤#5中使用同样的 Id) +3. 创建新文件夹,命名为 `GUI` 并打开。 +4. 在GUI文件夹中,创建文件夹并命名为`Prefabs`。我们等会儿会用到它。 +5. 回到步骤#2中你所创建的模组文件夹 *(即ExampleUIMod,译者注)*,并且创建文件`SubModule.xml`,然后把如下代码粘贴到文件里: ```xml - + @@ -34,34 +31,33 @@ The following guide will walk you through step-by-step on how to create a mod th ``` +6. 运行启动器,保证你的Mod能够在`Singleplayer` > `Mods`下出现。 -6. Start the launcher and make sure your mod appears under `Singleplayer` > `Mods`. - -For more information on the Module folder structure, [Click Here](../_intro/folder-structure.md). +要获取更多模组文件结构的信息, [点击这里](../_intro/folder-structure.md) -## Overriding a Gauntlet UI +## 重写一个Gauntlet UI -Note: You can override any Gauntlet UI. However, for this tutorial, we will only be overriding the Quests UI. +注意: 你可以重写任何 Gauntlet UI. 然而,在本教程中, 我们只重写任务UI。 -1. Go to `Modules\SandBox\GUI\Prefabs\QuestsScreen` and copy the `QuestsScreen.xml` file to your clipboard -2. Go to the `Prefabs` folder you created in Step 4 of `Setting up your Module` and paste the `QuestsScreen.xml` from your clipboard. -3. Open the pasted file in a text editor. -4. Search (Ctrl+F) for a `Text="@QuestTitleText"` and go to this section of the file. -5. Replace `@QuestTitleText` (including @ symbol) with the text you want the title to be. -6. Save the file. -7. Open the Bannerlord launcher and navigate to `Singleplayer` > `Mods` then make sure that your mod is ticked and start the game and load any save. -8. Open the Quests UI and you should see the text you added in the top middle of the screen. -9. You have now successfully created your first Bannerlord Gauntlet mod! +1. 到目录`Modules\SandBox\GUI\Prefabs\QuestsScreen` 并且复制 `QuestsScreen.xml` 文件到剪贴板。 +2. 到“设置好你的模组”步骤#4中,你所创建的`Prefabs`文件夹下,粘贴`QuestsScreen.xml` 文件。 +3. 在文本编辑器中打开粘贴的文件。 +4. 搜索定位 (Ctrl+F) `Text="@QuestTitleText"`。 +5. 替换 `@QuestTitleText` (包括 @ 符号) 为你想要的标题。 +6. 保存文件。 +7. 打开霸主启动器并且切换至 `Singleplayer` > `Mods` 界面,确保你的Mod打了勾,然后启动游戏,随便选个存档开始游戏。 +8. 打开任务UI,你应该能够在屏幕的中上方看到你添加的的文本。 +9. 你已经成功创建了你第一个霸主Gauntlet Mod! -## How To Enable & Use Live UI Editing +## 如何启用&使用动态UI编辑 -Live UI editting is a feature in the game that will make your life **a lot** easier. Unfortunately though, it isn't something you can enable with just the base game. +动态UI编辑,是使你生活**大大**轻松的游戏特性。不幸的是,它不是你在基础版本的游戏内部就能启用的。 -To enable it, you will need to [download the DeveloperConsole Mod](https://www.nexusmods.com/mountandblade2bannerlord/mods/4). +要启用它, 你必须 [下载 DeveloperConsole Mod](https://www.nexusmods.com/mountandblade2bannerlord/mods/4). -Once you have downloaded & installed the Developer Console Mod, follow the steps below to enable live editing for your game session. +只要你下载 & 安装好了 Developer Console Mod, 按以下步骤操作,就能在游戏中启用动态编辑。 -1. Open the game launcher and then make sure `Developer Console` is ticked in `Singleplayer` > `Mods` along with your Gauntlet UI mod. -2. The Developer Console mod uses the shortcut `CTRL` + `~` (tilde) to enable the console. If this shortcut doesn't work for you, try pressing CTRL and then the key on your keyboard above Tab and below Esc. -3. Now that you can see the console, you will want to type the command `ui.toggle_debug_mode` to enable the live UI editing feature. -4. Any changes you make to your UIs should now update automatically in-game. +1. 打开游戏启动器,确保 `Singleplayer` > `Mods`界面的 `Developer Console`和你的Gauntlet UI Mod打上勾。 +2. Developer Console Mod 使用 `CTRL` + `~`(波浪符) 快捷键开启控制台。如果你发现快捷键不起作用, 尝试按下CTRL,然后按下 你键盘上Tab和Esc之间的那个键。 +3. 现在你已经看见了控制台,你会想键入`ui.toggle_debug_mode`命令来启用动态UI编辑特性。 +4. 任何你对UI的改动,都应该会自动更新到游戏中。 diff --git a/_tutorials/packing_mods_for_vortex.md b/_tutorials/packing_mods_for_vortex.md index dec340f9..84b0b848 100644 --- a/_tutorials/packing_mods_for_vortex.md +++ b/_tutorials/packing_mods_for_vortex.md @@ -1,27 +1,29 @@ -# Packing your mods for Vortex +# 将你的mod打包上传至Vortex -## Introduction -Vortex is the powerful, open source mod manager by Nexus Mods. It supports installing and managing mods for 100+ games, including Mount & Blade 2: Bannerlord. When sharing you mod, there are few considerations you should make to ensure that it is structure in a way that is compatible with Vortex. [You can learn more about Vortex here](https://nexusmods.com/about/vortex). +## 介绍 +Vortex是Nexus Mods出品的、强大的开源Mod管理器。 它支持安装和管理适用于100多种游戏的mod,包括骑马与砍杀2:霸主。 共享您的mod时,应注意一些事项,以确保其结构与Vortex兼容。 + [你可以在这里了解关于Vortex的更多事情](https://nexusmods.com/about/vortex). -## Modules -Modules are detected automatically, they are characterised by mods that are intended to be self contained in the "Modules" folder and include a Submodule.xml file. Vortex grabs the entire folder containing the Submodule.xml and places it into the "Modules" folder of the game. +## 模组 -Don't forget to enable these mods in the launcher when starting the game! +模组是自动检测的,它们由多个mod组成。这些mods包含在“ Modules”文件夹中,并且包含Submodule.xml文件。 Vortex抓取了包含Submodule.xml的整个文件夹,并将其放入游戏的“ Modules”文件夹中。 +开始游戏时,请不要忘记在启动器中启用这些mod! -## XML Edits and other Mods -Any other type of mod currently requires you to simply pack it relative to the game base folder. For example, if I have the file "BannerEditor.xml" which needs to go into the "Modules\Native\GUI\Prefabs\Bannereditor" folder, I'll need to add those folders above my file in the archive that I upload. +## XML 编辑与其它mod -This will allow anything including XML edits, video/sound edits and Reshade presets to be installed correctly and consistently. +当前,任何其他类型的mod都需要您相对于游戏根目录进行简单打包。 例如,如果我有文件“ BannerEditor.xml”,则需要进入“ Modules \ Native \ GUI \ Prefabs \ Bannereditor”文件夹,然后将我上传的文件放到这些文件夹下。 +这种方式将正确且一致地安装包括XML编辑,视频/声音编辑和Reshade预设在内的所有内容。 -## Mods with multiple options -Vortex supports [mod installers](https://wiki.nexusmods.com/index.php/How_to_create_mod_installers) which allow you offer users a single download containing a choice of options in your mod. Mod installers can be written in XML or created with the [FOMOD Creation Tool](https://www.nexusmods.com/fallout4/mods/6821/?tab=files). If you would like to use a mod installer but are having difficulty getting set up, please reach out to the Nexus Mods Community Managers and we'll be happy to assist you. +## 有多种选项的Mod +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社区管理员,我们将很乐意为您提供帮助。 -## Incompatible mods -At time of writing, we are not aware of any kind of mod that isn't compatible with Vortex (when packed correctly). However, if you are uploading a tool or savegame that should *not* be installed this way, you can disable the Vortex button on the Nexus Mods page. +## 不匹配的Mod + +在撰写本文时,我们还不知道是否有与Vortex不兼容的任何Mod(正确打包上传的前提下)。 但是,如果您上传的工具或保存游戏不应该以上述方式安装,则可以在Nexus Mods页面上禁用Vortex按钮。 \ No newline at end of file diff --git a/_xmldocs/Items/CraftedItem/README.md b/_xmldocs/Items/CraftedItem/README.md index 5ed42710..e8c09126 100644 --- a/_xmldocs/Items/CraftedItem/README.md +++ b/_xmldocs/Items/CraftedItem/README.md @@ -27,27 +27,27 @@ Source: Modules/SandBoxCore/ModuleData/spitems.xml [id](#id) | [name](#name) | [crafting_template](#crafting_template) | [culture](#culture) | [is_merchandise](#is_merchandise) - #### id - **type:** `string` - **example:** `sturgia_axe_3_t3` + **类型:** `string` + **例子:** `sturgia_axe_3_t3` *The ID of the item* - #### name - **type:** `string` - **example:** `{=wW3iouiU}Hijab` + **类型:** `string` + **例子:** `{=wW3iouiU}Hijab` *Note: The prefix in the `{=}` format is the translation id found in strings.txt* *TODO: Find out if this is auto generated.* - #### crafting_template - **type:** `string` + **类型:** `string` **possible values:** `'TwoHandedPolearm', 'OneHandedAxe', 'Mace', 'TwoHandedAxe', 'OneHandedSword', 'TwoHandedSword', 'Pike', 'Dagger', 'Javelin', 'ThrowingAxe', 'ThrowingKnife'` - **example:** `TwoHandedPolearm` + **例子:** `TwoHandedPolearm` - #### culture - **type:** `string` + **类型:** `string` **possible values:** `'Culture.aserai', 'Culture.sturgia', 'Culture.battania', 'Culture.looters', 'Culture.khuzait', 'Culture.vlandia', 'Culture.empire', 'Culture.neutral_culture'` - **example:** `Culture.aserai` + **例子:** `Culture.aserai` - #### is_merchandise - **type:** `boolean` - **example:** `false` + **类型:** `boolean` + **例子:** `false` *If the item is marketable* \ No newline at end of file diff --git a/_xmldocs/Items/Item/Flags/README.md b/_xmldocs/Items/Item/Flags/README.md index 5acc7d12..6c9aef59 100644 --- a/_xmldocs/Items/Item/Flags/README.md +++ b/_xmldocs/Items/Item/Flags/README.md @@ -1,88 +1,88 @@ -# Flags +# 旗帜 Flags -## Parent node -- [Item](../../Item) +## 父节点 Parent node +- [物品 Item](../../Item) -## Child nodes -- *None* +## 子节点 Child nodes +- *无 None* -## Attributes +## 属性 Attributes [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) - #### Civilian - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item can be used in civilian* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### UseTeamColor - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item use color of team* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### DoesNotHideChest - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item hides chest* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### DropOnWeaponChange - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item drops on weapon change* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### ForceAttachOffHandPrimaryItemBone - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *TODO: what exactly does this do? Something with shield* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### HeldInOffHand - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item used as offhand* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### HasToBeHeldUp - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the item has to be held up for use* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### WoodenParry - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *TODO: what exactly does this do? Something with shield* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### DoNotScaleBodyAccordingToWeaponLength - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *TODO: what exactly does this do? Something with long polearms* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### QuickFadeOut - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *TODO: what exactly does this do? Somthing rare* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### CannotBePickedUp - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the weapon cannot be picked off the ground* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *能不能捡起来* - #### DropOnAnyAction - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the weapon drops on any action* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* - #### ForceAttachOffHandSecondaryItemBone - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *TODO: what exactly does this do? Something with shield* + **类型:** `boolean` + **接受的值:** `'true', 'false'` + **范例:** `true` + *待查明作用* diff --git a/_xmldocs/Items/Item/ItemComponent/Armor/README.md b/_xmldocs/Items/Item/ItemComponent/Armor/README.md index 644e3fa1..2ea7f111 100644 --- a/_xmldocs/Items/Item/ItemComponent/Armor/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Armor/README.md @@ -1,127 +1,122 @@ -# Armor +# 防具 Armor -## Parent Node +## 父节点 Parent Node - [ItemComponent](../../ItemComponent) -## Child Node -- *None* +## 子节点 Child Node +- *无 None* -## Attributes -[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) | [family_type](#family_type) | [maneuver_bonus](#maneuver_bonus) | [speed_bonus](#speed_bonus) | [charge_bonus](#charge_bonus) | [reins_mesh](#reins_mesh) | [covers_head](#covers_head) +## 属性 Attributes +[头部护甲 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) - #### head_armor - **type:** `int` - **example:** `64` - *Amount of head armour* + **类型:** `int` + **范例:** `64` + *头部护甲值* - #### has_gender_variations - **type:** `boolean` - **example:** `true` - *If there is a gender variation of the model* + **类型:** `boolean` + **范例:** `true` + *男女是否使用不同模型* - #### hair_cover_type - **type:** `string` - **accepted values:** `'all', 'type1', 'type2', 'type3'` - **example:** `all` - *TODO: figure out what type1, type2, type3 stands for* - *type1 - cover only top of head* - *type2 - cover top of head with ears and have strap* - *type3 - in common with arrow* + **类型:** `string` + **接受值:** `'all', 'type1', 'type2', 'type3'` + **范例:** `all` + *待查明type1,type2,type3分别是啥样的* - #### modifier_group - **type:** `string` - **accepted values:** `'cloth_unarmoured', 'leather', 'plate', 'chain', 'cloth'` - **example:** `leather` - *Modifier for hit sound* + **类型:** `string` + **接受值:** `'cloth_unarmoured', 'leather', 'plate', 'chain', 'cloth'` + **范例:** `leather` + *可能影响伤害吸收?* - #### material_type - **type:** `string` - **accepted values:** `'Cloth', 'Leather', 'Plate', 'Chainmail'` - **example:** `Cloth` - *The material of the armour* + **类型:** `string` + **接受值:** `'Cloth', 'Leather', 'Plate', 'Chainmail'` + **范例:** `Cloth` + *护甲的材质* - #### beard_cover_type - **type:** `string` - **accepted values:** `'type3', 'type2', 'none', 'all', 'type1'` - **example:** `none` - *Variable to set the covering of beard* + **类型:** `string` + **接受值:** `'type3', 'type2', 'none', 'all', 'type1'` + **范例:** `none` + *类似遮盖头发模式* - #### body_armor - **type:** `int` - **example:** `23` - *Amount of body armour* + **类型:** `int` + **范例:** `23` + *躯干护甲值* - #### leg_armor - **type:** `int` - **example:** `23` - *Amount of leg armour* + **类型:** `int` + **范例:** `23` + *腿部护甲值* - #### arm_armor - **type:** `int` - **example:** `23` - *Amount of hand (gauntlet) armour* + **类型:** `int` + **范例:** `23` + *手部护甲值* - #### covers_body - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the armour covers the body* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **范例:** `true` + *护甲是否覆盖躯干* - #### body_mesh_type - **type:** `string` - **accepted values:** `'shoulders', 'upperbody'` - **example:** `shoulders` - *Uses for tunics and dresses* + **类型:** `string` + **接受值:** `'shoulders'` + **范例:** `shoulders` + *待查明作用* - #### covers_legs - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the armour covers the legs* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **范例:** `true` + *是否覆盖双腿* - #### covers_hands - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the armour covers the hands* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **范例:** `true` + *是否覆盖双手* - #### mane_cover_type - **type:** `string` - **accepted values:** `'none', 'all'` - **example:** `none` - *none - don't cover horse's head and neck* - *all - cover whole horse* + **类型:** `string` + **接受值:** `'none', 'all'` + **范例:** `none` + *待查明覆盖部位* - #### family_type - **type:** `int` - **accepted values:** `'1', '2'` - **example:** `1` - *1 - horse saddle* - *2 - camel saddle* + **类型:** `int` + **接受值:** `'1', '2'` + **范例:** `1` + *待查明作用* - #### maneuver_bonus - **type:** `int` - **example:** `12` - *Gives a bonus to the maneuverablity for horse* + **类型:** `int` + **范例:** `12` + *不知道是对人还是对马的操作性修正(译者认为是马铠对马的操纵性修正)* - #### speed_bonus - **type:** `int` - **example:** `11` - *Gives a bonus to the speed for horse?* + **类型:** `int` + **范例:** `11` + *不知道是对人还是对马的速度修正(译者认为是马铠对马的速度修正)* - #### charge_bonus - **type:** `int` - **example:** `11` - *Gives a charging bonus for horse* + **类型:** `int` + **范例:** `11` + *不知道是对人还是对马的冲刺修正(译者认为是马铠对马的冲刺修正)* - #### reins_mesh - **type:** `string` - **example:** `horse_harness_vlandia_b_rein` - *Mesh ID of the reins* + **类型:** `string` + **范例:** `horse_harness_vlandia_b_rein` + *缰绳的模型ID* - #### covers_head - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the armour covers the head* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **范例:** `true` + *是否覆盖头部* \ No newline at end of file diff --git a/_xmldocs/Items/Item/ItemComponent/Food/README.md b/_xmldocs/Items/Item/ItemComponent/Food/README.md index 1660418c..de7be656 100644 --- a/_xmldocs/Items/Item/ItemComponent/Food/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Food/README.md @@ -1,15 +1,15 @@ -# Food +# 食物 Food -## Parent Node +## 父节点 Parent Node - [ItemComponent](../../ItemComponent) -## Child Node -- *None* +## 子节点 Child Node +- *无 None* ## attributes -[morale_bonus](#morale_bonus) +[士气加成 morale_bonus](#morale_bonus) - #### morale_bonus - **type:** `int` - **example:** `2` - *Morale bonus the food gives to the party* + **类型:** `int` + **例子:** `2` + *对部队士气的加成* diff --git a/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier/README.md b/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier/README.md index 3cfe1782..8edd9801 100644 --- a/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/MeshMultipliers/MeshMultiplier/README.md @@ -10,10 +10,10 @@ [mesh_multiplier](#mesh_multiplier) | [percentage](#percentage) - #### mesh_multiplier - **type:** `hex` - **example:** `FF303030` + **类型:** `hex` + **例子:** `FF303030` *TODO: figure out what this does* - #### percentage - **type:** `float` - **example:** `0.75` + **类型:** `float` + **例子:** `0.75` *TODO: figure out what this does* \ No newline at end of file diff --git a/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/README.md b/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/README.md index f2f4b923..206ca061 100644 --- a/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Horse/Materials/Material/README.md @@ -10,6 +10,6 @@ [name](#name) - #### name - **type:** `string` - **example:** `horse_brown_mat` + **类型:** `string` + **例子:** `horse_brown_mat` *TODO: figure out what name references* diff --git a/_xmldocs/Items/Item/ItemComponent/Horse/README.md b/_xmldocs/Items/Item/ItemComponent/Horse/README.md index c4ba718c..aebd2219 100644 --- a/_xmldocs/Items/Item/ItemComponent/Horse/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Horse/README.md @@ -1,4 +1,4 @@ -# Horse +# 马匹 Horse ## Parent Node - [ItemComponent](../../ItemComponent) @@ -7,77 +7,75 @@ - [Materials](Materials) ## Attributes -[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) +[生物类型 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) - #### monster - **type:** `string` - **accepted values:** `'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'` - **example:** `Monster.horse` - *Skeleton of the animal* + **类型:** `string` + **接受值:** `'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'` + **例子:** `Monster.horse` + *骑乘的类型,比如马啊骆驼啊之类的* - #### maneuver - **type:** `int` - **example:** `73` - *Maneuverability of an animal* + **类型:** `int` + **例子:** `73` + *操纵性* - #### speed - **type:** `int` - **example:** `73` - *Speed of an animal* + **类型:** `int` + **例子:** `73` + *速度* - #### charge_damage - **type:** `int` - **example:** `73` - *Charge damage of an animal* + **类型:** `int` + **例子:** `73` + *冲撞伤害* - #### body_length - **type:** `int` - **example:** `73` - *Length of the body of an animal* + **类型:** `int` + **例子:** `73` + *身体长度* - #### is_mountable - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `false` - *If an animal can be mounted* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `false` + *能不能骑(骑牛与砍杀)* - #### extra_health - **type:** `int` - **example:** `81` - *Extra health of an animal. Can also be negative* + **类型:** `int` + **例子:** `81` + *额外的生命中?正负皆可* - #### skeleton_scale - **type:** `string` - **accepted values:** `'aserai_horse', 'battania_horse', 'battania_horse' 'empire_horse', 'khuzait_horse', 'sturgia_horse', 'vlandia_horse'` - **example:** `aserai_horse` - *Predefined scales of a skeleton.* - *Accepted values defined in Native\ModulesData\sceleton_scales.xml* + **类型:** `string` + **接受值:** `'aserai_horse', 'battania_horse', 'empire_horse', 'khuzait_horse', 'sturgia_horse', 'vlandia_horse'` + **例子:** `aserai_horse` + *预定义的骨骼缩放比例. 待查明数字是否有效以及定义这些常量的位置* - #### modifier_group - **type:** `string` - **accepted values:** `'cloth_unarmoured', 'leather', 'plate', 'horse', - 'chain', 'cloth'` - **example:** `horse` - *Uses as loot casualities modifier* + **类型:** `string` + **接受值:** `'horse'` + **例子:** `horse` + *不知道干嘛的(译者按:难道和盔甲一样有伤害减免?)* - #### is_pack_animal - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `false` - *Is the animal increase weight capacity* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `false` + *不知道干嘛的s* - #### decorator_key_min - **type:** `hex` - **example:** `0F` - *It seems like unused* + **类型:** `hex` + **例子:** `0F` + *不知道干嘛的* - #### decorator_key_max - **type:** `hex` - **example:** `0F` - *It seems like unused* + **类型:** `hex` + **例子:** `0F` + *不知道干嘛的* - #### mane_mesh - **type:** `id` - **example:** `horse_mane` + **类型:** `id` + **例子:** `horse_mane` *Mesh ID of the manes* \ No newline at end of file diff --git a/_xmldocs/Items/Item/ItemComponent/README.md b/_xmldocs/Items/Item/ItemComponent/README.md index 96381388..0f6b6eca 100644 --- a/_xmldocs/Items/Item/ItemComponent/README.md +++ b/_xmldocs/Items/Item/ItemComponent/README.md @@ -1,11 +1,11 @@ -# ItemComponent -The ItemComponent node has no attributes. +# 物品组件 ItemComponent +没有属性 -## Parent node -- [Item](../../Item) +## 父节点 Parent node +- [物品 Item](../../Item) -## Child nodes -- [Armour](Armor) -- [Food](Food) -- [Horse](Horse) -- [Weapon](Weapon) \ No newline at end of file +## 子节点 Child nodes +- [防具 Armour](Armor) +- [食物 Food](Food) +- [马匹 Horse](Horse) +- [武器 Weapon](Weapon) \ No newline at end of file diff --git a/_xmldocs/Items/Item/ItemComponent/Weapon/README.md b/_xmldocs/Items/Item/ItemComponent/Weapon/README.md index 71a1c00d..61ebf4f3 100644 --- a/_xmldocs/Items/Item/ItemComponent/Weapon/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Weapon/README.md @@ -7,145 +7,145 @@ - [WeaponFlags](WeaponFlags) ## Attributes -[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) +[武器类别 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) - #### weapon_class - **type:** `string` - **accepted values:** `'OneHandedAxe', 'Bow', 'OneHandedSword', 'TwoHandedPolearm', 'Crossbow', 'Stone', 'Arrow', 'Boulder', 'Bolt', 'LargeShield', 'Banner'` - **example:** `OneHandedAxe` - *Type of weapon* + **类型:** `string` + **接受值:** `'OneHandedAxe', 'Bow', 'OneHandedSword', 'TwoHandedPolearm', 'Crossbow', 'Stone', 'Arrow', 'Boulder', 'Bolt', 'LargeShield', 'Banner'` + **例子:** `OneHandedAxe` + *武器的类别* - #### weapon_balance - **type:** `int` - **example:** `100` - *Balance of the weapon* + **类型:** `int` + **例子:** `100` + *武器的平衡* - #### thrust_speed - **type:** `int` - **example:** `12` + **类型:** `int` + **例子:** `12` *Thrust speed of the weapon* - #### speed_rating - **type:** `int` - **example:** `60` - *Speed rating of the weapon* + **类型:** `int` + **例子:** `60` + *武器速度* - #### missile_speed - **type:** `int` - **example:** `60` - *Speed of the projectile being fired from the weapon* + **类型:** `int` + **例子:** `60` + *射出的投射物速度* - #### weapon_length - **type:** `int` - **example:** `60` - *Length of the weapon* + **类型:** `int` + **例子:** `60` + *武器长度* - #### swing_damage - **type:** `int` - **example:** `60` - *Swing damage of the weapon* + **类型:** `int` + **例子:** `60` + *挥砍伤害值* - #### swing_damage_type - **type:** `string` - **accepted values:** `'Pierce', 'Blunt', 'Cut'` - **example:** `Pierce` - *Swing damage type of the weapon* + **类型:** `string` + **接受值:** `'Pierce', 'Blunt', 'Cut'` + **例子:** `Pierce` + *挥砍伤害的类型* - #### item_usage - **type:** `string` - **accepted values:** `'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'` - **example:** `heavy_stone` - *How the item is used* + **类型:** `string` + **接受值:** `'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'` + **例子:** `heavy_stone` + *武器是咋用的* - #### physics_material - **type:** `string` - **accepted values:** `'metal_weapon', 'wood_weapon', 'missile', 'ballista_missile', 'burning_ballista', 'boulder_stone', 'burning_jar', 'wood_shield', 'metal_shield'` - **example:** `metal_shield` - *What the weapon consists of* + **类型:** `string` + **接受值:** `'metal_weapon', 'wood_weapon', 'missile', 'ballista_missile', 'burning_ballista', 'boulder_stone', 'burning_jar', 'wood_shield', 'metal_shield'` + **例子:** `metal_shield` + *武器的材质(诸如铁制盾,铁制武器,木制武器)* - #### ammo_class - **type:** `string` - **accepted values:** `'Arrow', 'Bolt', 'Stone', 'Boulder'` - **example:** `Arrow` - *Ammo type* + **类型:** `string` + **接受值:** `'Arrow', 'Bolt', 'Stone', 'Boulder'` + **例子:** `Arrow` + *弹药类型(箭矢、弩矢等)* - #### ammo_limit - **type:** `int` - **example:** `1` - *Amount of ammo stored in the weapon. If set to 2 game will be closed* - *When enter the battle* + **类型:** `int` + **例子:** `1` + *弹药限制,不知道是'一个弹匣'还是'一次射出'。* + - #### accuracy - **type:** `int` - **example:** `21` - *Accuracy of a ranged weapon* + **类型:** `int` + **例子:** `21` + *远程武器的准确度* - #### thrust_damage - **type:** `int` - **example:** `21` - *Thrust damage of a weapon* + **类型:** `int` + **例子:** `21` + *戳刺伤害* - #### thrust_damage_type - **type:** `string` - **accepted values:** `'Pierce', 'Blunt', 'Cut'` - **example:** `Pierce` - *Thrust damage type of the weapon* + **类型:** `string` + **接受值:** `'Pierce', 'Blunt', 'Cut'` + **例子:** `Pierce` + *戳刺伤害类型* - #### center_of_mass - **type:** `vector3d` - **example:** `0.15,0,0` - *Center of mass of the weapon. Used for calculating damage* + **类型:** `vector3d` + **例子:** `0.15,0,0` + *武器中心位置,不知道干嘛用的* - #### stack_amount - **type:** `int` - **example:** `23` - *Amount of projectiles the weapon (arrows, bolts, stones) has* + **类型:** `int` + **例子:** `23` + *应该是一袋箭有多少支这种* - #### rotation - **type:** `vector3d` - **example:** `100,30,20` - *TODO: figure out what this does* + **类型:** `vector3d` + **例子:** `100,30,20` + *不知道干嘛用的(译者按:可能是飞斧之类扔出后模型的旋转角度向量)* - #### passby_sound_code - **type:** `string` - **example:** `event:/mission/combat/missile/passby` - *What sound a projectile should make if passing by an agent* + **类型:** `string` + **例子:** `event:/mission/combat/missile/passby` + *投射物掠过人物发出的声音* - #### rotation_speed - **type:** `double` - **example:** `0.5` - *TODO: figure out what this does* + **类型:** `double` + **例子:** `0.5` + *不知道干嘛用的(译者按:可能是飞斧之类扔出后模型的旋转速度)* - #### flying_sound_code - **type:** `string` - **example:** `event:/mission/combat/missile/foley/passby` - *What sound a projectile should make when flying in midair* + **类型:** `string` + **例子:** `event:/mission/combat/missile/foley/passby` + *投射物飞行发出的声音* - #### sticking_rotation - **type:** `vector3d` - **example:** `90,0,0` - *TODO: figure out what this does* + **类型:** `vector3d` + **例子:** `90,0,0` + *不知道干嘛用的(译者按:与之前的旋转角度类似,结合下一个属性,可能是击中后模型的旋转角度,飞斧击中盾牌后全都是同一个角度)* - #### sticking_position - **type:** `vector3d` - **example:** `90,0,0` - *TODO: figure out what this does* + **类型:** `vector3d` + **例子:** `90,0,0` + *不知道干嘛用的(译者按:似乎是旋转中心?结合上一个属性,可能是击中后模型的相对位置)* - #### trail_particle_name - **type:** `string` - **example:** `psys_game_missile_flame` - *Particles that are emitted on a flying projectile* + **类型:** `string` + **例子:** `psys_game_missile_flame` + *弹药飞行轨迹的粒子效果* - #### position - **type:** `vector3d` - **example:** `-0.04, -0.05, 0.01` - *TODO: figure out what this does* + **类型:** `vector3d` + **例子:** `-0.04, -0.05, 0.01` + *位置,暂时不知道是啥位置* - #### body_armor - **type:** `int` - **example:** `82` - *The amount of body armour a weapon gives. TODO: figure out if this is possible with head, leg, and hand armour as well.* + **类型:** `int` + **例子:** `82` + *武器提供的躯干护甲值,不知道对于其他部位是否有效* - #### hit_points - **type:** `int` - **example:** `820` - *Hit points of a shield* \ No newline at end of file + **类型:** `int` + **例子:** `820` + *盾的耐久度* \ No newline at end of file diff --git a/_xmldocs/Items/Item/ItemComponent/Weapon/WeaponFlags/README.md b/_xmldocs/Items/Item/ItemComponent/Weapon/WeaponFlags/README.md index 2120cda7..877d9a4a 100644 --- a/_xmldocs/Items/Item/ItemComponent/Weapon/WeaponFlags/README.md +++ b/_xmldocs/Items/Item/ItemComponent/Weapon/WeaponFlags/README.md @@ -10,152 +10,152 @@ [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) - #### MeleeWeapon - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon is a melee weapon* - #### RangedWeapon - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon is a ranged weapon* - #### HasString - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the ranged weapon has a string. Should be set to true for both Bows and Crossbows* - #### StringHeldByHand - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the string is held by hand. Should be set to true with Bows* - #### NotUsableWithOneHand - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon cannot be used in 1 hand* - #### TwoHandIdleOnMount - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *This is set to true with most bows and crossbows. And it's seems like it's unused except TRACE* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *This is set to true with most bows and crossbows. TODO: figure out what this exactly does.* - #### AutoReload - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If set to false an action is required to reload the weapon. (crossbows)* - #### UnloadWhenSheathed - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon should remove any loaded projectile when sheathed* - #### PenaltyWithShield - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon has a damage penalty when using with shield* - #### WideGrip - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *It used to calculate if the non-craft weapon is polearm* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *TODO: figure out what this does* - #### CantReloadOnHorseback - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon can be reloaded on horseback* - #### Consumable - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon can be consumed. Set to true for arrows and throwables.* - #### UseHandAsThrowBase - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the weapon is thrown from the hand* - #### AmmoSticksWhenShot - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *Used in MnB.Mission.CalculateAttachedLocalFrame* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *TODO: figure out what this exactly does* - #### MultiplePenetration - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the projectile can pierce through multiple entities* - #### Burning - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the projectile is on fire. Used when drop item and when siege towe destroyed* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *If the projectile is on fire. TODO: figure out if this also inflicts fire damage, or sets fire to stuff* - #### LeavesTrail - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If the weapon leaves a trail. It seems like it's unused* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *If the weapon leaves a trail. TODO: figure out what this exactly does* - #### CanPenetrateShield - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If the projectile can penetrate a shield* - #### MissileWithPhysics - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *If physics are attached to a projectile. It seems like it's unused* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *If physics are attached to a projectile. TODO: figure out if this is used to damage props as well.* - #### AmmoCanBreakOnBounceBack - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *Used in MnB.Mession.MissileHitCallback* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *TODO: figure out what this exactly does* - #### AffectsArea - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *Used when drop item and siege tower is destroyed* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *TODO: figure out if this is AOE damage?* - #### AmmoBreaksOnBounceBack - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` - *Used in MnB.Mession.MissileHitCallback* + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` + *TODO: figure out what this exactly does* - #### AttachAmmoToVisual - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *TODO: figure out what this exactly does* - #### CanBlockRanged - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If an item can block projectiles (shields)* - #### HasHitPoints - **type:** `boolean` - **accepted values:** `'true', 'false'` - **example:** `true` + **类型:** `boolean` + **接受值:** `'true', 'false'` + **例子:** `true` *If an item has hitpoints (shields)* \ No newline at end of file diff --git a/_xmldocs/Items/Item/README.md b/_xmldocs/Items/Item/README.md index 09e1a1ce..6e0451c7 100644 --- a/_xmldocs/Items/Item/README.md +++ b/_xmldocs/Items/Item/README.md @@ -1,6 +1,6 @@ -# Item +# 物品 Item -## Example Entry +## 例子 Source: Modules/SandBoxCore/ModuleData/spitems.xml ```xml @@ -34,10 +34,10 @@ XMLs with the same id from two separate mods (or the same mod) will have their a - + - + @@ -48,15 +48,14 @@ XMLs with the same id from two separate mods (or the same mod) will have their a - + - + - + ``` - From b205b338ddb209f89cefa508c5943c4565ac0b9e Mon Sep 17 00:00:00 2001 From: eggyhuang <470535194@qq.com> Date: Thu, 14 May 2020 00:32:21 +0800 Subject: [PATCH 2/3] docs: translates csharp-api settlementsAction.md campaignbehaviorbase.md --- .../actions/ChangeOwnerOfSettlementAction.md | 12 +++++----- .../campaignsystem/campaignbehaviorbase.md | 23 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/_csharp-api/campaignsystem/actions/ChangeOwnerOfSettlementAction.md b/_csharp-api/campaignsystem/actions/ChangeOwnerOfSettlementAction.md index 64134748..adfecfec 100644 --- a/_csharp-api/campaignsystem/actions/ChangeOwnerOfSettlementAction.md +++ b/_csharp-api/campaignsystem/actions/ChangeOwnerOfSettlementAction.md @@ -1,15 +1,15 @@ -# ChangeOwnerOfSettlementAction +# ChangeOwnerOfSettlementAction 类 -The function of this class is to set or change the owner of a settlement. +这个类中的函数是用来设置或者更改定居点拥有者的. -## Functions +## 函数 -Here is a list of functions that detail different ways a settlement can change ownership: -- `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 +以下列表罗列了通过不同方法来更改定居点拥有权的函数: +- `ApplyByDefault(`[Hero](../hero.md) `hero, `[Settlement](../settlement.md)`settlement)` - 在开始战役或者玩家启用作弊获取定居点时启用 - `ApplyByKingDecision(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` - `ApplyBySiege(`[Hero](../hero.md)`newOwner, `[Hero](../hero.md)`capturerHero, `[Settlement](../settlement.md)`settlement)` - `ApplyByRevolt(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` - `ApplyByLeaveFaction(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` - `ApplyByBarter(`[Hero](../hero.md)`hero, `[Settlement](../settlement.md)`settlement)` - `ApplyByRemoveFaction(`[Settlement](../settlement.md)`settlement)` -- `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 +- `ApplyByDestroyClan(`[Settlement](../settlement.md)`settlement, `[Hero](../hero.md)`newOwner)` - 定居点的拥有者在死亡后其采邑将随机分封给前任拥有者的子嗣. diff --git a/_csharp-api/campaignsystem/campaignbehaviorbase.md b/_csharp-api/campaignsystem/campaignbehaviorbase.md index d5beae90..3ea17ab7 100644 --- a/_csharp-api/campaignsystem/campaignbehaviorbase.md +++ b/_csharp-api/campaignsystem/campaignbehaviorbase.md @@ -1,9 +1,10 @@ -# CampaignBehaviorBase -This is an abstract class within [TaleWorlds.CampaignSystem](./README.md), and can be inherited to code for unique behaviours within the game's campaign. +# CampaignBehaviorBase 类 -## Abstract Methods: -#### ```public abstract void RegisterEvents()``` -When defining this method, you can introduce consequences to certain events, by use of the `CampaignEvents.On...` methods. A simple example would be: +这是一个抽象类[TaleWorlds.CampaignSystem](./README.md),它可以为战役中的独特行为的代码所继承. + +## 抽象方法: +### ```public abstract void RegisterEvents()``` +定义此方法时,可以用`CampaignEvents.On...`来确定事件的结果.简易范例: ```csharp public override void RegisterEvents() { @@ -14,20 +15,20 @@ public override void RegisterEvents() })); } ``` -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). +上面的范例注册为一个事件,譬如某个家族灭亡时在消息框会宣布此消息. `AddNonSerializedListener`方法调用的第二个变量是一个动作,对于此动作描述[点击这里](https://docs.microsoft.com/en-us/dotnet/api/system.action-1?view=netframework-4.8). -#### ```public abstract void SyncData(IDataStore dataStore)``` -(Work in Progress) +###```public abstract void SyncData(IDataStore dataStore)``` +(译者注:原作者说未完工) -**NOTE**: We are currently not sure what this method does, but at the moment we recommended you implement it as an empty method, like so: +**注意**:这个方法至今我们仍费解,但我们强烈建议直接放上空方法如下: ```csharp public override void SyncData(IDataStore dataStore) { } ``` -## Registering Campaign Behaviors: -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: +## 注册战役行为: +在你的[MBSubModuleBase](../mountandblade/mbsubmodulebase.md)类中,你可以用`OnGameStart`方法来为战役添加行为.以下为示例: ```csharp protected override void OnGameStart(Game game, IGameStarter gameStarter) { From 7285af79f08d698924c49e714ecaefcc4ba0fd7c Mon Sep 17 00:00:00 2001 From: eggyhuang <470535194@qq.com> Date: Thu, 14 May 2020 09:32:42 +0800 Subject: [PATCH 3/3] docs: translates c#api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit actions部分和core部分 --- .../campaignsystem/campaigngamestarter.md | 50 ++++++++----------- _csharp-api/campaignsystem/hero.md | 15 +++--- _csharp-api/campaignsystem/settlement.md | 16 +++--- _csharp-api/core/mbobjectmanager.md | 12 ++--- 4 files changed, 43 insertions(+), 50 deletions(-) diff --git a/_csharp-api/campaignsystem/campaigngamestarter.md b/_csharp-api/campaignsystem/campaigngamestarter.md index 168708dc..6d9b5d78 100644 --- a/_csharp-api/campaignsystem/campaigngamestarter.md +++ b/_csharp-api/campaignsystem/campaigngamestarter.md @@ -1,44 +1,38 @@ -# CampaignGameStarter -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. +# CampaignGameStarter 类 -**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!* +这个类用于给战役来描述行为,对话,菜单和模型,并运行`IGameStarter`接口.这在`OnGameStart`方法中很有用,这里有实例[MBSubModuleBase](mbsubmodulebase.md). -## Accessible Methods: -#### `public void ClearEmptyObjects()` -(Work in progress) +**注意**:*本页还未完工,如果你发现了这方面更多的内容,请提交pull request来完善该文档.* + +##已知方法: +####`public void ClearEmptyObjects()` +(有待完善) #### `public void AddBehavior(CampaignBehaviorBase campaignBehavior)` -Adds the [Campaign Behavior](campaignbehaviorbase.md) to the current campaign. +添加[Campaign Behavior](campaignbehaviorbase.md)到当前战役. #### `public void AddModel(GameModel model)` -Adds the [Game Model](../core/gamemodel.md) to the current campaign. +添加[Game Model](../core/gamemodel.md)到当前战役. #### `public void LoadGameTexts(string xmlPath)` -(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. +(有待完善)在输入路径中加载更多文本描述的XML文件.这些文本都有着*comment_strings.xml*这样的格式,然而当前还不知它们的作用. #### `public void LoadGameMenus(Type typeOfGameMenusCallbacks, string xmlPath)` -(Work in progress) Loads XML file at the inputted path, introducing more menus to the game. +(有待完善)在输入路径中加载更多菜单描述的XML文件. #### `public void AddGameMenu(string menuId, string menuText, OnInitDelegate initDelegate, GameOverlays.MenuOverlayType overlay = GameOverlays.MenuOverlayType.None, GameMenu.MenuFlags menuFlags = GameMenu.MenuFlags.none, object relatedObject = null)` -See [GameMenu](gamemenu.md) for use. +用法参见[GameMenu](gamemenu.md). #### `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)` -(Work in progress) +(有待完善) #### `public void AddGameMenuOption(string menuId, string optionId, string optionText, GameMenuOption.OnConditionDelegate condition, GameMenuOption.OnConsequenceDelegate consequence, bool isLeave = false, int index = -1, bool isRepeatable = false)` -See [GameMenu](gamemenu.md) for use. -## Accessible Attributes: -**NOTE**: *All of these are get/read only* +用法参见[GameMenu](gamemenu.md). + +##已知属性 +**注意**:*所有这些属性只有读取功能* #### `public readonly bool IsTutorial` -Whether or not the campaign starts with a tutorial. +战役开局是否开启教学. #### `public ICollection CampaignBehaviors` -Collection of all registered [Campaign Behaviours](campaignbehaviorbase.md). +所有已注册的战役行为收录[Campaign Behaviours](campaignbehaviorbase.md). #### `public IEnumerable Models` -Enumerable Set of all registered [Game Models](../core/gamemodel.md) +枚举所有已注册的游戏模型[Game Models](../core/gamemodel.md). -## Example Use: -This is used within our [MBSubModuleBase]() class: +##示例应用 +在[MBSubModuleBase]( mbsubmodulebase.md) 类中使用: ```csharp protected override void OnGameStart(Game game, IGameStarter gameStarter) { - if(game.GameType is Campaign) - { - //Current game is a campaign, so IGameStarter object must be CampaignGameStarter - CampaignGameStarter campaignStarter = (CampaignGameStarter) gameStarter; - //Can now use CampaignGameStarter - } -} -``` diff --git a/_csharp-api/campaignsystem/hero.md b/_csharp-api/campaignsystem/hero.md index 9c21f76c..07c99e1d 100644 --- a/_csharp-api/campaignsystem/hero.md +++ b/_csharp-api/campaignsystem/hero.md @@ -1,11 +1,12 @@ -# Hero +hero.md +# Hero 类 -Heroes are all the unique characters in the game. This class contains all the information of these characters and allows you to change them. +在游戏中所有的英雄都是独一无二的.这个类包含了所有这些英雄的信息,同时你也可以在此修改它们, -## Functions -Work in Progress +## 函数 +(有待完善) -## Properties -- `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. +## 属性 -Work in Progress +- `CanHaveRecruits` -这是一个决定英雄是否可以带兵的布尔值.村中家世显赫的人,雇佣兵,绑匪头子,商人,首领等可以带兵.这个属性为可读属性不可更改. +(有待完善) diff --git a/_csharp-api/campaignsystem/settlement.md b/_csharp-api/campaignsystem/settlement.md index d6f87f91..5a0b28ae 100644 --- a/_csharp-api/campaignsystem/settlement.md +++ b/_csharp-api/campaignsystem/settlement.md @@ -1,13 +1,13 @@ -# Settlement +# 定居点 -Settlements are villages, castles, or towns on the campaign map. +定居点是大地图中的那些村子,城堡,及城镇. -## Tips +## 贴士 -* You can get the current settlement with `Settlement.CurrentSettlement` assuming player is in the settlement. +*可以使用`Settlement.CurrentSettlement`让玩家占领当前定居点. -## Functions -Work in Progress +## 函数 +(有待完善) -## Properties -Work in Progress +## 属性 +(有待完善) diff --git a/_csharp-api/core/mbobjectmanager.md b/_csharp-api/core/mbobjectmanager.md index 1401153d..3fc2a8ef 100644 --- a/_csharp-api/core/mbobjectmanager.md +++ b/_csharp-api/core/mbobjectmanager.md @@ -1,10 +1,10 @@ -# MBObjectManager +# MBObjectManager 类 -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. +在给`霸主`做模组中你会频繁使用对象管理器,所以你需要熟练运用它. -The MBObjectManager can be used to get any object in the game that is currently loaded from the XMLs. +MBObjectManager可以用于一切从XML中加载进游戏的对象. -These include: +内容包括: * [BasicCharacterObjects](basiccharacterobject.md) * CharacterAttributes @@ -18,9 +18,7 @@ These include: * SkillObjects * SiegeEngineTypes -Example of getting a [BasicCharacterObject](basiccharacterobject.md): - +获取基本角色对象的例子[BasicCharacterObject](basiccharacterobject.md): ```csharp MBObjectManager.Instance.GetObject("example_troop_id"); ``` -