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


Thread Rating:
  • 0 Vote(s) - 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.
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#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
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#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
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#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
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#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);
}

Sorry for my bad english
Amnesia The Revenge - Chapter 1
(This post was last modified: 08-22-2011, 02:17 PM by narutohokager.)
08-22-2011, 02:16 PM
Website Find
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#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
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#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...

Sorry for my bad english
Amnesia The Revenge - Chapter 1
08-22-2011, 02:29 PM
Website Find
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#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
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#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

Sorry for my bad english
Amnesia The Revenge - Chapter 1
08-22-2011, 02:41 PM
Website Find
BubbleTroll Offline
Junior Member

Posts: 30
Threads: 6
Joined: Aug 2011
Reputation: 0
#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
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#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);

Sorry for my bad english
Amnesia The Revenge - Chapter 1
08-22-2011, 02:51 PM
Website Find




Users browsing this thread: 2 Guest(s)