xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				 (05-22-2011, 07:33 PM)Kyle Wrote:  What is the name of the key that you want to be interacted with which then causes the monster to spawn? 
 
What is the name of the monster that will spawn? 
the key: keyhall2 
monster name: monster_key_keeper1
 
thanks for helping me out   
			 
			
			
 
 Dubstep <3 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:34 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				Here you go.   
//////////////////////////// 
// Run first time starting map 
void OnStart() 
//The key "Hall2" is needed to unlock the room called "Hall2" and plays the unlock_door sound. 
{ 
    SetEntityPlayerInteractCallback("keyhall2", "monsterspawn", true);  
    AddUseItemCallback("", "keyhall2", "room_hall2", "UsedKeyOnDoor", true); 
    AddUseItemCallback("", "key_office", "room_office", "UsedKeyOnDoor2", true); 
    AddUseItemCallback("", "key_prison", "door_prison", "UsedKeyOnDoor3", true); 
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "IdleExtra3"); 
} 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("room_hall2", false, true); 
    PlaySoundAtEntity("", "unlock_door", "room_hall2", 0, false); 
    RemoveItem("keyhall2"); 
} 
 
void UsedKeyOnDoor2(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("room_office", false, true); 
    PlaySoundAtEntity("", "unlock_door", "room_office", 0, false); 
    RemoveItem("key_office"); 
} 
 
void UsedKeyOnDoor3(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("door_prison", false, true); 
    PlaySoundAtEntity("", "unlock_door", "door_prison", 0, false); 
    RemoveItem("key_prison"); 
} 
 
void TriggerSanityDamageLook(string &in asEntity, int alState) 
{ 
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);  
    GiveSanityDamage(60.0f, true); 
    PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false); 
    SetMessage("Inventory","SH*T!",0); 
} 
 
void monsterspawn(string &in asEntity) 
{ 
    SetEntityActive("monster_key_keeper1", true); 
}  
  
//////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
 
} 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
  
}
  
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:37 PM  | 
	
		
	 | 
 
 
	
		
		xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				 (05-22-2011, 07:37 PM)Kyle Wrote:  Here you go.   
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
//The key "Hall2" is needed to unlock the room called "Hall2" and plays the unlock_door sound. 
{ 
    SetEntityPlayerInteractCallback("keyhall2", "monsterspawn", true);  
    AddUseItemCallback("", "keyhall2", "room_hall2", "UsedKeyOnDoor", true); 
    AddUseItemCallback("", "key_office", "room_office", "UsedKeyOnDoor2", true); 
    AddUseItemCallback("", "key_prison", "door_prison", "UsedKeyOnDoor3", true); 
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "IdleExtra3"); 
} 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("room_hall2", false, true); 
    PlaySoundAtEntity("", "unlock_door", "room_hall2", 0, false); 
    RemoveItem("keyhall2"); 
} 
 
void UsedKeyOnDoor2(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("room_office", false, true); 
    PlaySoundAtEntity("", "unlock_door", "room_office", 0, false); 
    RemoveItem("key_office"); 
} 
 
void UsedKeyOnDoor3(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("door_prison", false, true); 
    PlaySoundAtEntity("", "unlock_door", "door_prison", 0, false); 
    RemoveItem("key_prison"); 
} 
 
void TriggerSanityDamageLook(string &in asEntity, int alState) 
{ 
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);  
    GiveSanityDamage(60.0f, true); 
    PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false); 
    SetMessage("Inventory","SH*T!",0); 
} 
 
void monsterspawn(string &in asEntity) 
{ 
    SetEntityActive("monster_key_keeper1", true); 
}  
  
//////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
 
} 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
  
}
  
Thanks man! ^^. 
 
Btw how do i do so he walks from the spawn point to another point?
 
I already got a Patrolnode but it does'nt work :O.
			  
			
			
 
 Dubstep <3 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:39 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				Actually, you don't put it inside the void OnStart() 
You should put it into the function in which the monster is spawned.
 
Also, I don't think you should have some animation for the monster in the patrol node.
 
So remove the AddEnemyPatrolNode that's in your void OnStart() and then make the function look like this:
 void monsterspawn(string &in asEntity) 
{ 
     SetEntityActive("monster_key_keeper1", true); 
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, ""); 
}
  
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:44 PM  | 
	
		
	 | 
 
 
	
		
		xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				 (05-22-2011, 07:44 PM)Kyle Wrote:  Actually, you don't put it inside the void OnStart() 
 
You should put it into the function in which the monster is spawned. 
 
Also, I don't think you should have some animation for the monster in the patrol node. 
 
So remove the AddEnemyPatrolNode that's in your void OnStart() and then make the function look like this: 
 
void monsterspawn(string &in asEntity) 
{ 
     SetEntityActive("monster_key_keeper1", true); 
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, ""); 
}
  
And if I want more than 1 place to patrol i just add more nodes?..like
 void monsterspawn(string &in asEntity) 
{ 
     SetEntityActive("monster_key_keeper1", true); 
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, ""); 
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_2", 0.0f, ""); 
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_3", 0.0f, ""); 
}
 
etc...
 
?
			  
			
			
 
 Dubstep <3 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:47 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				Yes, that is exactly how you do it. ^.^
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:54 PM  | 
	
		
	 | 
 
 
	
		
		xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				Thanks for helping but the patroling does'nt work :S
			 
			
			
 
 Dubstep <3 
			
		 |  
	 
 | 
 
	| 05-22-2011, 07:54 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				 (05-22-2011, 07:54 PM)xtron Wrote:  Thanks for helping but the patroling does'nt work :S 
It  doesn't patrol. It goes from where it spawns to point A then to point B and then disappears when the player isn't looking.
			  
			
			
 
			
				
(This post was last modified: 05-22-2011, 08:03 PM by Kyle.)
 
				
			 
		 |  
	 
 | 
 
	| 05-22-2011, 08:03 PM  | 
	
		
	 | 
 
 
	
		
		xtron 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 402 
	Threads: 37 
	Joined: May 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				 (05-22-2011, 08:03 PM)Kyle Wrote:   (05-22-2011, 07:54 PM)xtron Wrote:  Thanks for helping but the patroling does'nt work :S  
It doesn't patrol. It goes from where it spawns to point A then to point B and then disappears when the player isn't looking. 
The problem is that the monster aint walking to point B.
			  
			
			
 
 Dubstep <3 
			
		 |  
	 
 | 
 
	| 05-22-2011, 08:07 PM  | 
	
		
	 | 
 
 
	
		
		Kyle 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 911 
	Threads: 36 
	Joined: Sep 2010
	
 Reputation: 
7
		
	 | 
	
		
			
RE: Anyone need help? 
			 
			
				Did you name it correctly? Check and make sure that the PathNode is called what you want it to be called.
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-22-2011, 08:10 PM  | 
	
		
	 | 
 
 
	 
 |