Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do you make a monster spawn and then he leaves and you can hear a door opened.
Author Message
BubbleTroll Offline
Junior Member

Posts: 30
Joined: Aug 2011
Reputation: 0
Post: #1
Question How do you make a monster spawn and then he leaves and you can hear a door opened.

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?
08-22-2011 12:28 PM
Find all posts by this user Quote this message in a reply
xtron Offline
Senior Member

Posts: 402
Joined: May 2011
Reputation: 2
Post: #2
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

Spawn monster
SetEntityActive("MONSTERNAME", true);

Disable monster
SetEntityActive("MONSTERNAME", false);

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

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 08-22-2011 01:55 PM by xtron.)
08-22-2011 01:55 PM
Find all posts by this user Quote this message in a reply
BubbleTroll Offline
Junior Member

Posts: 30
Joined: Aug 2011
Reputation: 0
Post: #3
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

How do i do like if the monster walks to an area/pathnote
it does SetEntityActive("servant_grunt_1", false); ?
08-22-2011 02:09 PM
Find all posts by this user Quote this message in a reply
narutohokager Offline
Member

Posts: 126
Joined: Jan 2011
Reputation: 0
Post: #4
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

You can put a collider for the monster, and one for the player who activates the monster
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);
}

(This post was last modified: 08-22-2011 02:17 PM by narutohokager.)
08-22-2011 02:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BubbleTroll Offline
Junior Member

Posts: 30
Joined: Aug 2011
Reputation: 0
Post: #5
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

hmmm... could anyone explain what AddEntity means?
cause all these scripting things are new to me :/
(This post was last modified: 08-22-2011 02:27 PM by BubbleTroll.)
08-22-2011 02:24 PM
Find all posts by this user Quote this message in a reply
narutohokager Offline
Member

Posts: 126
Joined: Jan 2011
Reputation: 0
Post: #6
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

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

08-22-2011 02:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BubbleTroll Offline
Junior Member

Posts: 30
Joined: Aug 2011
Reputation: 0
Post: #7
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

Oright Big Grin
i think i understand it.
Like if grunt1 collides to areablabla a func will run.
Is that right?
08-22-2011 02:34 PM
Find all posts by this user Quote this message in a reply
narutohokager Offline
Member

Posts: 126
Joined: Jan 2011
Reputation: 0
Post: #8
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

Yes it is his Wink

08-22-2011 02:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BubbleTroll Offline
Junior Member

Posts: 30
Joined: Aug 2011
Reputation: 0
Post: #9
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

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?
08-22-2011 02:44 PM
Find all posts by this user Quote this message in a reply
narutohokager Offline
Member

Posts: 126
Joined: Jan 2011
Reputation: 0
Post: #10
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

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);

08-22-2011 02:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)