| 
		
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| Something weird is happening with my script. 
 
				I was making a final script for a level of mine, where you have to hit a wall with a sledge to destroy it, so you can go to the other side. However, when I hit the area with the sledge, nothing happens. void OnStart(){
 AddEntityCollideCallback("Sledge_1", "Area_use_sledge", "Destroywall", true, 1);
 }
 
 void Destroywall (string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("cracks_brown_1", false);
 SetEntityActive("cellarbase_wall_cracked_2", false);
 SetEntityActive("cellarbase_wall_cracked_1", false);
 SetEntityActive("cellarbase_wall_destroyable_1", true);
 CreateParticleSystemAtEntity("Particle_dust", "ps_dust_break_25.ps", "Area_use_sledge", false);
 PlaySoundAtEntity("Destroydawall", "explosion_rock_large.snt", "Player", 0.1, false);
 }
The curious thing is that if I try exactly the same script with the exact names in another map, it works...
 
Any clue of this?
			
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan.
				
(This post was last modified: 07-02-2013, 12:38 PM by The chaser.)
 |  |  
	| 07-02-2013, 12:36 PM |  |  
	
		| Adrianis   Senior Member
 
 Posts: 620
 Threads: 6
 Joined: Feb 2012
 Reputation: 
27
 | 
			| RE: Something weird is happening with my script. 
 
				So does nothing at all from that function work, as in, there's no sound playing & no particles showing? And there is no error?
			 
 
				
(This post was last modified: 07-02-2013, 01:18 PM by Adrianis.)
 |  |  
	| 07-02-2013, 01:17 PM |  |  
	
		| Wapez   Senior Member
 
 Posts: 360
 Threads: 37
 Joined: Mar 2012
 Reputation: 
19
 | 
			| RE: Something weird is happening with my script. 
 
				
Double check all the names in the HPL Level EditorDouble check all the names in the scriptMake sure that there is no other function in your script that might trigger this one to not workRemove the space after calling the Destroywall function
 
 Should be:void Destroywall (string &in asParent, string &in asChild, int alState)
 void Destroywall(string &in asParent, string &in asChild, int alState)
That's all I got for now. If it still doesn't work, send me the files and I'll fix it for you.
 
 
 
 
				
(This post was last modified: 07-02-2013, 01:21 PM by Wapez.)
 |  |  
	| 07-02-2013, 01:18 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Something weird is happening with my script. 
 
				Well, now that I realize, I haven't told much from the necessary:
 -There is no map_cache
 -The names are okay
 -I tried the EXACT script in another map, with the SAME names and it worked
 -It doesn't give any kind of error, it just doesn't work.
 
 Well, I'll just send the files to Wapez, to see if he can fix it.
 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 07-02-2013, 02:24 PM |  |  
	
		| 7heDubz   Posting Freak
 
 Posts: 1,329
 Threads: 40
 Joined: Feb 2013
 Reputation: 
41
 | 
			| RE: Something weird is happening with my script. 
 
				 (07-02-2013, 02:24 PM)The chaser Wrote:  Well, now that I realize, I haven't told much from the necessary:
 -There is no map_cache
 -The names are okay
 -I tried the EXACT script in another map, with the SAME names and it worked
 -It doesn't give any kind of error, it just doesn't work.
 
 Well, I'll just send the files to Wapez, to see if he can fix it.
 
in the script put in a debug message and then try to do it in the unworking map again. do you get the debug message?
			 
 |  |  
	| 07-03-2013, 12:46 PM |  |  
	
		| Daemian   Posting Freak
 
 Posts: 1,129
 Threads: 42
 Joined: Dec 2012
 Reputation: 
49
 | 
			| RE: Something weird is happening with my script. 
 
				This happened to me once, but i don't remember what was the problem right now.
 I think i had the area disabled. You should check that.
 And your script is not long, why don't you just make it again from scratch?
 
 
				
(This post was last modified: 07-03-2013, 06:24 PM by Daemian.)
 |  |  
	| 07-03-2013, 06:12 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Something weird is happening with my script. 
 
				Weird, apparently it breaks if I put "Player" instead "Sledge_1"... 
I will have to search a similar item to make the effect   
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 07-03-2013, 07:55 PM |  |  |