# Random encounter json location

**URL:** <https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104>\
**Category:** The Toolbox\
**Created:** [November 30, 2019, 6:22am UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104 "2019-11-30T06:22:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheeptime](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@sheeptime](https://discourse.cataclysmdda.org/u/sheeptime)\
**Post date:** [November 30, 2019, 6:22am UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/1 "2019-11-30T06:22:32Z")

</div>

I dug the data file for a while and couldn’t find the JSON file for the random encounter (random corpse etc)  
anyone know where is their location?  
thank you

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [November 30, 2019, 11:29am UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/2 "2019-11-30T11:29:54Z")

</div>

> <https://github.com/CleverRaven/Cataclysm-DDA/blob/edd25980d0ca793ba11a7c37931a002c29f5e387/data/json/overmap/map_extras.json>

Most functions there are hardcoded in [https://github.com/CleverRaven/Cataclysm-DDA/blob/edd25980d0ca793ba11a7c37931a002c29f5e387/src/map\_extras.cpp](https://github.com/CleverRaven/Cataclysm-DDA/blob/edd25980d0ca793ba11a7c37931a002c29f5e387/src/map_extras.cpp)

---

<div class="post-metadata">

**Author:** ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)\
**Post date:** [January 6, 2020, 2:52pm UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/4 "2020-01-06T14:52:21Z")

</div>

Is it possible to add a random encounter through JSON?

---

<div class="post-metadata">

**Author:** ![Erk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/erk/32/3871_2.png) [@Erk](https://discourse.cataclysmdda.org/u/Erk)\
**Post date:** [January 6, 2020, 2:56pm UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/5 "2020-01-06T14:56:15Z")

</div>

Sure, check out how I did it here

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/35990>

---

<div class="post-metadata">

**Author:** ![Minecrafter\_Next\_Gen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/minecrafter_next_gen/32/6504_2.png) [@Minecrafter\_Next\_Gen](https://discourse.cataclysmdda.org/u/Minecrafter_Next_Gen)\
**Post date:** [January 6, 2020, 5:36pm UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/7 "2020-01-06T17:36:06Z")

</div>

Is it possible, and if so how, to migrate the existing mapgen encounters into a modification for editing?

---

<div class="post-metadata">

**Author:** ![Erk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/erk/32/3871_2.png) [@Erk](https://discourse.cataclysmdda.org/u/Erk)\
**Post date:** [January 7, 2020, 5:50am UTC](https://discourse.cataclysmdda.org/t/random-encounter-json-location/22104/8 "2020-01-07T05:50:26Z")

</div>

It’s kind of possible, you just have to understand how the C++ works and recode it in JSON. Or you could do like what I’ve done for c++ based maps and just redo it by hand. None of the old C++ maps really do anything we can’t do manually now.
