BubbleTroll 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 30 
	Threads: 6 
	Joined: Aug 2011
	
 Reputation: 
0
		
	 | 
	
		
			
  
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  | 
	
		
	 | 
 
 
	
		
		xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
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);
  
			 
			
			
 
 Dubstep <3 
			
				
(This post was last modified: 08-22-2011, 01:55 PM by xtron.)
 
				
			 
		 |  
	 
 | 
 
	| 08-22-2011, 01:55 PM  | 
	
		
	 | 
 
 
	
		
		BubbleTroll 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 30 
	Threads: 6 
	Joined: Aug 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		narutohokager 
 
 
		
			Member 
			
			
			
 
			
	Posts: 149 
	Threads: 28 
	Joined: Jan 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		BubbleTroll 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 30 
	Threads: 6 
	Joined: Aug 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		narutohokager 
 
 
		
			Member 
			
			
			
 
			
	Posts: 149 
	Threads: 28 
	Joined: Jan 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		BubbleTroll 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 30 
	Threads: 6 
	Joined: Aug 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How do you make a monster spawn and then he leaves and you can hear a door opened. 
			 
			
				Oright   
i think i understand it. 
Like if grunt1 collides to areablabla a func will run. 
Is that right?
			  
			
			
			
		 |  
	 
 | 
 
	| 08-22-2011, 02:34 PM  | 
	
		
	 | 
 
 
	
		
		narutohokager 
 
 
		
			Member 
			
			
			
 
			
	Posts: 149 
	Threads: 28 
	Joined: Jan 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How do you make a monster spawn and then he leaves and you can hear a door opened. 
			 
			
				Yes it is his   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 08-22-2011, 02:41 PM  | 
	
		
	 | 
 
 
	
		
		BubbleTroll 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 30 
	Threads: 6 
	Joined: Aug 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		narutohokager 
 
 
		
			Member 
			
			
			
 
			
	Posts: 149 
	Threads: 28 
	Joined: Jan 2011
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	 
 |