| 
		
	
		| GhastDagger   Junior Member
 
 Posts: 9
 Threads: 3
 Joined: Sep 2011
 Reputation: 
0
 | 
			|  Door/Script Area not working 
 
				Hey guys, the title says it all.. the specific key for the work doesn't work and it says "Cannot use this item this way" or something when i use it on the door, and the script area are supposed to spawn monsters but when i walk on the area it doesn't work..so what's possibly wrong with the scripts ? and sorry for my too many questions    
here's the HPS file:
 ////////////////////////////
// Run first time starting map
void OnStart()
{
	AddUseItemCallback("", "lolkey_1", "level_orb_room_door_1", "KeyOnDoor", true);
	AddEntityCollideCallback("Player", "DoorScare", "DoorScare", true, 1);
	AddEntityCollideCallback("Player", "HorrorStart", "CollideHorrorStart", false, 1);
	
}
 void KeyOndoor(string &in asItem, string &in asEntity)
{
	SetLevelDoorLocked("level_orb_room_door_1", false);
	PlaySoundAtEntity("", "unlock_door", "level_orb_room_door_1", 0, false);
	RemoveItem("lolkey_1");
}
 void DoorScare(string &in asParent, string &in asChild, int alState)
{
	SetSwingDoorClosed("TrapzDoor", true, true);
	SetSwingDoorLocked("TrapzDoor", true, true);
	PlaySoundAtEntity("", "Close_Door.snt", "TrapzDoor", 0.0f, true);
	GiveSanityDamage(10, true);
}
 void HorrorStart(string &in asParent, string &in asChild, int alState)
{
	PlaySoundAtEntity("", "screams", "Player", 0, false);
	GiveSanityDamage(10, true);
	SetEntityActive("enemy_suitor_alois_1", true);
	SetEntityActive("Servant_grunt_1", true);
	SetEntityActive("Servant_brute_1", true);
	ShowEnemyPlayerPosition("enemy_suitor_alois_1");
}
 void OnPickUp(string &in asEntity, string &in type) 
{
	SetEntityActive("Corpsy", true);
	PlaySoundAtEntity("", "screams", "Player", 0, false);
	GiveSanityDamage(10, true);
	PlaySoundAtEntity("alois_notice_long", "alois_notice_long.snt", "Player", 0, false);
}
 ////////////////////////////
// Run when entering map
void OnEnter()
{
 }
 
////////////////////////////
// Run when leaving map
void OnLeave()
{
 }
 |  |  
	| 10-17-2011, 05:13 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: Door/Script Area not working 
 
				the door is special? 
			 |  |  
	| 10-17-2011, 05:22 PM |  |  
	
		| schmupper   Junior Member
 
 Posts: 23
 Threads: 1
 Joined: Aug 2011
 Reputation: 
2
 | 
			| RE: Door/Script Area not working 
 
				void OnStart(){
 AddUseItemCallback("", "lolkey_1", "level_orb_room_door_1", "KeyOnDoor", true);
 AddEntityCollideCallback("Player", "DoorScare", "DoorScare", true, 1);
 AddEntityCollideCallback("Player", "HorrorStart", "CollideHorrorStart", false, 1);
 }
 
 
 void HorrorStart(string &in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("", "screams", "Player", 0, false);
 GiveSanityDamage(10, true);
 SetEntityActive("enemy_suitor_alois_1", true);
 SetEntityActive("Servant_grunt_1", true);
 SetEntityActive("Servant_brute_1", true);
 ShowEnemyPlayerPosition("enemy_suitor_alois_1");
 }
The function to call is not namned correct, should be CollideHorrorStart instead of HorrorStart. 
 
 
 
 ''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''
 Clarence - The monkey hater
 |  |  
	| 10-17-2011, 05:29 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: Door/Script Area not working 
 
				you must put this the third function: 
 SetEntityPlayerInteractCallback("namekey", "callfunction", true);
 
 you must put this for the door:
 
 void KeyOndoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("level_orb_room_door_1", false, true);
 SetLevelDoorLocked(asEntity, false);
 PlaySoundAtEntity("", "unlock_door", "level_orb_room_door_1", 0, false);
 RemoveItem("lolkey_1");
 }
 
 
 
				
(This post was last modified: 10-17-2011, 05:40 PM by Darion97.)
 |  |  
	| 10-17-2011, 05:39 PM |  |  
	
		| GhastDagger   Junior Member
 
 Posts: 9
 Threads: 3
 Joined: Sep 2011
 Reputation: 
0
 | 
			| RE: Door/Script Area not working 
 
				Thanks alot guys! that helped alot, but still facing problems with the door, can't unlock it by using the key    |  |  
	| 10-17-2011, 07:42 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Door/Script Area not working 
 
				 (10-17-2011, 07:42 PM)GhastDagger Wrote:  Thanks alot guys! that helped alot, but still facing problems with the door, can't unlock it by using the key  One problem i saw is that you named the function KeyOnDoor in the list. but in void you name it KeyOndoor. 
			 
 |  |  
	| 10-18-2011, 01:23 PM |  |  |