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


Messages In This Thread
"Scarry Area" - by exit361 - 10-30-2010, 12:51 PM
RE: "Scarry Area" - by Dr4konite - 10-30-2010, 01:11 PM
RE: "Scarry Area" - by exit361 - 10-30-2010, 02:06 PM
RE: "Scarry Area" - by Dr4konite - 10-30-2010, 03:02 PM
RE: "Scarry Area" - by exit361 - 10-30-2010, 03:26 PM
RE: "Scarry Area" - by Dr4konite - 10-30-2010, 04:31 PM
RE: "Scarry Area" - by exit361 - 10-30-2010, 06:35 PM
RE: "Scarry Area" - by anzki - 10-31-2010, 10:49 AM
RE: "Scarry Area" - by Kyle - 11-04-2010, 12:29 AM
RE: "Scarry Area" - by Datenshi92 - 11-06-2010, 09:25 PM
RE: "Scarry Area" - by Tottel - 11-06-2010, 09:28 PM



Users browsing this thread: 1 Guest(s)