| 
		
	
		| Fishnugget   Member
 
 Posts: 72
 Threads: 6
 Joined: Aug 2012
 Reputation: 
1
 | 
			| Game Problems 
 
				So, im sure I will have many problems with my custom Story during the editing. So I open a Thread for this problems^^'So my Problem in this moment is weird....
 I want to make a Jump Scare. A grunt Body have to teleporting front of the player. This works perfectly. But it doesnt dissapear. I write in another Area the same but I change from True to False. It doesn't Work...
 Why?
 
 
 This is the using Script:
 
 
 
 AddEntityCollideCallback("Player", "ScriptArea_2", "TOTSCHRECK", true, 1);
 AddEntityCollideCallback("Player", "ScriptArea_3", "AndereArea2", true, 1);
 }
 
 void TOTSCHRECK(string &in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("", "bam.snt", "Player", 0, false);
 GiveSanityDamage(5.0f, true);
 SetEntityActive("grunt_body_part2_2", true);
 }
 
 void AndereArea2(string &in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
 GiveSanityDamage(5.0f, true);
 SetEntityActive("grunt_body_part2_2", false);
 }
 
 Whats wrong?
 
				
(This post was last modified: 12-06-2012, 05:04 PM by Fishnugget.)
 |  |  
	| 12-06-2012, 05:00 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Game Problems 
 
				Wouldn't it be more logical making a timer for this? Anyways, I don't see anything wrong. Delete map_cache's, check the names, etc.
 A timer would be:
 
 AddEntityCollideCallback("Player", "ScriptArea_2", "TOTSCHRECK", true, 1);
 
 }
 
 
 
 void TOTSCHRECK(string &in asParent, string &in asChild, int alState)
 
 {
 
 PlaySoundAtEntity("", "bam.snt", "Player", 0, false);
 
 GiveSanityDamage(5.0f, true);
 
 SetEntityActive("grunt_body_part2_2", true);
 AddTimer("", secondstodoit, "AndereArea2");
 
 }
 
 
 
 void AndereArea2(string &in asTimer)
 
 {
 
 PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
 
 GiveSanityDamage(5.0f, true);
 
 SetEntityActive("grunt_body_part2_2", false);
 
 }
 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 12-06-2012, 05:14 PM |  |  
	
		| Fishnugget   Member
 
 Posts: 72
 Threads: 6
 Joined: Aug 2012
 Reputation: 
1
 |  |  
	| 12-06-2012, 05:32 PM |  |  
	
		| xxxxxxxxxxxxxxxx   Posting Freak
 
 Posts: 935
 Threads: 0
 Joined: Jun 2012
 Reputation: 
54
 | 
			| RE: Game Problems 
 
				Even though I'm a complete and utter scripting-noob, that made me chuckle   (Try writing the amount of seconds there, not the word "secondstodoit"...) |  |  
	| 12-06-2012, 05:40 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Game Problems 
 
				 (12-06-2012, 05:32 PM)Fishnugget Wrote:  Now comes this:http://i46.servimg.com/u/f46/17/76/85/90/2012_112.jpg
 Ehem... it was a text for you to understand what to put... you must put a number (the seconds to do it). 
Like:
 
AddTimer("", 1, "AndereArea2");
 
You just copy-pasted the script, right?
			 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 12-06-2012, 06:21 PM |  |  
	
		| Fishnugget   Member
 
 Posts: 72
 Threads: 6
 Joined: Aug 2012
 Reputation: 
1
 | 
			| RE: Game Problems 
 
				I want that a door explodes, when I arrive in an area. How can I make that?
			 |  |  
	| 12-07-2012, 07:21 AM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Game Problems 
 
				When you collide with the area use the line:SetPropHealth("INSERTDOORNAMEHERE", 0);
 
 Trying is the first step to success. |  |  
	| 12-07-2012, 08:03 AM |  |  
	
		| Fishnugget   Member
 
 Posts: 72
 Threads: 6
 Joined: Aug 2012
 Reputation: 
1
 | 
			| RE: Game Problems 
 
				Thats the whole Script?Don't I have to write wich area?
 |  |  
	| 12-07-2012, 08:06 AM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Game Problems 
 
				Of course you do! But if you don't know how to write it, then i recommend you to check out basic scripting first    I can reveal that you have to use AddEntityCollideCallback. Makes sense since you collide with an area   
Then use the line i provided
			
 Trying is the first step to success. |  |  
	| 12-07-2012, 08:55 AM |  |  
	
		| Fishnugget   Member
 
 Posts: 72
 Threads: 6
 Joined: Aug 2012
 Reputation: 
1
 | 
			| RE: Game Problems 
 
				Does an Tutorial exist? Sorry i dont get it^^'
			 |  |  
	| 12-07-2012, 02:27 PM |  |  |