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


Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Scarry Area"
exit361 Offline
Junior Member

Posts: 8
Threads: 2
Joined: Oct 2010
Reputation: 0
#1
"Scarry Area"

please i wanna set area whitch will makes my player SCARED using Sounds like his scream and some scary sounds and vision kolapses
10-30-2010, 12:51 PM
Find
Dr4konite Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2010
Reputation: 0
#2
RE: "Scarry Area"

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
10-30-2010, 01:11 PM
Find
exit361 Offline
Junior Member

Posts: 8
Threads: 2
Joined: Oct 2010
Reputation: 0
#3
RE: "Scarry Area"

okey now how to write it in SCRIPT so it will triger when i enter that area?
10-30-2010, 02:06 PM
Find
Dr4konite Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2010
Reputation: 0
#4
RE: "Scarry Area"

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!
//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!
//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!
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
10-30-2010, 03:02 PM
Find
exit361 Offline
Junior Member

Posts: 8
Threads: 2
Joined: Oct 2010
Reputation: 0
#5
RE: "Scarry Area"

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
10-30-2010, 03:26 PM
Find
Dr4konite Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2010
Reputation: 0
#6
RE: "Scarry Area"

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
10-30-2010, 04:31 PM
Find
exit361 Offline
Junior Member

Posts: 8
Threads: 2
Joined: Oct 2010
Reputation: 0
#7
RE: "Scarry Area"

(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
10-30-2010, 06:35 PM
Find
anzki Offline
Member

Posts: 88
Threads: 6
Joined: Apr 2010
Reputation: 1
#8
RE: "Scarry Area"

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.

[Image: 2qnr5av.png]
10-31-2010, 10:49 AM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#9
RE: "Scarry Area"

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.

11-04-2010, 12:29 AM
Find
Datenshi92 Offline
Junior Member

Posts: 7
Threads: 0
Joined: Sep 2010
Reputation: 0
#10
RE: "Scarry Area"

(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.
11-06-2010, 09:25 PM
Find




Users browsing this thread: 3 Guest(s)