安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题









In other words, I wanted to know if this mod works for the Dwarves, Empire, Bretonnia, etc.
You can set up as many listeners to listen for events as you want. So if you update the vanilla script you are still just using the same listener since you have only made edits to the function that is called by that listener.
eg if you altered the reward_item_check function to add a unit it does it when that is called. All you have to do to fix compatibility is set up a new script and call your own separate caravancompleted listener and unit adding function, plus a table but you can define that locally within the function too.
If you update the vanilla script (aka datacoring) instead of adding a new script then it will conflict/crash with any other mod who changed it. Mine doesn't technically datacore - what it does do is use a wrapper function, aka I pass the reward_item_check function into a different named function and then I redefine the function to do what I need it to do.
Eg I redefined the reward_item_check so that instead of passing a 20% chance and then choosing 1 out of the 5 items and then checking if the player has the item, instead after the player passes the first 20% chance it works through the remaining items from top to bottom, so that if the player passing the first roll they are guaranteed an item.
So our mods would run together and not crash the game except my function would take priority and overwrite the changes because modded functions are loaded after vanilla functions. Unless you also use a wrapper and then it would crash lol.
For modding compatibility its actually better to do it that way rather than datacoring the main script since you have much better compatibility. You can check my cathay caravan mod to see how you can set it up since I have a very similar function.