Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
AddEntityCollideCallback FAIL 
			 
			
				Every single time I try to script the "AddEntityCollideCallback" thingy, NOTHING HAPPENS. So, I'm finally asking for help. I've put the area in the level editor, I scripted just like in the wiki tutorials, and I'm sure the names are correct. I don't know why i can't make this ship work! Won't you please, please help me? 
 
This is the part of the .hps script that matters: 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1() 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
And, as I said, the area is there. With the same name. So is the bottle. And the door. And all. 
I need somebody, help! 
			 
			
			
			
		 |  
	 
 | 
 
	| 10-29-2011, 10:35 PM  | 
	
		
	 | 
 
 
	
		
		devin413 
 
 
		
			Member 
			
			
			
 
			
	Posts: 175 
	Threads: 7 
	Joined: Jul 2011
	
 Reputation: 
3
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1(string &in asParent, string &in asChild, int alState) 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
 
you forgot (string &in asParent, string &in asChild, int alState) 
 
np dude ^^
			 
			
			
 
Boris Game Studios: Devin413 Moddels Maps Scripts. 
Tenebris Lake 
Killings In Altstadt  
 
			
				
(This post was last modified: 10-29-2011, 11:31 PM by devin413.)
 
				
			 
		 |  
	 
 | 
 
	| 10-29-2011, 11:31 PM  | 
	
		
	 | 
 
 
	
		
		flamez3 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,281 
	Threads: 48 
	Joined: Apr 2011
	
 Reputation: 
57
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				 (10-29-2011, 10:35 PM)Victor Wrote:  Every single time I try to script the "AddEntityCollideCallback" thingy, NOTHING HAPPENS. So, I'm finally asking for help. I've put the area in the level editor, I scripted just like in the wiki tutorials, and I'm sure the names are correct. I don't know why i can't make this ship work! Won't you please, please help me? 
 
This is the part of the .hps script that matters: 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1() 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
And, as I said, the area is there. With the same name. So is the bottle. And the door. And all. 
I need somebody, help! You have decimals on the "AddPropForce" event, you would probably need to put an f on the end of each float. 
 
e.g: AddPropForce("wine01_1", -8.738f, 0.945f, -8.775f, "world");
			  
			
			
 
			
				
(This post was last modified: 10-30-2011, 12:06 AM by flamez3.)
 
				
			 
		 |  
	 
 | 
 
	| 10-30-2011, 12:06 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				 (10-29-2011, 11:31 PM)devin413 Wrote:  //////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1(string &in asParent, string &in asChild, int alState) 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
 
you forgot (string &in asParent, string &in asChild, int alState) 
 
np dude ^^ Wasn't working WITH this, so I tried to take it off, but... this isn't the problem.
			  
			
			
			
		 |  
	 
 | 
 
	| 10-30-2011, 12:09 AM  | 
	
		
	 | 
 
 
	
		
		flamez3 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,281 
	Threads: 48 
	Joined: Apr 2011
	
 Reputation: 
57
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				 (10-30-2011, 12:09 AM)Victor Wrote:   (10-29-2011, 11:31 PM)devin413 Wrote:  //////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1(string &in asParent, string &in asChild, int alState) 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
 
you forgot (string &in asParent, string &in asChild, int alState) 
 
np dude ^^ Wasn't working WITH this, so I tried to take it off, but... this isn't the problem. You need "(string &in asParent, string &in asChild, int alState)"...don't take it off.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 10-30-2011, 12:32 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				 (10-30-2011, 12:32 AM)flamez3 Wrote:   (10-30-2011, 12:09 AM)Victor Wrote:   (10-29-2011, 11:31 PM)devin413 Wrote:  //////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "bottlescare", "BottleFunc1", true, 1); 
} 
 
void BottleFunc1(string &in asParent, string &in asChild, int alState) 
{ 
AddPropForce("wine01_1", -8.738, 0.945, -8.775, "world"); 
SetSwingDoorClosed("mansion_1", true, true); 
PlaySoundAtEntity("", "general_thunder8", "Player", 0, false); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(7.0f, true); 
} 
 
 
you forgot (string &in asParent, string &in asChild, int alState) 
 
np dude ^^ Wasn't working WITH this, so I tried to take it off, but... this isn't the problem. You need "(string &in asParent, string &in asChild, int alState)"...don't take it off. Doesn't work anyway! I know because I already put it back!
			  
			
			
			
				
(This post was last modified: 10-30-2011, 01:55 AM by Victor.)
 
				
			 
		 |  
	 
 | 
 
	| 10-30-2011, 01:52 AM  | 
	
		
	 | 
 
 
	
		
		devin413 
 
 
		
			Member 
			
			
			
 
			
	Posts: 175 
	Threads: 7 
	Joined: Jul 2011
	
 Reputation: 
3
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				lol i test it on a test map and it works 
 
area name = bottlescare ? 
 
AddPropImpulse("wine01_1", 5, 5, 5, "World"); 
 
propimpulse is better i think
			 
			
			
 
Boris Game Studios: Devin413 Moddels Maps Scripts. 
Tenebris Lake 
Killings In Altstadt  
 
			
				
(This post was last modified: 10-30-2011, 02:24 AM by devin413.)
 
				
			 
		 |  
	 
 | 
 
	| 10-30-2011, 02:18 AM  | 
	
		
	 | 
 
 
	
		
		MrBigzy 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 616 
	Threads: 18 
	Joined: Mar 2011
	
 Reputation: 
8
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				Yea, I'd doublecheck to make sure your script area is called bottlescare. It's case sensitive as well. 
			 
			
			
			
		 |  
	 
 | 
 
	| 10-30-2011, 03:00 AM  | 
	
		
	 | 
 
 
	
		
		Victor 
 
 
		
			Member 
			
			
			
 
			
	Posts: 83 
	Threads: 19 
	Joined: Oct 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				Yes, it is bottlescare. I'm sure! 
I don't think it is "propimpulse", it is not like this in the tutorial. 
In the tutorial it's "PropImpulse" allright.
			 
			
			
			
				
(This post was last modified: 10-30-2011, 03:14 AM by Victor.)
 
				
			 
		 |  
	 
 | 
 
	| 10-30-2011, 03:13 AM  | 
	
		
	 | 
 
 
	
		
		Apjjm 
 
 
		
			Is easy to say 
			
			
			
 
			
	Posts: 496 
	Threads: 18 
	Joined: Apr 2011
	
 Reputation: 
52
		
	 | 
	
		
			
RE: AddEntityCollideCallback FAIL 
			 
			
				 (10-30-2011, 12:06 AM)flamez3 Wrote:  You have decimals on the "AddPropForce" event, you would probably need to put an f on the end of each float.  
 
e.g: AddPropForce("wine01_1", -8.738f, 0.945f, -8.775f, "world"); Whilst it isn't necessary, you are correct in stating and doing this, as it is  good practice to add the "f" after the decimal numbers to state that they are "floats" rather than "doubles". I say this merely because otherwise, you may get warning messages mixed in any error messages when compiling your script. These appear in both the log files and the error message box if errors occur (otherwise they are just ignored), and if sufficient in number, waste time trying to scan through them to see the actual relevant info.
			  
			
			
			
				
(This post was last modified: 10-30-2011, 03:36 AM by Apjjm.)
 
				
			 
		 |  
	 
 | 
 
	| 10-30-2011, 03:36 AM  | 
	
		
	 | 
 
 
	 
 |