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 *
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


Messages In This Thread
RE: * Some issues in my Custom Story - Amnesia! * GIVE ME A HAND PLEASE * - by JenniferOrange - 11-06-2011, 06:29 PM



Users browsing this thread: 1 Guest(s)