Editing scriptable object arrays are a nightmare?

So, maybe I am wrong. But I am using Scriptable Objects for dialogs in my game. So say I have NPC Edgar, then I make 1 SO for him with an array of dialogs, each element in the array contains (examples):

  • DialogText
  • NpcStage
  • StartsQuest
  • EndsQuest

Now say I have created 20 nice dialogs for Edgar, but all of a sudden I realize he needs to say something more in the beginning of the game, maybe index 3 in the Array of dialogs. This brings me to my problem with SOs:

I increase the array size to fit another dialog, but it’s added at the end or the array (makes sense), so now I need to manually move every single element after index 3 in the array one step back, so I can fit my new dialog. This is a nightmare to do. Is this just a limitation of SOs you have to deal with? Thinking about just going back to plain old Json files instead.

1 Like

You can use a custom PropertyDrawer that allows you to reorder the array items by a simple drag & drop action. GitHub - SubjectNerd-Unity/ReorderableInspector: Automatic reorderable lists for Unity game engine components PropertyDrawer is exactly what you want.

1 Like

You can right-click an index in the array and select “duplcate element”. That’ll make a new entry right under the entry you clicked that links the same ScriptableObject, so you can drag-and-drop things in there.

You can also implement a ReorderableList. It’s not very well documented, but you can google around for it, it’s very convenient for these kinds of things.

2 Likes

implemeant your own reorderable list, and draw and sort it how you want.

Thanks a lot everyone! :slight_smile: This answered my question. Any idea how to nest Arrays inside these? cant find anything on that.

Nevermind, for anyone out there looking for a cheap solution to my problem take a look at this asset: