Can we make a map an @editable? in the docs it mentions it

can we make make a map{} @editable like an array? i tried but i get compilation errors, in the docs it references it: Editable Properties | Unreal Editor for Fortnite Documentation | Epic Developer Community

Currently, the following types can be exposed to the editor as editable properties:

logic
int
float
enum
string
arrays of editable types
maps of editable types
structs of editable types
class instances
Several other editable types exist, each with their own definition:

1 Like

Unfortunately we can’t make a map an editable, despite what the docs say. Hopefully we can in the future.

2 Likes

You need to make an array of classes and then use the class properties to index your own map (at construction time for example)

notification_system_data := class<concrete>:
    @editable
    Type : notification_type = notification_type.Info

    @editable
    HUDMessageDevice : hud_message_device = hud_message_device{}

notification_system := class(creative_device):
    @editable
    InstigatedHUDMessageData : []notification_system_data = array{}

    var InstigatedHUDMessages : [notification_type]hud_message_device = map{}
    block:
        set InstigatedHUDMessages = map{} # Sometimes you'd want to add this line otherwise it can add up when you push changes
        for(Data : InstigatedHUDMessageData):
            option{set InstigatedHUDMessages[Data.Type] = Data.HUDMessageDevice}
1 Like

yes, aware of that, but when we have a big array as editable, it just says index 0, index 1, index 2, and makes it harder to navigate and have to press expand all to check all array indexes for the right key, if it were a map we would see the keys, and it would be much easier to navigate from the editor

1 Like

Haha don’t take a look at npc behaviors then :smiling_face_with_tear:

If you’re having issues with indexes, make sure they’re in the right order, also if you want to reorder them you can use

@editable_container{ AllowReordering := true }
    SomeArray : []int = array{1,2,3}
1 Like