# How to load a map from PAK File

**URL:** <https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472>\
**Category:** Modding\
**Tags:** map-load, pak, mod, unreal-engine, CPP, question\
**Created:** [June 30, 2017, 2:19am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472 "2017-06-30T02:19:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Myth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jack\_Myth](https://forums.unrealengine.com/u/Jack_Myth)\
**Post date:** [June 30, 2017, 2:19am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472/1 "2017-06-30T02:19:59Z")

</div>

Sorry For My Poor English.  
I want to build a system that can make player add some mods to the game.  
The first thing I want to do is let player add their own maps.  
I think It can be done by load player’s PAK File.  
Here is the code:

```
IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
FPakPlatformFile* PakPlatform = new FPakPlatformFile();
PakPlatform->Initialize(&PlatformFile, TEXT(""));
FPlatformFileManager::Get().SetPlatformFile(*PakPlatform);
return PakPlatform->Mount(*PakFileName, 0, *FPaths::GameContentDir());

```

I try to load a DLC Pak that create from SunTemple Project.  
it will return True. so I think the PAK File has been successful Mounted.  
But When I use “Open SunTemple” command,It show this:

![201589-0.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/9/87938b29a03511afbc3fad67651d1161542ab23d.png)

I guess it was because I mount the pak file at a wrong location.So I test the following directory:  
FPaths::EngineContentDir()  
FPaths::EngineDir()  
TEXT("/")  
all of these are not work.  
I have no idea how to fix that. can anyone help me?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_03a2537a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_03a2537a1](https://forums.unrealengine.com/u/anonymous_user_03a2537a1)\
**Post date:** [September 26, 2017, 7:03am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472/2 "2017-09-26T07:03:14Z")

</div>

What did you include for these headers? My code can not get refrences for these and I’m not sure what to include …

FPakPlatformFile();  
FPakFile

---

<div class="post-metadata">

**Author:** ![Jack\_Myth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jack\_Myth](https://forums.unrealengine.com/u/Jack_Myth)\
**Post date:** [September 27, 2017, 2:04am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472/3 "2017-09-27T02:04:57Z")

</div>

I Use Visual Assist to help me include header files. I search the document and I think you should include IPlatformFilePak.h.

---

<div class="post-metadata">

**Author:** ![evalover](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@evalover](https://forums.unrealengine.com/u/evalover)\
**Post date:** [January 11, 2018, 11:45am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472/4 "2018-01-11T11:45:52Z")

</div>

hi，now i face the same question，have you deal it？

---

<div class="post-metadata">

**Author:** ![Jack\_Myth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jack\_Myth](https://forums.unrealengine.com/u/Jack_Myth)\
**Post date:** [January 12, 2018, 4:23am UTC](https://forums.unrealengine.com/t/how-to-load-a-map-from-pak-file/399472/5 "2018-01-12T04:23:49Z")

</div>

no…I have not find any solution.
