question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot support multi-dimension arrays: GameStudio crash

See original GitHub issue

Release Type: GitHub

Version: v3.1

Platform(s): Windows 10 x64

Describe the bug Trying to use a script with a 3 dimension array as a public member crashes GameStudio. Might even crash on an array of size 2.

To Reproduce Steps to reproduce the behavior:

  1. Make a script with a public (custom class?) variable with 2+ dimensions
  2. Try and attach that script to an Entity in GameStudio

Log and callstacks Exception: ArgumentException: Cannot support dimension [3] for type [GentrieveX.Scripts.WorldGen.ROOM_CELL_TYPE[,]]. Only supporting dimension of 1 at Xenko.Core.Reflection.ArrayDescriptor…ctor(ITypeDescriptorFactory factory, Type type, Boolean emitDefaultValues, IMemberNamingConvention namingConvention) at Xenko.Core.Reflection.TypeDescriptorFactory.Create(Type type) at Xenko.Core.Reflection.TypeDescriptorFactory.Find(Type type) at Xenko.Core.Reflection.ObjectDescriptor.<PrepareMembers>b__45_4(FieldInfo fieldInfo) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Xenko.Core.Reflection.ObjectDescriptor.PrepareMembers() at Xenko.Core.Reflection.ObjectDescriptor.Initialize(IComparer1 keyComparer) at Xenko.Core.Reflection.TypeDescriptorFactory.Find(Type type) at Xenko.Core.Reflection.ObjectDescriptor.<PrepareMembers>b__45_4(FieldInfo fieldInfo) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Xenko.Core.Reflection.ObjectDescriptor.PrepareMembers() at Xenko.Core.Reflection.ObjectDescriptor.Initialize(IComparer1 keyComparer) at Xenko.Core.Reflection.TypeDescriptorFactory.Find(Type type) at Xenko.Core.Reflection.ObjectDescriptor.<PrepareMembers>b__45_4(FieldInfo fieldInfo) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Xenko.Core.Reflection.ObjectDescriptor.PrepareMembers() at Xenko.Core.Reflection.ObjectDescriptor.Initialize(IComparer`1 keyComparer) at Xenko.Core.Reflection.TypeDescriptorFactory.Find(Type type) at Xenko.Core.Reflection.DataVisitorBase.VisitCollection(IEnumerable collection, CollectionDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitCollection(IEnumerable collection, CollectionDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitObject(Object obj, ObjectDescriptor descriptor, Boolean visitMembers) at Xenko.Core.Reflection.DataVisitorBase.Visit(Object obj, ITypeDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitObjectMember(Object container, ObjectDescriptor containerDescriptor, IMemberDescriptor member, Object value) at Xenko.Core.Reflection.DataVisitorBase.VisitObject(Object obj, ObjectDescriptor descriptor, Boolean visitMembers) at Xenko.Core.Assets.CollectionIdGenerator.VisitObject(Object obj, ObjectDescriptor descriptor, Boolean visitMembers) at Xenko.Core.Reflection.DataVisitorBase.Visit(Object obj, ITypeDescriptor descriptor) at Xenko.Core.Reflection.DataVisitorBase.VisitCollection(IEnumerable collection, CollectionDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitCollection(IEnumerable collection, CollectionDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitObject(Object obj, ObjectDescriptor descriptor, Boolean visitMembers) at Xenko.Core.Reflection.DataVisitorBase.Visit(Object obj, ITypeDescriptor descriptor) at Xenko.Core.Assets.CollectionIdGenerator.VisitObjectMember(Object container, ObjectDescriptor containerDescriptor, IMemberDescriptor mem

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
phr00tcommented, Apr 8, 2019

I don’t care for them to be supported, I just don’t want GameStudio to crash if it comes across one. Just skipping over that value in the inspector would work for me.

The callstack shows the specific type of array that caused the problem for me: [,]

0reactions
dfkeenancommented, Oct 19, 2019

I don’t think putting a try/catch around it and returning null is the best option. It is possible to check if it is a multi-dimension array by using type.GetArrayRank() != 1. There are also quite a few spots that would cause a NullReferenceException if ITypeDescriptorFactory.Find returned null. Not sure why you didn’t get that problem though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

array help problem
In my game I made arrays for achievements to store its information then I put all of those into an array. in a...
Read more >
"Multi-dimensional arrays are not supported" error when ...
Wherever I try try to add my own object to the user settings the app falls over. The Game class is fairly simple,...
Read more >
Nested Array crashing - Ask
I read somewhere that unreal does not support nested arrays but i can not find an official explanation. Does someone knows it for...
Read more >
Two-Dimensional assignment help. I can't wrap my head ...
Now it's getting close to the deadline and I'm starting to panic which is just making me more confused as I try to...
Read more >
Why do I find multidimensional arrays hard to use?
In a 2d array: (length of each row * row number) + (current column position). It returns a conversion from x,y coordinates to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found