Frictional Games Forum (read-only)

Full Version: How do you make a monster spawn and then he leaves and you can hear a door opened.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
As the subject says how do i script something like that.
Cause if im spawning a monster and telling to him to walk on the waypoints he never goes away.
So could anyone help me please?
Spawn monster
Code:
SetEntityActive("MONSTERNAME", true);

Disable monster
Code:
SetEntityActive("MONSTERNAME", false);

Door open sound
Code:
PlaySoundAtEntity("", "open_door.snt", "DOOR NAME", 0.1f, false);

How do i do like if the monster walks to an area/pathnote
it does SetEntityActive("servant_grunt_1", false); ?
You can put a collider for the monster, and one for the player who activates the monster
Code:
void OnStart
{
AddEntityCollideCallback("Grunt_1", "AreaGruntDeact", "CollideAreaGruntDeact", true, 1);
AddEntityCollideCallback("Player", "AreaGruntActive", "CollideAreaGruntActive", true, 1);
}

void CollideAreaGruntActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt_1", true);
AddEnemyPatrolNode("Grunt_1", "PathNodeArea_1", 0, "");
}

void CollideAreaGruntDeact(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Grunt_1", false);
PlaySoundAtEntity("", "SOUNDNAME", "DOORNAME", 0, false);
}
hmmm... could anyone explain what AddEntity means?
cause all these scripting things are new to me :/
AddEntityCollideCallback is a way to call a function when an object / monster / player touches an object / scripts, example

A Grunt through a script that you have set, will do the function call.

Sorry Bad english...
Oright Big Grin
i think i understand it.
Like if grunt1 collides to areablabla a func will run.
Is that right?
Yes it is his Wink
good ^-^
now i only have to understand all these functions.
also if i want to make a scary moment like if the play walks into an area and a door will open by itself and he loses sanity, do i have to add any sound effect to it?
If I understand you want to make a point when the player Walk Into a area the door will open any one is his?

If so, you might be putting a sound that shows the player to fear, you can find in your folder :

Amnesia - The Dark Descent\redist\sounds\react

And implement a command that lowers the sanity of the player :

GiveSanityDamage(10, true);
Pages: 1 2 3