# Use a creative\_prop as the key for a map?

**URL:** <https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [August 30, 2024, 7:49pm UTC](https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801 "2024-08-30T19:49:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamieDeGamie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JamieDeGamie](https://forums.unrealengine.com/u/JamieDeGamie)\
**Post date:** [August 30, 2024, 7:49pm UTC](https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801/1 "2024-08-30T19:49:23Z")

</div>

I’m trying to make a map with a `creative_prop` as key and a custom class as a value, so the map would look something like `var CustomCreatures:[creative_prop]custom_creature = map{}`, however i get the following error:  
`'creative_prop' cannot be used as the type of map keys because it is not comparable for equality.`

I get why the error occurs, but the `custom_creatures` class i’m using as the value for the map is already of type `<unique>`, i.e. `custom_creature := class<unique>:`, and to call the class in my code i need to store it in a map. Does anyone know a way around this?

---

<div class="post-metadata">

**Author:** ![SaSteMi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SaSteMi](https://forums.unrealengine.com/u/SaSteMi)\
**Post date:** [August 30, 2024, 8:08pm UTC](https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801/2 "2024-08-30T20:08:30Z")

</div>

You need some kind of comparable as key (for example numbers, but then you could just make an array). Could you send more of your code as context if you need further help?

---

<div class="post-metadata">

**Author:** ![JamieDeGamie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JamieDeGamie](https://forums.unrealengine.com/u/JamieDeGamie)\
**Post date:** [August 30, 2024, 8:17pm UTC](https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801/3 "2024-08-30T20:17:24Z")

</div>

Thanks for the reply! I’ve actually just solved the problem already, turns out I was being dumb. What worked for me was creating a `unique_creature` class that is just a replacement for the `creature` type, since the class converts it to a unique one, when adding the `unique` effect so

```auto
unique_creature := class<unique>:
    Creature:creative_prop

```

and then instead of passing in the `creative_prop` in the map, i just passed in the `unique_creature` like this:

```auto
var CustomCreatures:[unique_creature]custom_creature = map{}

```

I converted the `creature` to the `unique_creature` class using

```auto
UniqueCreature := unique_creature{Creature:=Creature}

```

and after I just added it to the `CustomCreatures` map.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 29, 2024, 8:17pm UTC](https://forums.unrealengine.com/t/use-a-creative-prop-as-the-key-for-a-map/1998801/4 "2024-09-29T20:17:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
