SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

0.2.0 - ship import - entity id collisions #44

Closed StellarwhimsRepo closed 10 years ago

StellarwhimsRepo commented 10 years ago

First things first the crash that would occur on import attempt has gone away. however i am not seeing a new instance of the ship when attempting import. also, I was able to successfully move my ship around using the seextender tool position coordinates. =)

there appears to be an exception error when clicking 'new' and then another when attempting to select an sbc file in the file window and clicking 'open'.

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at SEModAPIInternal.API.Entity.Sector.SectorObject.CubeGridEntity.InternalAddCubeGrid() 2014-06-30 19:36:12.491 - Thread: 4 -> Inner Exception: System.ArgumentException: An item with the same key has already been added. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at 5BCAC68007431E61367F5B2CF24E2D6F.F6DF01EE4159339113BB9650DEEE1913.D3D6702587D6336FEE37725E8D2C52CD(Int64 094E467FF825343C63A4502A66537B82) at 5BCAC68007431E61367F5B2CF24E2D6F.F6DF01EE4159339113BB9650DEEE1913.Init(MyObjectBuilder_EntityBase 9065CE2C489147D487A66CF371D3743B) at 5BCAC68007431E61367F5B2CF24E2D6F.98262C3F38A1199E47F2B9338045794C.Init(MyObjectBuilder_EntityBase 9065CE2C489147D487A66CF371D3743B) 2014-06-30 19:36:12.676 - Thread: 4 -> MyGlobalEvents.StartGlobalEvent 2014-06-30 19:36:12.676 - Thread: 4 -> globalEvent.Name = Meteor wave 2014-06-30 19:36:14.529 - Thread: 4 -> GC Memory: 1,009,276,248 B 2014-06-30 19:36:14.760 - Thread: 1 -> Exception occured: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at 5BCAC68007431E61367F5B2CF24E2D6F.E5A0E3F04CC6DEFB7410825523C63704.GetObjectBuilder(Boolean A5DC70F106B952A1255F4B70E35F9DCD) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at SEModAPIInternal.API.BaseInternalWrapper.InvokeEntityMethod(Object gameEntity, String methodName, Object[] parameters) 2014-06-30 19:36:14.760 - Thread: 1 -> Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object. at 5BCAC68007431E61367F5B2CF24E2D6F.E5A0E3F04CC6DEFB7410825523C63704.GetObjectBuilder(Boolean A5DC70F106B952A1255F4B70E35F9DCD) 2014-06-30 19:36:14.760 - Thread: 1 -> System.NullReferenceException: Object reference not set to an instance of an object. at SEModAPIInternal.API.Entity.BaseEntityManagerWrapper.GetAPIEntityList[T,TO](MyObjectBuilderTypeEnum type)

chessmaster42 commented 10 years ago

Technically this isn't a bug but could use some improvement. The issue here is that you are trying to import as ship that already exists in the game world. The error is because the entity id's in the SBC file conflict with the ones already there. The simplest solution would be to clean the SBC file by removing the entity id's. We discovered this last week but didn't do anything yet as the process to handle this automatically is complicated and we don't have enough in place yet.

chessmaster42 commented 10 years ago

Completed in recent pushes as the entity ids are sanitized when the entity is imported. Exported entity files still retain the entity ids.