Sid Meier's Civilization VI

Sid Meier's Civilization VI

25 个评价
文明6-PK UI框架[v1.1]
2
   
奖励
收藏
已收藏
取消收藏
Type: Mod
Mod: Gameplay, UI
文件大小
发表于
更新日期
586.035 KB
1 月 29 日 上午 11:06
2 月 10 日 上午 6:30
5 项改动说明 ( 查看 )

订阅以下载
文明6-PK UI框架[v1.1]

在 皮皮凯(PiPiKai) 的 1 个合集中
CIV-PK UI FW Mods By PPK
4 件物品
描述
如果您觉得这个 mod 有趣,请给我竖起大拇指
内容概述
本mod属于UI框架类mod,不涉及游戏内容的修改。
本mod还有部分功能尚未完成,敬请期待!
当前支持以下功能:
  1. Mod本地数据存储框架
  2. 领袖2D动画框架
  3. 自定义主菜单界面
  4. 游戏前端(FrontEnd)添加新UI功能
  5. 若干lua脚本工具
未经事先许可,请不要集成/借用此 mod 中的代码。

Mod本地数据存储框架详解
  • 此模块允许Mod在玩家电脑上存储数据。例如,mod开发者可以设定跨游戏存档的功能,乃至复刻《文明七》的部分特性。
  • 借助此框架,许多mod的设置数据不必仅限于当前游戏存档,避免每次新建游戏存档时都需要重新配置(当然,这需要mod开发者适配本mod)。
  • Mod数据默认存储在名为‘PKUI_ModData’的配置文件中(PKUI_ModData.Civ6Cfg)。
  • 玩家请注意,不要删除该配置文件,以免造成mod数据丢失。
  • 该存档通常位于路径:C:\Users[你的用户名]\Documents\My Games\Sid Meier's Civilization VI\Saves\Single
  • 如果你希望更改自己的mod数据存储的存档名称,你可以查看mod的MyModDataFileNameX.lua文件
  • 我还写了这个子框架的使用指南 (Githup) [github.com] (Gitee) [gitee.com]
领袖2D动画框架介绍
  • 此模块在《文明6》原有的领袖3D动画基础上,新增了2D动画模式。
  • 提供两种动画模式:图片切换动画和视频动画。
  • 此外,它支持为一个领袖配置多套不同的外交动画,例如,领袖在游戏的古典时期和工业时期可以展现不同的形象。
  • 还允许将领袖的外交背景替换为视频,且一个领袖可拥有多个不同的外交背景。
自定义主菜单功能说明
  • 此模块支持自定义《文明6》的主菜单UI。
  • 主菜单各个UI控件可以自定义显示那些。
  • 还包括背景和音乐的设置。
  • mod开发者仅需通过sql/xml进行配置,即可与其他更改主菜单背景和音乐的mod兼容。
游戏前端添加新UI功能
  • 有过前端UImod开发经验的mod开发者应该明白游戏FrontEndActions是不支持AddUserInterfaces的
  • 仅需在sql/xml中填写相应的数据表,即可在前端加载新增的UI界面。
但需注意,当前尚未实现ReplaceUIScript功能。
为保障Mod兼容性,请各Mod开发者务必在各自UI-lua文件的末尾加入以下代码行:
include( "yourUIluaName_", true )
(注意这里的'yourUIluaName'是你的的UI脚本名称。)
此操作可让其他开发者无需替换原有脚本即可进行兼容性修改,从而在不直接替换脚本的情况下,增强Mod之间的兼容性,间接实现ReplaceUIScript功能。
若干lua脚本工具
  • CalculatorManager.lua 写了一些简单的运算函数
  • CIV6_LibDeflate 实现DEFLATE/zlib格式的数据压缩和解压 (来自Githup) [github.com]
  • CIV6_Serialize 实现lua表的序列化/反序列化 (来自Githup) [github.com]
  • DeBugManager 用来打印lua表的小工具,我主要用来调试自己mod数据情况和逆向游戏luaAPI功能用的
  • PK_MetaTableUtility 提供了很不错的两个lua元表
  • UITimerManager 在文明6实现了可以满足大部分计时器/延迟器需求的lua
Buy me a coffee
[afdian.com]
热门讨论 查看全部(1)
4
2 月 12 日 下午 3:30
PK FW: Dynamic Development(PK框架开发日常)
皮皮凯(PiPiKai)
11 条留言
皮皮凯(PiPiKai)  [作者] 10 月 19 日 下午 6:46 
@Slav'sya Hi there! Thank you for your interest in my mod. I'm glad you like it!

I’ve actually designed this mod with extensibility in mind, so you don’t need to integrate the scripts directly into your own mod. Instead, you can simply use this framework mod as a prerequisite (a "predecessor" or "dependency") and achieve your goals through the provided extension scripts. This way, you can call or modify the functions without having to replace or directly embed my mod files.

If you'd like, we can discuss the specifics further! Feel free to let me know what you're trying to accomplish, and I’ll be happy to help guide you through the extension process.
Slav'sya 10 月 15 日 下午 9:32 
Great work! Could I use your scripts in my mod? It's not the leader scene, but I'd like to play animations via 'specific events', So I guess I'll have to modify the mod to suit my purposes.
Yuki的游戏 2 月 21 日 下午 7:21 
哦,找到了,原来有兼容的另一个mod
Yuki的游戏 2 月 21 日 下午 6:14 
这个mod会顶掉其他的修改主菜单的mod吗,然后顶掉了之后没看见跟原版有什么区别啊
1730726935 2 月 18 日 下午 7:18 
利好订阅了大量mod的玩家:steamthumbsup:
皮皮凯(PiPiKai)  [作者] 2 月 10 日 上午 7:08 
If you're using this mod for the first time, you might encounter an issue where the game gets stuck while loading mod data. In this case, please try restarting the game. I didn't find any error messages in the lua.log file, which is why I didn't notice this issue earlier. I suspect it might be because I nested multiple functions in the Lua code, preventing the error from being reported in time. I'll do my best to fix this issue when I have time in the future.

如果你是第一次使用这个模组,可能会遇到游戏卡在加载模组数据的情况。建议你尝试重新启动游戏。我在检查lua.log文件时没有发现任何报错信息,所以没能及时注意到这个问题。我猜测可能是因为我在Lua代码中嵌套了多个函数,导致错误没有及时报出。后续有空时,我会尽力修复这个问题。
Vidyflan 2 月 3 日 上午 4:08 
虽不明,但觉厉
皮皮凯(PiPiKai)  [作者] 2 月 1 日 下午 1:20 
@Leftbehind, I suggest you join the Discord channel, where there are many tutorials on mod making
leftbehind 2 月 1 日 下午 12:36 
I wasn't aware of that - is there documentation anywhere that explains the features of Civ 6 Lua environment in more detail?
皮皮凯(PiPiKai)  [作者] 2 月 1 日 上午 1:29 
@leftbehind 在Lua编程中,#someTable 仅适用于数组表(array-like tables),而对哈希表(hash-like tables)无效。相比之下,table.count 是《文明6》Lua API 提供的一个通用函数,适用于任意类型的表。因此,在处理哈希表或无法确定表类型的情况下,使用 table.count 是更为准确和可靠的选择。

In Lua programming, #someTable is only applicable to array-like tables (tables with sequential integer keys) and does not work for hash-like tables (tables with key-value pairs). In contrast, table.count is a universal function provided by the Civilization VI Lua API, which is applicable to tables of any type. Therefore, when dealing with hash-like tables or when the table type is uncertain, using table.count is a more accurate and reliable approach.