| 
		
	
		| naseem142   Member
 
 Posts: 153
 Threads: 19
 Joined: Oct 2012
 Reputation: 
0
 |  |  
	| 10-08-2012, 10:35 AM |  |  
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| RE: key trigger 
 
				Post your script.
 Edit: Is the monster in the level_editor called monster_grunt?
 
 
				
(This post was last modified: 10-08-2012, 10:37 AM by i3670.)
 |  |  
	| 10-08-2012, 10:35 AM |  |  
	
		| naseem142   Member
 
 Posts: 153
 Threads: 19
 Joined: Oct 2012
 Reputation: 
0
 | 
			| RE: key trigger 
 
				 (10-08-2012, 10:35 AM)i3670 Wrote:  Post your script.
 Edit: Is the monster in the level_editor called monster_grunt?
 Here is the script , and yes the grunt is named "monster_ grunt" 
 
void OnStart() 
{  
 AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true); 
 SetEntityCallbackFunc("key_1", "OnPickup"); 
} 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
 SetSwingDoorLocked("locked_door1", false, true); 
 PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false); 
 RemoveItem("key_1"); 
} 
void OnPickup(string &in asEntity, string &in type) 
{ 
 SetEntityActive("monster_grunt", true); 
 ShowEnemyPlayerPosition("monster_grunt"); 
}
			 
				
(This post was last modified: 10-08-2012, 11:12 AM by naseem142.)
 |  |  
	| 10-08-2012, 11:11 AM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: key trigger 
 
				 (10-08-2012, 11:11 AM)naseem142 Wrote:   (10-08-2012, 10:35 AM)i3670 Wrote:  Post your script.Here is the script , and yes the grunt is named "monster_ grunt"
 Edit: Is the monster in the level_editor called monster_grunt?
 
 
 
 
 
 void OnStart()
 {
 AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
 SetEntityCallbackFunc("key_1", "OnPickup");
 }
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("locked_door1", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
 RemoveItem("key_1");
 }
 void OnPickup(string &in asEntity, string &in type)
 {
 SetEntityActive("monster_grunt", true);
 ShowEnemyPlayerPosition("monster_grunt");
 }
 void OnPickup(string &in asEntity, string &in as Type) 
{ 
SetEntityActive("monster_grunt", true); 
ShowEnemyPlayerPosition("monster_grunt"); 
}
 
You had the sintax wrong.
			 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 10-08-2012, 11:48 AM |  |  
	
		| naseem142   Member
 
 Posts: 153
 Threads: 19
 Joined: Oct 2012
 Reputation: 
0
 | 
			| RE: key trigger 
 
				 (10-08-2012, 11:48 AM)The chaser Wrote:   (10-08-2012, 11:11 AM)naseem142 Wrote:  void OnPickup(string &in asEntity, string &in asType) (10-08-2012, 10:35 AM)i3670 Wrote:  Post your script.Here is the script , and yes the grunt is named "monster_ grunt"
 Edit: Is the monster in the level_editor called monster_grunt?
 
 
 
 
 
 void OnStart()
 {
 AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
 SetEntityCallbackFunc("key_1", "OnPickup");
 }
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("locked_door1", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
 RemoveItem("key_1");
 }
 void OnPickup(string &in asEntity, string &in type)
 {
 SetEntityActive("monster_grunt", true);
 ShowEnemyPlayerPosition("monster_grunt");
 }
 {
 SetEntityActive("monster_grunt", true);
 ShowEnemyPlayerPosition("monster_grunt");
 }
 
 You had the sintax wrong.
 Still doesn't work. 
am i suppose to do anything with entity options? 
 ![[Image: mhGIv.png]](http://i.imgur.com/mhGIv.png)  |  |  
	| 10-08-2012, 12:10 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: key trigger 
 
				No, you don't need to do anything with these.  void OnStart()
 {
 
 AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
 
 SetEntityCallbackFunc("key_1", "OnPickup");
 
 }
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 
 {
 
 SetSwingDoorLocked("locked_door1", false, true);
 
 PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
 
 RemoveItem("key_1");
 
 }
 
 void OnPickup(string &in asEntity, string &in type)
 {
 SetEntityActive("monster_grunt", true);
 ShowEnemyPlayerPosition("monster_grunt");
 }
Weird. Maybe if you copy-paste the script it works. I was wrong with the syntax, it was "string &in type". 
But, in the CallbackFunc, in the level editor, put "OnPickup". If I'm not wrong, when you put the mouse there, it says something about OnPickup, OnIgnite, Break. I think.
			
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 10-08-2012, 01:21 PM |  |  
	
		| naseem142   Member
 
 Posts: 153
 Threads: 19
 Joined: Oct 2012
 Reputation: 
0
 | 
			| RE: key trigger 
 
				 (10-08-2012, 01:21 PM)The chaser Wrote:  No, you don't need to do anything with these. 
 
 void OnStart()
 {
 
 AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
 
 SetEntityCallbackFunc("key_1", "OnPickup");
 
 }
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity)
 
 {
 
 SetSwingDoorLocked("locked_door1", false, true);
 
 PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
 
 RemoveItem("key_1");
 
 }
 
 void OnPickup(string &in asEntity, string &in type)
 {
 SetEntityActive("monster_grunt", true);
 ShowEnemyPlayerPosition("monster_grunt");
 }
Weird. Maybe if you copy-paste the script it works. I was wrong with the syntax, it was "string &in type".
 But, in the CallbackFunc, in the level editor, put "OnPickup". If I'm not wrong, when you put the mouse there, it says something about OnPickup, OnIgnite, Break. I think.
 It worked now , thanks i don't know how but i think your new code did it    
				
(This post was last modified: 10-08-2012, 02:14 PM by naseem142.)
 |  |  
	| 10-08-2012, 02:14 PM |  |  |