midspace / Space-Engineers-Admin-script-mod

Modding script for Space Engineers with dozens of Admin commands for creating game scenarios or supporting servers.
44 stars 13 forks source link

entity type script logic collision #140

Open midspace opened 8 years ago

midspace commented 8 years ago

The log is indicating an issue with the an Entity Type collision with an implementation of MyGameLogicComponent. Specifically it is the MyObjectBuilder_CubeGrid, and it's conflicting with Deadly Reentry + SE Atmospheric Drag.

There is a work around, which I need to investigate. https://github.com/KeenSoftwareHouse/SpaceEngineers/pull/142

2016-01-05 21:23:08.313 - Thread:   1 ->  MyScriptManager.LoadData() - START
2016-01-05 21:23:11.628 - Thread:   1 ->     mod_warning: 316190120.sbm_midspace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.628 - Thread:   1 ->       in file: 316190120.sbm_midspace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.628 - Thread:   1 ->       Possible entity type script logic collision
2016-01-05 21:23:11.650 - Thread:   1 ->     Registered modules from: 571920453, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.651 - Thread:   1 ->     Script loaded: 571920453, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.652 - Thread:   1 ->     Registered modules from: 316190120.sbm_midspace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.653 - Thread:   1 ->     Script loaded: 316190120.sbm_midspace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
2016-01-05 21:23:11.653 - Thread:   1 ->  MyScriptManager.LoadData() - END
midspace commented 8 years ago

We have 4 classes that inherit from MyGameLogicComponent

After some basic testing, it doesn't appear as simple as adding a subtypename after the Type. [MyEntityComponentDescriptor(typeof(MyObjectBuilder_CubeGrid), "ProtectedCubeGrid")]

Spcemarine commented 8 years ago

Found this: http://forums.keenswh.com/threads/solved-2-or-more-mods-attaching-scripts-to-the-same-object-type.7314100/

Still I'm a little confused: Is there an actual conflict? So are there things that really are not working or is it just the warning? As far as I understand it, it's just the hint that there might be some weird behavior because the scripts could work contrarily.

midspace commented 8 years ago

I was going to do more testing when I got ahold of the 1.116 update and sidelined this.

I didn't get any impressions from the Git source that conflicts had been fixed when using the same subtype name as another mod, or if both mods don't use a subtype name.

The thread you linked does mention that it is fixed. But if that's the case, then why is there still a warning message in the log file?

I was planning to run some simple mods, simulating the issue directly to look at it. If the warning message is obsolete, then I'm pushing this back to Keen to fix.

Spcemarine commented 8 years ago

Ok, I'm not too sure myself but I'd interpret logic collision in a way that it can be caused by the stuff the modders coded. E.g. if one mod accelerates and the other one breaks at the same condition... Might be a bad example but I hope you get what I mean. That'd explain why there is a warning.

midspace commented 8 years ago

Previously, their logic collision was because when you implemented the below code in a mod, it could only ever be implemented once. If you tried to implement it twice, or implement it in a second mod, only one of them would work. Usually the first one worked, because it registered itself first. The second mod that implemented the code would not work.

[MyEntityComponentDescriptor(typeof(MyObjectBuilder_CubeGrid))]
    public class ProtectedCubeGrid : MyGameLogicComponent
    {