The Gathering : Core Object 1.2.2

If you liked this item, please rate it up on Steam Workshop page.

Author: Inter-object

Last revision: 6 Jun, 2021 at 17:12 UTC (3)

File size: 505.86 KB

On Steam Workshop

Description:
  • Modified the core object of the TW:TK script to make the game run more reliably
  • 삼탈워 엔진의 코어 오브젝트를 개조하여 게임이 더 안정적으로 돌아갈 수 있도록합니다
  • 修改了TW:TK脚本的核心对象,以使游戏运行更可靠

In TW:3K, events are like the heartbeat of a game. The core object is a component that receives, processes, and delivers events from TW:3K engine.

That core object has modified in this mod.

If components A, B, C, and D wait for one event, the core calls the event handlers A, B, C, D sequentially. If an error occurs in the event handler of one of the handler calls, the core must handle the error and call the remaining handlers. However, TW:3K’s script engine core stops functioning when an error occurs, and the rest of the handlers do not receive events.

In technical terms, TW:TK does not do the event exception handling.

>> TW:TK 1.7.0, CA implemented exception handling partially. <<

[TheGathering : Core Object] do the event exception handling.

The most registered event inside TW:3K is the "Faction Turn Start" event, with as many as 40 TW:3K script components waiting. If an error occurs in one handler and subsequent handlers do not receive the event, the data inside the game will be twisted.

TW:TK mod script loading is also done in the core, but exception handling is not performed similar to event handling. Starting with "Mandate of Heaven" DLC, an error occurs when loading multiple mod scripts and loading Lua scripts in subdirectories.
I modified the core-object in this mod so that Lua scripts in multiple/subdirectories are loaded naturally, only the mod with errors fails, and other mod scripts are loaded normally.

This mod handles all event exceptions, but has no impact on game performance.

  1. Modify the core object to handle exceptions so that the event chain is not broken.
  2. Modified the event addition function of the core object to prevent confusion in which duplicate events are registered.
  3. Also executes exception handling of timer event of TW:3K engine.
  4. Mod script loading function of core object is modified so that only the mod with error is not loaded.
  5. By outputting the occurred errors to "$(game)/lua_mod_log.txt", the modders can check the event processing error without having to include "/script/all_script.lua"
  6. Game users can easily check the script errors of mods in "lua_mod_log.txt" when there is a problem with the game.

I wrote a mod loading script to fix the CA mod loading script error that started from the "Heavenly Command" DLC. Some mods like ‘WU’ ,’NGC’ and ‘All Faction’ have used the Sandbox mod load script for months without permission.
This mod should be above the mods that have "/script/_lib/lib_mod_loader.lua".

  • Placing this mod at the top of the mod list is recommended
  • This mod is compatible with all mods
  • You can turn on & off this mod at any time.

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.