Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
* Some issues in my Custom Story - Amnesia! * GIVE ME A HAND PLEASE *
Tiiwh Offline
Junior Member

Posts: 47
Threads: 6
Joined: Nov 2011
Reputation: 1
#1
Question  * Some issues in my Custom Story - Amnesia! * GIVE ME A HAND PLEASE *

Hello there.
So basically I started to work with my custom story and I love it. I thought of may releasing it someday, but I want it to be as perfect as I can make it! Or else I wont be satisfied! Well since I'm a newbie, and I have only played the real game Amnesia - The Dark Descent. I have some small issues I need help with.
I have this issue with my hps. file. I will copy it so that you guys can look at it:
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

As you guys may see I haven't included anything yet. Since nothing works! Everything works in my eng.lang file but not in the hps file! It keep crashing. These are the most common issues that I recently had to deal with and gave up on:
- Mementos (Giving the player a memento when pulling a locked door, telling the player to find the key to the locked door).
- Music (Putting music to the game, when entering a specific area/room and so on).
- Sound effects, like a girl laughing when he is entering a room.
I would really appreciate if ANYONE would help me with this. I don't have any problem to understand when people explain, so just go for it. Smile

[Image: deaceaf76907.gif]
(This post was last modified: 11-17-2011, 06:26 PM by Tiiwh.)
11-06-2011, 05:46 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#2
RE: * Some issues in my Custom Story - Amnesia! * GIVE ME A HAND PLEASE *

This http://wiki.frictionalgames.com/hpl2/amn..._functions is your new Bible. Study it closely.
2/3 of your issues use Script Areas! Script areas are like your life savers. The player will 'collide' with the script area and something will happen. All you have to do is pick a nice area to place the Script area, then place it, making sure it extends far enough to be 100% sure the player will run into it. One thing your .hps is missing is void OnStart(). It NEEDS to be there. So, I'll give you an example of how to activate a sound effect when walking into an area.
1. Place the script area wherever you'd like. Make sure it extends far enough so the player will collide with it! Re-name it something so you'll remember what it's used for in your .hps. Something like NoiseTrigger will do. Don't forget to hit ENTER after re-naming anything!
2. Open your maps .hps file. Yours is empty so it should look like this:
void OnStart()
{
}

void OnEnter()
{
}

void OnLeave()
{
}

That is known as the 'basic .hps'. It's what it always starts out to be. Now you can add some fuctions to make a sound trigger! We're using PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound); . This will play a sound when the Player collides with an entity. Let's set it up!

void OnStart()
{
PlaySoundAtEntity("", "name of sound.snt", "name of script area", 0.0f, true);
}

void OnEnter()
{
}

voidOnLeave()
{
}

Replace name of sound.snt with your chosen sound. You can look at them in the Level Editor if you click on Sounds, pick one, listen to it, and write the name of it down. Just don't place the sound icon in your map! Replace name of script area to, obviously, the name of your script area. HERE'S AN EXAMPLE:

void OnStart()
{
PlaySoundAtEntity("", "00_laugh.snt", "NoiseTrigger", 0.0f, true);
}

voidOnEnter()
{
}

void OnLeave()
{
}

I used NoiseTrigger as the script area name, as it was what I mentioned above. If this makes sense to you I can solve your other problems, just PM me!



Ba-da bing, ba-da boom.
(This post was last modified: 11-06-2011, 06:30 PM by JenniferOrange.)
11-06-2011, 06:29 PM
Find




Users browsing this thread: 1 Guest(s)