Frictional Games Forum (read-only)
[LVL ED] Adding a second level - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [LVL ED] Adding a second level (/thread-21136.html)

Pages: 1 2


Adding a second level - salsbury - 04-12-2013

Hello again.

I was curious the exact steps needed to add a second level. I know how to connect it with a door from the first one, but I'm more confused about the actual map file. Do I save it in the same folder as the first level? If so, what about the .hps file? It's for the first level, so how does that affect the second? Is it just one .hps file for the entire mod, all maps included? I really appreciate any advice.


RE: Adding a second level - NaxEla - 04-12-2013

Yes, all the maps are saved in one folder. Each map has it's own hps file (named the same as the map). For example, a mod's "maps" folder could contain these files:

map_1.map
map_1.hps
map_2.map
map_2.hps
map_3.map
map_3.hps


RE: Adding a second level - Romulator - 04-12-2013

NaxEla just beat me to it xD, he basically summarised what I said but still works either way Smile

A map itself is what is loaded when you go through a loading screen, so when you go through one level door to another, it loads up the new map. Wherever your maps are stored, you have each seperate level as a .map file made with the map editor. For example (this is a directory, not code):
Code:
/maps
  - map_level_one.hps
  - map_level_one.map
  - map_level_two.hps
  - map_level_two.map
The map refers to the .hps file which has the same filename. So map_level_one would refer to the map_level_one.hps for all its scripting.

If you go through the maps folder in the actual Amnesia redist folder, you'll note that they have Ch01, Ch02, and Ch03, which just signify the three chapters of Amnesia. Within each, they all have the map files and the associated script. If you open these with the level editor, you'll understand how each map leads into the next in a particular way and loads with this method Smile


RE: Adding a second level - salsbury - 04-12-2013

Thanks, and It leads me to my next question. I asked in another thread about making a .hps file for the map. I'm looking at it, I do have notepad ++, and I have a .hps for the first level. I made the new map, as lost.map. How do I create the .hps file again? As in, step by step. I'm just really confused.


RE: Adding a second level - Romulator - 04-12-2013

Just start working on it, whether in Notepad++ or in any text editor and when you're done save it. Then go to the file and change the extension on it (.exa) to .hps Smile


RE: Adding a second level - salsbury - 04-12-2013

Ok. Now, I do have an existing file for the first level, without any script yet. It only has


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

So can I just copy this file, and then change the name of "levelname.hps" to "secondlevelname.hps"?


RE: Adding a second level - Romulator - 04-12-2013

Pretty much, as long as there are no errors (at the moment, there isn't Tongue) and the file name is identical to the second map with the extension .hps, it will work Smile


RE: Adding a second level - salsbury - 04-12-2013

oh great, then that way I can set up all the files, and build the physical levels, then just go back and script each one.


RE: Adding a second level - NaxEla - 04-12-2013

(04-12-2013, 04:12 AM)salsbury Wrote: Ok. Now, I do have an existing file for the first level, without any script yet. It only has


////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

So can I just copy this file, and then change the name of "levelname.hps" to "secondlevelname.hps"?

Yup! I suggest you also add
Code:
////////////////////////////
// Run when starting map
void OnStart()
{

}
to your script. So it looks like this:
PHP Code:
////////////////////////////
// Run when starting map
void OnStart()
{
 
}

////////////////////////////
// Run when entering map
void OnEnter()
{
 
}
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 


Just in case you're wondering, the OnStart function will get called when the player enters the map for the first time only. OnEnter will get called every time the player enters the map, and OnLeave will get called every time the player leaves the map.


RE: Adding a second level - Romulator - 04-12-2013

When I make a map, the first thing I do is determine what is going to happen or what is the purpose of this level, for example, does a key go in this door, and if it does, where is it? Then once the physical stuff of the map is done, I determine what I should put into it to make it look nice without overdoing it and then figure out what scripts I can implement, either for scares or to help guide the player. Once you're finished the whole project though, go back and implement some of the things you learnt later into the early levels (trust me, this is good). Smile Good luck with your story and I'm sure we will all help if we can with all your development issues Smile