A scene with some custom data types and the inspector

KequcKequc Posts: 138Member

I'm making a base building game. I'm trying to design a system where you choose something to build, like a vase or a tv or so on, then place it on the map. I'll call these items 'Features' for the rest of this post.

Ideally I'd like to have a scene with a simple script on it, where attributes of the feature I'm placing in my base are configurable in the inspector. Then I could quickly create quite a few different scenes representing things I can build. But I can't seem to get the inspector to deal with any custom data types.

Do I need to create inspector plugins? I'm open to whatever approach is best. Should I do this differently entirely. Maybe I could have a feature data class and assign that as a resource? Should each of the features have a separate script even if many of them will share the same fields?

I'm not sure how to do what I want to do.

For example regarding custom data types, my game is tile based so I use some custom generic types like Point3D which contains only xyz ints. Each feature contains an array defining it's form. So this array contains dictionaries defining a type like "impassible" or "access_point" along with a Point3D, so that the code knows how much space the feature is taking up and what it's shaped like.

A single tile vase might just be:

[{ tile_type: IMPASSIBLE, point: Point3D.new(0, 0, 0) }]

I can't seem to get this data to show up in the inspector and I can't seem to figure out an easy way to define a whole bunch of these things in code. I really hope I was able to communicate what I'm doing.

Thank you for reading.

Tags :


  • KequcKequc Posts: 138Member

    Oh, whatever.

    I'll just export a string and I'll encode the data I want to put in there. Keeping an eye on on the github topics regarding editing custom types using the inspector. It seems what I want is part of the 4.0 release.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file