AtomicTorch Studio Forums

VoidExpanse => Help section => Topic started by: loudent on April 21, 2015, 06:04:50 PM

Title: Creating an empty space crate
Post by: loudent on April 21, 2015, 06:04:50 PM
Hey All,

I'm trying to create an empty crate in space but the generator.AddContainer() requires a droplist xml as an argument. I've tried creating an xml with no items in the list but that gives me more errors.

Is there a way to create a crate in space without any contents?

I guess worst case scenario is I could delete the contents of the create first but I figured I'd check before I went that route.
Title: Re: Creating an empty space crate
Post by: ai_enabled on April 21, 2015, 11:15:11 PM
Hi!
Yes, you can use this function for spawning an empty crate container. It will return the container ID.
You can give null for dropListID variable for this function.
Regards!
Title: Re: Creating an empty space crate
Post by: loudent on April 21, 2015, 11:28:18 PM
Thank you very much
Title: Re: Creating an empty space crate
Post by: loudent on April 22, 2015, 12:29:27 AM
Actually, if I pass null for the drop list I get the following error:

22.4.15 00:28:31.0224 [ERR] Script invocation exception: script "data/scripts/global/ldt_jettisoncargo.js"
Exception System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   -------------------------stack-------------------------
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at AtomicTorch.SpaceRPG.Server.Scripting.GlobalScopes.ScopeGenerator.AddContainer(Int32 systemId, Double coord_x, Double coord_y, String typeID, String dropListID, Object tags)
   at binder_for_AtomicTorch.SpaceRPG.Server.Scripting.GlobalScopes.ScopeGenerator.AddContainer(ScriptEngine , Object , Object[] )
   at Jurassic.Compiler.Binder.Call(ScriptEngine engine, Object thisObject, Object[] arguments)
   at Jurassic.Library.ClrFunction.CallLateBound(Object thisObject, Object[] arguments)
   at Jurassic.Library.FunctionInstance.CallWithStackTrace(String path, String function, Int32 line, Object thisObject, Object[] argumentValues)
   at LDTOnShipDestroyedHandler(ScriptEngine , Scope , Object , FunctionInstance , Object[] )
   at Jurassic.Library.UserDefinedFunction.CallLateBound(Object thisObject, Object[] argumentValues)
   at Jurassic.ScriptEngine.CallGlobalFunction(String functionName, Object[] argumentValues)
   at fOjZMNuuN0lHLFXgsOw.eWvU7yujosPi3g8qJRo.dDXuMhBoIb(String  , Object  )
22.4.15 00:28:31.0263 [IMP] Ship Loudent will be respawned at SystemID=43
22.4.15 00:28:31.0273 [ERR] Unhandled exception in Server game loop
Exception System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   -------------------------stack-------------------------
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at jvMuEfWa4dI5JoCFn5h.qLinMVWiyGcCwUBomHI.LNLpgxUlx9(Double  )
   at vxVLwDhWYiEysuRM7sN.ml7y5YhuRUkrQAmipFF.<>c__DisplayClassc.<ServerTick>b__2()
   at yh4Zn3002uxc4RoZtM8.gAxJV70qX9ONgNlNcs7`1.FnFGVddIss(Func`1 function, Func`1 shouldAbortCheckFunction)
   at vxVLwDhWYiEysuRM7sN.ml7y5YhuRUkrQAmipFF.lPDtIYPk3R(Double  )
   at vxVLwDhWYiEysuRM7sN.ml7y5YhuRUkrQAmipFF.EaltAtbg4x()
Title: Re: Creating an empty space crate
Post by: ai_enabled on April 22, 2015, 12:52:39 AM
Sorry for that, I've found a bug with this function, a small mistype ruining it... :-( Will be fixed in the next build.
As a workaround, please create a new droplist xml ("droplist_empty.xml") with the content:


<?xml version="1.0" encoding="utf-8"?>

<root>
<header>
<id>droplist_empty</id>
</header>

<data>
<!-- empty list -->
<list>
<type>2</type>
<elements></elements>
</list>
</data>
</root>


Place it at the "data/itemslist" folder and then you can invoke function generator.AddContainer() with the "droplist_empty" argument. It should spawn an empty crate container.

Regards!
Title: Re: Creating an empty space crate
Post by: loudent on April 22, 2015, 12:55:48 AM
Will do, thanks.

-Loudent
Title: Re: Creating an empty space crate
Post by: loudent on April 22, 2015, 01:17:13 AM
Seems to be working :)