| 
		
	
		| MaksoPL   Member
 
 Posts: 51
 Threads: 26
 Joined: Mar 2014
 Reputation: 
0
 | 
			| Script Error 
 
				Hi, I've maked script to show message when I click on the object. I clicked on object in game, and message don't showed up..hps script:
 
 ...
 void CarScript(string &in asEntity)
 {
 if(GetLocalVarInt("Switch") == 0)
 {
 SetEntityCallbackFunc("CarScript","Info");
 }
 }
 
 void Info(string &in asItem, string &in asEntity)
 {
 SetMessage("Message","CarScript",0);
 }
 
 What i must do?
 |  |  
	| 07-01-2015, 06:50 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: Script Error 
 
				 (07-01-2015, 06:50 PM)MaksoPL Wrote:  Hi, I've maked script to show message when I click on the object. I clicked on object in game, and message don't showed up..hps script:
 
 ...
 void CarScript(string &in asEntity)
 {
 if(GetLocalVarInt("Switch") == 0)
 {
 SetEntityCallbackFunc("CarScript","Info");
 }
 }
 
 void Info(string &in asItem, string &in asEntity)
 {
 SetMessage("Message","CarScript",0);
 }
 
 What i must do?
 
Go to your level editor, and Click on the object. Then go to the entity tab, and type in the " PlayerInteractCallBack" the name, lik you used. Info
 
so type in Info  in the tab, and then :
 
void Info(string &in asEntity) 
{ 
SetMessage("Message", "CarScript", 0); 
}
 
Let me know if it worked. 
Btw, if you want this for the static objects to, Then just create an area and do the same stuff.
			 |  |  
	| 07-01-2015, 08:42 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Script Error 
 
				Looking away from your script, and just at what you said I'd presume what you want is
 void Info(string &in asEntity)
 {
 SetMessage("Message","CarScript", 0);
 }
 
 Then put this in void OnStart()
 
 SetEntityPlayerInteractCallback(NameOfEntity, "Info", false);
 
 Trying is the first step to success. |  |  
	| 07-01-2015, 10:04 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: Script Error 
 
				 (07-01-2015, 10:04 PM)FlawlessHappiness Wrote:  Looking away from your script, and just at what you said I'd presume what you want is
 void Info(string &in asEntity)
 {
 SetMessage("Message","CarScript", 0);
 }
 
 Then put this in void OnStart()
 
 SetEntityPlayerInteractCallback(NameOfEntity, "Info", false);
 
You don't need the setentityplayerinteractcallback, this is possible in the entity tab itself, for the entities. right?
			 |  |  
	| 07-01-2015, 10:11 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Script Error 
 
				 (07-01-2015, 10:11 PM)Amnesiaplayer Wrote:   (07-01-2015, 10:04 PM)FlawlessHappiness Wrote:  Looking away from your script, and just at what you said I'd presume what you want is
 void Info(string &in asEntity)
 {
 SetMessage("Message","CarScript", 0);
 }
 
 Then put this in void OnStart()
 
 SetEntityPlayerInteractCallback(NameOfEntity, "Info", false);
 You don't need the setentityplayerinteractcallback, this is possible in the entity tab itself, for the entities. right?
 
It is. But that's harder to explain, and I'd rather just avoid communication errors.
			 
 Trying is the first step to success. |  |  
	| 07-02-2015, 01:24 AM |  |  
	
		| Romulator   Not Tech Support ;-)
 
 Posts: 3,628
 Threads: 63
 Joined: Jan 2013
 Reputation: 
195
 | 
			| RE: Script Error 
 
				 (07-01-2015, 10:11 PM)Amnesiaplayer Wrote:   (07-01-2015, 10:04 PM)FlawlessHappiness Wrote:  Looking away from your script, and just at what you said I'd presume what you want is
 void Info(string &in asEntity)
 {
 SetMessage("Message","CarScript", 0);
 }
 
 Then put this in void OnStart()
 
 SetEntityPlayerInteractCallback(NameOfEntity, "Info", false);
 You don't need the setentityplayerinteractcallback, this is possible in the entity tab itself, for the entities. right?
 
It's arguably better to not use those. It's easier to look over your code when it is bound within the scope of just the hps file. I for one find it ridiculously tedious going back and forth between my Level Editor and Notepad++, but it could of course just be a matter of preference.
			 
 Discord: Romulator#0001
![[Image: 3f6f01a904.png]](https://puu.sh/zOxJg/3f6f01a904.png) |  |  
	| 07-02-2015, 02:39 AM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Script Error 
 
				 (07-02-2015, 02:39 AM)Romulator Wrote:  It's arguably better to not use those. It's easier to look over your code when it is bound within the scope of just the hps file. I for one find it ridiculously tedious going back and forth between my Level Editor and Notepad++, but it could of course just be a matter of preference. 
To me, it just depends on how sure I am with what I'm making. 
If I know exactly what I'm doing, then I don't mind using the level editor ones.
			 
 Trying is the first step to success. |  |  
	| 07-02-2015, 11:45 AM |  |  
	
		| Radical Batz   Posting Freak
 
 Posts: 953
 Threads: 145
 Joined: Dec 2013
 Reputation: 
25
 | 
			| RE: Script Error 
 
				Make sure that the lange file has the same entry as the SetMessage code.
			 
 |  |  
	| 07-02-2015, 12:11 PM |  |  |