Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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.