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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make a jumpscare screen?
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
how to make a jumpscare screen?

Now I don't know how to do this but I would like to know how!

In my custom story, when the player opens this door I want the screen to squeeze in and a soundtrack will play and I want the player to gasp, how do I do that?

it's similar to the part where you open the last door at the sewer in the original amnesia game and you'll find grunt body parts, you know what I mean? What's the whole code of that pls
01-31-2014, 07:10 PM
Find
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#2
RE: how to make a jumpscare screen?

Put a scriptArea in the doorway and make it call a function with
void MyFunc(string &in asEntity)
that includes this script-line:

void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

If you need more help I could take some more time to help you with the specifics, but yeah. That's what you got to do.
01-31-2014, 07:35 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#3
RE: how to make a jumpscare screen?

I found this in the code of the sewer of the part where you open the door with lots of grunt parts and it did not have void my func, it had this instead

void CollideGruntCorpse(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(10, true);

PlayMusic("20_event_darkness.ogg", false, 1.0, 0, 20, false);
}

should I use that? and in the level editor of the sewer it had a script area near the door called "AreaGruntCorpse"
01-31-2014, 07:48 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: how to make a jumpscare screen?

You need to understand.

When something says "MyFunc" is just another way of saying "MyFunction". Meaning it's a placeholder for the real name of the function.

In the code you found, the name of the function is "CollideGruntCorpse". You can see it's a collidefunction because it has (string &in asParent, string &in asChild, int alState).

What you experienced in that particular place is probably that the door is colliding with a script area, it calls the function. So it's not when you touch it, but when the door opens.
Therefore this function will not work, unless you set up your level as if you opened a door.


Also, for a script to work you must have in your "void OnStart()" function, a line saying that you want to add a function that creates the jumpscare.

In this case you will be needing:

PHP Code: (Select All)
AddEntityCollideCallback(stringasParentNamestringasChildNamestringasFunctionbool abDeleteOnCollideint alStates); 

If you put this in your "void OnStart()" function it tells the script to add a collide function.
Now you have to fill in all the data that it needs.
You can get explained what the different things mean here:
http://wiki.frictionalgames.com/hpl2/amn..._functions

Press Ctrl+F or Cmd+F to search for the specific function: "AddEntityCollideCallback", to find it.

Do you understand? Smile

Trying is the first step to success.
01-31-2014, 08:55 PM
Find




Users browsing this thread: 1 Guest(s)