王国风云2
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问王国风云2百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“故障排除”的源代码
←
故障排除
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|2.7}}[[File:CTD.jpg|frame|right|The CTD... Don't expect Windows to find any solution for you, you'll have to dig !]] '''故障排除'''是指定位游戏崩溃、漏洞或其他问题。一些调试功能在出售给玩家的版本中并不可用,但余下的功能依然足以解决问题。 == 日志文件 == 王国风云2本身在你的游戏文件夹(<code>~\Documents\Paradox Interactive\Crusader Kings II\logs\</code>)记录了大量的日志文件。每次游戏启动时这些文件将被覆盖。 更多的日志记录功能可以用启动参数来打开(通过steam高级启动/定义启动参数): <code>-debug -debugscripts</code> {| class="wikitable sortable" |- ! 文件名 ! 描述 |- | game.log | 游戏内通知和<code>log</code>[[指令]]的输出。从[[patch 2.4.1]]开始,只在<code>-debugscripts</code>启用时记录 |- | setup.log | 游戏数据[[#loading|loading]]日志(GUI、特质、修正等) |- | error.log | 分析和记载错误。启用<code>-debugscripts</code>时记载更多内容。 如果没有发现问题,以下几行应该显示为OK: <pre> [technology.cpp:718]: Missing Tech seed values: [technology.cpp:755]: None. [texturehandler.cpp:181]: Couldn't find texture file: . </pre> |- | historical_setup_errors.log | 额外的关于头衔/角色历史的错误。只在<code>-fullhistoricalsetuplog</code>启用时记录。 |- | system_interface.log | 关于[[interface modding]]的错误 |- | graphics.log | 关于[[map modding]]的错误 |- | system.log | 硬件内容记录 |- | system_interface.log | 界面错误 |- | text.log | 关于[[localization]]键值的错误记录 |- | script_optimizations.log | 关于廷臣触发的事件的错误记录 |- | ai.log | |- | exceptions.log | 如果游戏崩溃,你可能在此得到一份堆栈轨迹,和最后一个被调用的方法(例如:CLandedTitle::GetShortName) |- | time.log | 记载游戏载入时间 |- | memory.log | 记载游戏占用内存 |- |} ==载入== 游戏的加载按照以下顺序: *载入地图 *载入数据库 *载入盾徽 *载入事件 *加载音效 *载入原版历史(即使被MOD覆盖),依旧显示为加载音效(非常耗时的一步) *处理旗帜——从每个tga文件中获得旗帜数据 *加载旗帜 *加载图像 *创建省份 *载入地图(创建地形) *载入地图(创建边境) *载入地图(创建树木) *载入地图(创建纹理) 全部完成以后显示主菜单 ==崩溃== 崩溃,或者说Crash To Desktop (CTD),令玩家失望,也是MOD作者的梦魇。崩溃的原因很难定位。 这里是一些已知的崩溃原因 {| class="wikitable" |- ! 现象 !! 故障排除方法 |- | Instant CTD clicking Play in the launcher | Check no new defines.lua entries are missing in the mod (or better use [[defines]] folder to override, and avoid duplication) |- | CTD at "Loading Databases" | *Compare setup.log with the mod and with raw vanilla : next steps normally logged in vanilla are the likely cause of the crash *Check the format and color indexes of [[Map modding|map files]] (terrain.bmp, ...) |- | CTD at "Loading Events" | * Check for unbalanced quotes, such as ''has_dlc = "Reapers'' * Can be caused by excessively long log commands with multiple references to global variables. |- |CTD at "Loading Graphics * Ensure that your "positions.txt" is not misnamed and that it is empty. |- | CTD when rendering the lobby interface | Check that interface .gui and .gfx files are properly [[Merging guide|merged with vanilla]], if copied in the mod. |- | CTD on applying history (initial load or selecting a bookmark) | Check that all groups in technology history have an entry for earliest starting date of the mod. See [[technology modding]]. |- | CTD on load/resign | *Check that no character has a death date past the end date of the mod. *Check that no character has a birth date later than death date.<ref>In 2.6.3 game is fully playable and crashes only if you load saved game or resign the game</ref> |- | CTD after 1 in-game day | * Check loaded trade routes reference valid provinces. For total conversion mods, use <code>replace_path = "common/trade_routes"</code> or blank vanilla files. |- | CTD after a random elapsed time | It is the worst kind of CTD, because it can be caused by ANY event or decision occurring in the game. *If it slows down before crashing, it might be an infinite loop in an event. Check for a stackoverflow error being reported in exceptions.log. See [[Event modding#Recursive events]] *If it crashes without warning, it may be a [[scripting]] error regarding parameter types that is not safely handled by the engine. Use [[The Validator]] and fix the errors reported, in priority effects used in a wrong context or with wrong parameters. For instance <code>set_graphical_culture = norse</code> vs <code>set_graphical_culture = norsegfx</code> used to CTD. |- | CTD when hovering or clicking an event option | Invalid syntax in the event, or calling a command with an invalid value. |- | CTD when clicking on religion screen | Check that no more than 5 holy sites are defined in landed_titles for that religion |- | CTD when clicking on button to open [[College of Cardinals]] | See [[Interface modding#Papal succession]] |- | CTD when starting typing specific letters in the Title finder | Check that there are no empty geographical regions (at least 1 valid province) |- | CTD when you click the "Arrange Marriage" rings button next to a character's portrait | Check that no character, living or dead, that is conceived illegitimately is missing the required "[[Bastard]]" Trait. The Trait must be placed in each character's Character History entry BEFORE their birth date and WITHOUT being enclosed in brackets. |- |} === 排除错误 === ==== Windows ==== In last resort you can use '''Visual Studio''' (including the free [http://www.visualstudio.com/products/visual-studio-express-vs Express editions]; get the "Windows Desktop" one) to see detailed debugging information. Though it won't let you debug step by step, as the sources for the game are not available. Simply start the game, then use the ''Debug > Attach to process...'' menu option. Use the Output window to read the game's messages, which will include script validation errors and performance data. For best results create an empty project and configure it to launch CK2.exe with your mod active (i.e. with the argument <code>-mod=mod/foo.mod</code>); check the documentation for details on how to do this. You will then be able to launch the game with debugging by clicking the green Play button in Visual Studio. This will ensure that you capture any problems that show up right after the game starts. When the game crashes Visual Studio will freeze it, tell you where the offset at which crash happened, and provide the option to save a "minidump". The offset and dump won't mean much to you but if you want to report the crash to Paradox they would find both useful. ==== macOS ==== Install Xcode from the App Store, then run <code>xcode-select --install</code> in a Terminal window. Launch the game from lldb: <pre> cd ~/Library/Application\ Support/Steam/SteamApps/common/Crusader\ Kings\ II lldb ck2.app/Contents/MacOS/ck2 r -- -debug -debugscripts </pre> If the game crashes, it will be paused in the debugger, letting you use the <code>bt</code> command to get a [https://en.wikipedia.org/wiki/Stack_trace stack trace]. Most other debugger features are unavailable without source code. Meanwhile, use [https://en.wikipedia.org/wiki/Tail_(Unix) tail] in separate terminal tabs to monitor the game's own logs: <pre> tail -F ~/Documents/Paradox\ Interactive/Crusader\ Kings\ II/logs/game.log tail -F ~/Documents/Paradox\ Interactive/Crusader\ Kings\ II/logs/error.log </pre> ==漏洞== 由于你可以在漏洞发生后继续看到游戏内文本,漏洞通常比崩溃容易定位。 大多数不影响功能的漏洞可以通过[[The Validator]],一个第三方的用于检测脚本文件的工具来确定。 {| class="wikitable" |- ! 现象 !! 故障排除方法 |- | 空白的事件弹出窗口,强制暂停游戏且无法被关闭 | *窗口弹出后保存游戏(无需检查压缩存档选框),然后在存档中查找错误事件的ID。它们会出现在文件的最后,<code>player_event</code>一节 *Use [[The Validator]], check for Parse failures, or invalid node type errors. |- | Scripting keywords appearing in decisions/councillor names | *Use [[The Validator]], check for parse errors, missing curly braces |- | Decision not appearing | *Move conditions from potential to allow block, to see failing conditions in tooltip. |- | Decision not having any effect when taken | *Use [[The Validator]], check for duplicate decision IDs |- | Truncated localization | *Open .csv file with [[Localisation#OpenOffice Calc|OpenOffice]] and check for extra columns containing text *Make sure translations do not contain semi-colon character, as it used separate languages |- | Localization not appearing in game | *Ensure file extension is .csv, not .txt *Check that mod folder is named ''localisation'', not ''localization''. *Ensure overridden vanilla keys are loaded before vanilla (i.e. 00_ file prefix) |- | Localized names show strange characters (Ã) | *Check encoding of landed_titles, culture, and localization files to be Windows 1252 (ANSI), and not any type of Unicode. |- | Events not triggering (but OK via console testevent) | *Check for invisible non-breakable spaces in event files (they can be found with Notepad++ by searching with "Extended mode" the Unicode string \u00A0) |- | Titles have wrong flags | *Clean the flag cache in ~\Documents\Paradox Interactive\Crusader Kings II\(Mod user_dir)\gfx\flags *Make sure all titles above barony have a corresponding flag in gfx/flags (with [[The Validator]]) *Try to see at which title it starts messing up, that's usually where you're missing the flag. |- | Black coats of arms | *Verify the pattern file size in [[Coats of arms.txt]] *Ensure all religion match a CoA group |- | Missing layers in portraits for custom ethnicities | *See [[Portrait modding#Custom ethnicities referencing DLC assets]] |- | Casus Belli immediately ends inconclusively | *Make sure can_use/can_use_title/is_valid_title blocks are in synch. |- | All units models use wrong gfx | *Check that no province history files reference a barony that is not defined in landed_titles (with [[The Validator]]) |- |Rivers are flowing from east to west on the map | * Rivers flowing east to west typically means that there is something wrong with the color index of rivers.bmp. <ref>[https://forum.paradoxplaza.com/forum/index.php?threads/map-mod-testing.588084/page-96]</ref> |- | Title is badly displayed on the map (not visible or way outside its area) | * Check for stray pixels in provinces.bmp |- | Popups like naming children not showing up | * When using <code>replace_path = "events"</code>, the following script needs to be added in the mod events folder: <pre> # ID 1 and 2 are empty dummy events that are used by the message system to spawn messages # that should be displayed as events, their descriptions are filled in by the message system letter_event = { id = 1 is_triggered_only = yes desc = "A" } character_event = { id = 2 is_triggered_only = yes desc = "B" } </pre> |- |} ==测试== 包括检测你的MOD是否会导致崩溃、有无漏洞、无效功能或者游戏体验/平衡性问题。 测试工具包括: *[[控制台指令]],提供许多用于调试的功能(或者作弊功能...),尤其是 <code>play</code>、<code>testevent</code>和<code>event</code>。注意部分以debug_开头的命令在上市版本中不可用。 *作弊MOD,简化控制台指令操作或实现控制台没有的功能。 *观察者模式(控制台指令<code>observe</code>),测试游戏平衡和在长期游戏中检测随机崩溃。 ==参考资料== <references/> {{ModdingNavbox}} [[Category:Modding]]
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:ModdingNavbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
故障排除
。
×
登录
密码
记住登录
加入王国风云2百科
忘记密码?
其他方式登录