| 
		
	
		| Janni1234   Member
 
 Posts: 134
 Threads: 24
 Joined: Jan 2011
 Reputation: 
1
 | 
			| Wrong script!Why!? 
 
				My scripting file:
 void OnStart()
 {
 PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
 }
 
 void OnEnter()
 {
 AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1);
 PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
 
 }
 
 void scare1(string &in asParent , string &in asChild , int alState)
 {
 PlaySoundAtEntity("", "04_hole_squeal.snt", "candlestick_floor_1", 0, false);
 |  |  
	| 01-05-2011, 10:54 AM |  |  
	
		| ModManDann   Member
 
 Posts: 61
 Threads: 6
 Joined: Dec 2010
 Reputation: 
0
 | 
			| RE: Wrong script!Why!? 
 
				you forgot } on the end.
 Might be helpfull if you also post the error report you are getting.
 
 |  |  
	| 01-05-2011, 10:59 AM |  |  
	
		| DIGI Byte   Senior Member
 
 Posts: 376
 Threads: 20
 Joined: Dec 2010
 Reputation: 
1
 | 
			| RE: Wrong script!Why!? 
 
				 (01-05-2011, 10:59 AM)ModManDann Wrote:  you forgot } on the end.
 Might be helpfull if you also post the error report you are getting.
 
also he's not using this correctly; 
void scare1(string &in asParent , string &in asChild , int alState)
 
should be something like 
void scare1(string &in asParent)
 
I'm not in the mood to look up the proper use and syntax
			 |  |  
	| 01-05-2011, 11:07 AM |  |  
	
		| Janni1234   Member
 
 Posts: 134
 Threads: 24
 Joined: Jan 2011
 Reputation: 
1
 | 
			| RE: Wrong script!Why!? 
 
				Okay Thanks!   
 
But whats wrong with that?: 
        }      
 
void guardian1(string &in asParent , string &in asChild , int alState) 
        { 
                PlaySoundAtEntity("", "guardian_distant3.snt", "storage_box_wood02_1", 0, false); 
        }
			
				
(This post was last modified: 01-05-2011, 11:59 AM by Janni1234.)
 |  |  
	| 01-05-2011, 11:27 AM |  |  
	
		| Janni1234   Member
 
 Posts: 134
 Threads: 24
 Joined: Jan 2011
 Reputation: 
1
 | 
			| Is that right!?scripting 
 
				  
void OnStart() 
        { 
                PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false); 
        }       
 
void OnEnter() 
        {        
                AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1); 
                PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false); 
                AddEntityCollideCallback("player", "guardian_1", "guardian1", true, 1); 
        }
 
void scare1(string &in asParent , string &in asChild , int alState) 
	{          
                PlaySoundAtEntity("", "04_break02.snt", "candlestick_floor_1", 0, false); 
                PlaySoundAtEntity("", "scare_male_terrified_4.snt", "candlestick_floor_1", 0, false); 
        }      
 
void guardian1(string &in asParent , string &in asChild , int alState) 
        { 
                PlaySoundAtEntity("", "guardian_distant.snt", "Player", 0, false); 
                PlaySoundAtEntity("", "guardian_idle.snt", "Player", 0, false);
			 |  |  
	| 01-05-2011, 02:04 PM |  |  
	
		| jens   Frictional Games
 
 Posts: 4,093
 Threads: 199
 Joined: Apr 2006
 Reputation: 
202
 | 
			| RE: Is that right!?scripting 
 
				Don't make a new thread for the same thing, use your old thread.
 you are missing a } at the end again.
 
				
(This post was last modified: 01-05-2011, 03:06 PM by jens.)
 |  |  
	| 01-05-2011, 03:05 PM |  |  
	
		| Mofo   Member
 
 Posts: 71
 Threads: 4
 Joined: Sep 2010
 Reputation: 
2
 | 
			| RE: Wrong script!Why!? 
 
				void OnStart(){
 AddEntityCollideCallback("Player", "scare_1", "scare1", true, 1);
 AddEntityCollideCallback("Player", "guardian_1", "guardian1", true, 1);
 }
 
 void OnEnter()
 {
 PlayMusic("01_amb_darkness.ogg", true, 0.7f, 1, 0, false);
 }
 
 void scare1(string &in asParent , string &in asChild , int alState)
 {
 AddDebugMessage("scare1", false);
 PlaySoundAtEntity("scaresound1", "04_break02.snt", "candlestick_floor_1", 0, false);
 PlaySoundAtEntity("scaresound2", "scare_male_terrified.snt", "candlestick_floor_1", 0, false);
 }
 
 void guardian1(string &in asParent , string &in asChild , int alState)
 {
 AddDebugMessage("guardian1", false);
 PlaySoundAtEntity("guardiansound1", "guardian_distant.snt", "Player", 0, false);
 PlaySoundAtEntity("guardiansound2", "guardian_idle.snt", "Player", 0, false);
 }
 
 
 
 There. That should work.
 
				
(This post was last modified: 01-05-2011, 03:23 PM by Mofo.)
 |  |  
	| 01-05-2011, 03:22 PM |  |  
	
		| Janni1234   Member
 
 Posts: 134
 Threads: 24
 Joined: Jan 2011
 Reputation: 
1
 | 
			| RE: Wrong script!Why!? 
 
				@Jens : okay sorry   
@Mofo:Thanks man! 
And yes right!Thanks.
			 |  |  
	| 01-05-2011, 03:44 PM |  |  
	
		| Janni1234   Member
 
 Posts: 134
 Threads: 24
 Joined: Jan 2011
 Reputation: 
1
 | 
			| RE: Wrong script!Why!? 
 
				I`ve tried a new map.void OnStart()
 {
 AddEntityCollideCallback("Player", "area_scare_1", "areascare1", true, 1);
 PlayMusic("12_amb.ogg"), true, 0.7f, 1, 0, false);
 }
 
 void OnEnter()
 {
 PlayMusic("12_amb.ogg"), true, 0.7f, 1, 0, false);
 }
 
 void areascare1(string &in asParent , string &in asChild , int alState)
 {
 PlaySoundAtEntity("Player", "04_hole_squeal.snt", "candle_floor_1", 0, false);
 }
 
 Are there any mistakes!?
 |  |  
	| 01-05-2011, 05:55 PM |  |  
	
		| Akumasama   Member
 
 Posts: 122
 Threads: 2
 Joined: Nov 2010
 Reputation: 
0
 | 
			| RE: Wrong script!Why!? 
 
				You should also post the error message you're getting.I'm not sure what's wrong right now so yeah...
 |  |  
	| 01-05-2011, 06:01 PM |  |  |