Frictional Games Forum (read-only)
"Scarry Area" - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: "Scarry Area" (/thread-5243.html)

Pages: 1 2


"Scarry Area" - exit361 - 10-30-2010

please i wanna set area whitch will makes my player SCARED using Sounds like his scream and some scary sounds and vision kolapses


RE: "Scarry Area" - Dr4konite - 10-30-2010

I think an insanity-area will solve your problem. You can find it in the level editor in the area category.

This area is permanent active or inactive, until you use a script function to activate it for a special event and deactivate it afterwards.

Hope this will help you.
Greetings
Dr4konite


RE: "Scarry Area" - exit361 - 10-30-2010

okey now how to write it in SCRIPT so it will triger when i enter that area?


RE: "Scarry Area" - Dr4konite - 10-30-2010

By default it should be set to active when placing it in the map editor. So it will be automaticaly triggered when the player enters that area. Note that wether the player get insanity visions or not depends on how good his sanity is.

When you deactivate the area in the map editor because you want to activate it later ingame bound to an event you can use the "SetEntityActive" function paired with a "CollideCallback". It may look like this:

Spoiler below!
Code:
//Collide Callback
void onStart()
{
AddEntityCollideCallback("Player", "TriggerArea", "ActivateInsanity", true, 1);    
}

//Area function:
void ActivateInsanity(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("InsanityArea", true);
}


If you want to deactivate this area after a period of time or after an event just call the "SetEntityActive" function again, but set the second parameter to false.

This may look like this:
Spoiler below!
Code:
//Area function:
void ActivateInsanity(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("InsanityArea", true);
AddTimer("DeInsanity", 10.0f, "TimerDeactivateInanity");
//In this example I use the timer function that will call the deactivate function after 10 seconds.
}

//Timer function:
void TimerDeactivateInsanity(string &in asTimer)
{
SetEntityActive("InsanityArea", false);
}


If you want to add sanity damage to make sure the player will get insanity visions you can additionally type:
Spoiler below!
Code:
GiveSanityDamage(*VALUE BETWEEN 0-100*, true);
//EXAMPLE:
GiveSanityDamage(50, true);

The value will determines how much sanity the player will lose (type it without **). Additionally you can choose if there will be an effect or not by setting the second parameter to true (effect) or false (no effect).

Greetings
Dr4konite


RE: "Scarry Area" - exit361 - 10-30-2010

Okey Sanity Area wont work but i need that player will scream and his vision will shake when he enter area i choosed so gimme PLEASE scrit for it


RE: "Scarry Area" - Dr4konite - 10-30-2010

The functions for these kinds of effects are:

1. PlaySoundAtEntity
EXAMPLE:
PlaySoundAtEntity("", "05_event_door_bang.ogg", "Player", 0, false);

The first parameter will name your sound function (needed when you want to deactivate the sound later, but can be empty if it is not looped).
The second is the sound which is meant to be played.
The third is the entity the sound will be played at (in this case it's the player).
The fourth is the fading time (e.g. if you want to fade in).
The fifth defines if the sound should be save (looped).

2. StartScreenShake
EXAMPLE:
StartScreenShake(0.1, 4.7, 0.05, 0.5);

The first will set the amount the screen is shaking.
The second will set the lengh the screen is actually shaking.
The third and fourth define the fadeIN and fadeOUT times.

Trigger this with a CollideCallback and you will be fine.
Try this for yourself - I gave you all you need in my answers.

Greetings
Dr4konite


RE: "Scarry Area" - exit361 - 10-30-2010

(10-30-2010, 04:31 PM)Dr4konite Wrote: The functions for these kinds of effects are:

1. PlaySoundAtEntity
EXAMPLE:
PlaySoundAtEntity("", "05_event_door_bang.ogg", "Player", 0, false);

The first parameter will name your sound function (needed when you want to deactivate the sound later, but can be empty if it is not looped).
The second is the sound which is meant to be played.
The third is the entity the sound will be played at (in this case it's the player).
The fourth is the fading time (e.g. if you want to fade in).
The fifth defines if the sound should be save (looped).

2. StartScreenShake
EXAMPLE:
StartScreenShake(0.1, 4.7, 0.05, 0.5);

The first will set the amount the screen is shaking.
The second will set the lengh the screen is actually shaking.
The third and fourth define the fadeIN and fadeOUT times.

Trigger this with a CollideCallback and you will be fine.
Try this for yourself - I gave you all you need in my answers.

Greetings
Dr4konite
okey now how to put it in one ? so when player enter area it will play that sound and shake camera


RE: "Scarry Area" - anzki - 10-31-2010

Check this tutorial. And don't just ask people to give you ready script.
Figure out how functions work, or ask how they work, if you can't figure it out. And read that tutorial.


RE: "Scarry Area" - Kyle - 11-04-2010

I LOLed at how Exit types. To be honest, I think he is a little too young to be scripting all together. Well, I can't really say that for myself, I'm only 13. The only exception is that I know how to script.


RE: "Scarry Area" - Datenshi92 - 11-06-2010

(11-04-2010, 12:29 AM)Kyle Wrote: I LOLed at how Exit types. To be honest, I think he is a little too young to be scripting all together. Well, I can't really say that for myself, I'm only 13. The only exception is that I know how to script.

Age doesn't have anything to do with knowing how to script or not.
I'm 18 and I never did a single script in my life.