欢迎访问欧陆风云4百科!注册一个账号,一起参与编写吧!这里是当前的工程

2019年10月服务器费用已由站长支付,若您想帮助我们可以点这里!欢迎所有对百科感兴趣的同学加入QQ群:602439518

本页面讲述的内容长期有效

“Mod troubleshooting”的版本间的差异

来自欧陆风云4百科
跳转至: 导航搜索
(文本替换 - 替换“[[Category:改派教程”为“[[Category:模组制作”)
崩溃
 
(未显示同一用户的1个中间版本)
第75行: 第75行:
 
! width="60%" | Fix
 
! width="60%" | Fix
 
|-
 
|-
|During "Loading Databases"
+
| " 读取数据库" (Loading Database)
 
|If you are using the ''defines.lua'', check you have included all the entries that vanilla includes.
 
|If you are using the ''defines.lua'', check you have included all the entries that vanilla includes.
 
Check that there are no references to non-existing files.
 
Check that there are no references to non-existing files.

2019年10月11日 (五) 23:28的最新版本

排除故障是mod开发中重要的一部分,包括对崩溃、bug和其他问题的排除。

概述

有两种错误——致命性错误与非致命性的。

致命性错误发生于游戏无法加载一个关键数据,并且在缺乏此数据时就无法运行的情况下。这会导致闪退(Crash To Desktop)。当致命性错误发生时,文件exceptions.log将会增添一行记录. 通常它们会发生于游戏加载过程中,或者进行某项特定操作时。

非致命性错误发生于游戏在运行时遭遇到了无效数据或者错误的语法。这些错误被记录于error.log.。

测试

在Debug流程中可以使用如下的控制台代码:event, observe and run.。

The run command is very useful for testing effects without having to reload the game. It also makes it very easy to setup test scenarios without introducing wayward code within the mod itself.

The observe is useful when you want to test the stability of your mod during gameplay. By becoming an observer, you can let the game run without your input, making it easier to detect issues that occur irregularly.

加载

在加载游戏时会先后进入以下过程,这些描述出现于加载界面顶端。

Step
Loading Databases
Initializing Maplogic
Loading Databases...
Loading History Files...
Loading Sounds...
Loading Events...
Loading GUI Definitions...
Loads Flags...
Creating Checksum...
Loading Graphics...
Creating Province #
加载地图 (Creating Shaders)...
加载地图 (Creating Terrain)...
加载地图 (Creating Borders)...
加载地图 (Creating Straits)...
加载地图 (Creating Textures)...
加载地图 (Creating Trees)...
加载地图 (Creating Rivers)...
加载地图 (Creating objects)...
Initializing Game...

Log 文件

游戏将各种日志文件存储在您的eu4用户文件夹中:(\\documents\paradox interactive\europa universalis iv\logs\.)。每次游戏开始时都会覆盖这些内容。 要启用完整的错误日志记录,请通过STEAM中的“设置启动选项”添加-debug->launch命令。 class=“wikitable sortable”width=“100%” !width=“20%”文件 !width=“60%”说明 !width=“20%”有用性 - |人工智能日志 |打印玩家的国家选择,然后打印“起始人工智能”行。 低 - |错误.log |打印各种非致命错误。许多错误可以忽略,尽管几乎所有与“公用”文件夹中的文件相关的错误都应该修复。 高 - |错误日志 |上一次游戏发布的“错误日志”。 低 - |错误日志 |上一个游戏第二次发布的“error.log”。 低 - |异常.log |当游戏死机到桌面时打印stacktrace。目前只打印十六进制地址,使得这个文件相当无用。 低 - | executedcommands.log文件 |打印播放器和人工智能使用的内部命令。 低 - |游戏日志 |打印游戏中国家采取的行动。当碰撞是由特定动作引起时,此功能非常有用。 高 - |图形.log |打印与位置相关的图形错误。 低 - |本地温度日志 γ 低 - |内存.log |打印安装过程中使用的内存。用于加载过程中的崩溃,以查看游戏何时崩溃。 高 - |消息.log |打印当前会话的会话信息。 低 - |分析.log |如果使用profileing.exe文件,则打印分析输出。 高 - |随机.log γ 低 - |随机02.log γ 低 - |接收到的数据命令.log |打印玩家在多人游戏中接收到的内部命令。 低 - | sentcommands.log文件 |打印玩家在多人游戏中发送的内部命令。 低 - |安装日志 |打印流程每个部分的安装加载完成。对于发现哪个文件可能导致崩溃非常有用。 高 - |安装程序\u error.log |在路径公共/国家/地区文件中打印错误。通常错误的重要性很低。 低 - |系统日志 |打印加载了EU4的系统信息。 低 - |系统接口日志 |打印接口错误。 低 - |文本.log |打印本地化密钥上的断言。 低 - |时间日志 |打印完成各种加载步骤所需的时间以及勾选间隔。对于加载过程中的崩溃非常有用,可以查看游戏何时崩溃。 高 }

除错

通常,在调试时,您希望缩小崩溃的可能原因。这就是为什么每次修改后最好运行mod,所以任何问题都会立即显现出来,并且您可以很容易地找到原因,因为它将是您编辑的最后一个文件。 如果这是不可能的,那么您需要隔离潜在的原因。这是通过将可疑文件和文件夹从mod文件夹移到一个临时文件夹中,然后在没有这些文件和文件夹的情况下启动mod来完成的。这需要对每个文件如何一起工作有很好的了解,因此您可以安全地隔离文件和文件夹,而不引入断开的依赖关系。 通常,您可以轻松地隔离事件、决策、任务和界面文件夹,而不必太担心。然后在公用文件夹中,逐个删除文件或文件夹,每次重新启动游戏以确定是哪个导致了问题。如果没有,则问题可能在历史记录或地图文件夹中。在整个过程中重复这个过程。

崩溃

Most fatal errors that cause crashes to desktop can be very difficult to debug without extensive knowledge of modding. The following list is of known crashes to help modders debug:

Crash Fix
当 "读取数据库" (Loading Database) If you are using the defines.lua, check you have included all the entries that vanilla includes.

Check that there are no references to non-existing files.

  • A tag in country_tags must not reference a file that does not exist.
During "Initializing Maplogic" Check that the gamelogic map images have been saved in the correct formats. Make sure the map files used follows the guidelines listed in Map modding.
  • default.map province limit isn't higher than the last province ID in definition.csv.
  • A province ID in default.map no longer exists in the definition.csv.
  • A province ID in adjacencies.txt no longer exists in the definition.csv.
  • A province ID in area.txt no longer exists in the definition.csv.
  • A province ID in climate.txt no longer exists in the definition.csv.
  • A province ID in continent.txt no longer exists in the definition.csv.
  • A province ID in terrain.txt no longer exists in the definition.csv.
  • A province ID in trade_winds.txt no longer exists in the definition.csv.
  • A province ID in area.txt no longer exists in the definition.csv.
  • terrain.bmp has a missing or corrupted color table.
  • rivers.bmp has a missing or corrupted color table.
  • trees.bmp has a missing or corrupted color table.
  • Map dimensions are not a product of 128.
  • The provinces.bmp exceeds 52 megabytes.
  • The provinces.bmp contains provinces that are too large.
During "Loading History Files..." Check that the history files do not reference any missing country tags or provinces IDs.
During "Loads Flags..." Check that the history files do not reference any missing country tags (specifically the diplomacy folder).
During "Loading Graphics..." Check that the graphical map images have been saved in the correct formats. Make sure the map files used follows the guidelines listed in Map modding.
During "加载地图 (Creating Straits)..." Check that the adjacencies.txt file lists valid straits.
Clicking Play in the lobby The issue can lie within the common files:
  • Missing entries in required files such as static_modifiers
  • Missing entries for modifiers used in effects or triggers.

History files:

  • A country capital defined in history/countries references a province id that has no pixels in map/provinces.bmp.
Clicking a Province * Make sure the province belongs to a continent in continent.txt.
  • Make sure the province belongs to an area in area.txt.
Nation Designer Government Tab when using more than 3 Government Ranks The nationadesignerview.gui file needs to be edited to have additional icon_gov_desc_* and gov_desc_* for each new level of government rank.
Crash on Hover in an Interface Typically caused by a clause missing from the relevant files, i.e. the army professionalism static modifiers when hovering over the Hire General button.
Trying to Move a Capital Often caused by missing or misnumbered provinces in continent.txt.


This process will almost always allow you to discover the cause of a crash, although it is tedious.