Space Engineers

Space Engineers

评价数不足
[Experimental] Fix OnAddedToScene()
   
奖励
收藏
已收藏
取消收藏
Type: Mod
Mod category: Script, Other
文件大小
发表于
4.035 KB
2024 年 11 月 6 日 上午 8:16
1 项改动说明 ( 查看 )

订阅以下载
[Experimental] Fix OnAddedToScene()

描述
A very niche and experimental fix for mods that break from other mods adding gamelogic components on the same block type.

Experimental
Briefly tested with Defense Shields + my LCD support mod to confirm that the shield table has detailed info.
However I don't use Defense Shields to know what new things this breaks or what it doesn't fix, hence being tagged experimental. Please test and let me know if you find problems.

The problem
This is a game bug[support.keenswh.com] but it's also fixable by the mod that breaks by not using OnAddedToScene() in the first place... or by hooking AddedToScene from MyCubeBlock to trigger it manually (and remove the override method to avoid duplicates).

How the fix works
This mod hooks AddedToScene and RemovedFromScene events from any block that has MyCompositeGameLogicComponent and in those events it will call OnAddedToScene() and OnRemovedFromScene() respectively on all components inside the composite component.

My Fix LCD support is one that can cause this because it adds gamelogic for all subtypes, however the mod cannot function with workarounds to not use gamelogic, and trust me I tried (before releasing it).

Known mods that suffer from this bug (and easiest to cause the bug is with my Fix LCD mod above):
- Defense Shields
- 2cm Beam System (or the industrial fix)
1 条留言
Gothicjawa 2024 年 11 月 7 日 下午 3:13 
One of the thing that broke was the shield defence modulator, and not allowing entities to pass through the shields while they were up even though the option was enabled, just tested in a creative world, and it seems to have fixed that issue. I stress seems, need more testing.