| 
		
	
		| EthanLancaster   Junior Member
 
 Posts: 15
 Threads: 9
 Joined: Mar 2012
 Reputation: 
0
 | 
			| Please Help! 
 
				Ive been trying to find the error in this script for about an hour! Im really bad at it please help!
 void OnStart ( )
 {
 AddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
 }
 void UsedKeyOnDoor(string &in asEntity, int alState)
 void GetStartPoint(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorLocked("mansion_1", false, true);
 AddQuest ( "investigate", "Investigate" ) ;
 }
 
 void FinishStartPoint(string &in asParent, string &in asChild, int alState)
 {
 CompleteQuest ( "investigate", "Investigate" ) ;
 }
 
 
 |  |  
	| 03-15-2012, 05:16 AM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: Please Help! 
 
				Do research on how to define a function.
			 
 |  |  
	| 03-15-2012, 06:54 AM |  |  
	
		| Equil   Member
 
 Posts: 94
 Threads: 8
 Joined: Sep 2010
 Reputation: 
0
 | 
			| RE: Please Help! 
 
				Um, could you explain exactly what you're trying to achieve with this script? Unlock a door then start a quest?
 |  |  
	| 03-15-2012, 07:16 AM |  |  
	
		| Strembitsky   Senior Member
 
 Posts: 254
 Threads: 37
 Joined: Feb 2012
 Reputation: 
3
 | 
			| RE: Please Help! 
 
				You're missing an immense amount of quotations in your script. Do what Your Computer said.
			 
 The Nightmares v1.0  - Dreadful Fires WIP |  |  
	| 03-15-2012, 02:23 PM |  |  
	
		| Xanthos   Senior Member
 
 Posts: 318
 Threads: 9
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: Please Help! 
 
				I see this errorAddUseItemCallback("", "LibraryKey, mansion_1, UsedKeyOnDoor, true);
 
 See this ["LibraryKey]
 Add them "
 FIXED ["LibraryKey"]
 See this [mansion_1]
 FIXED ["mansion_1"]
 
 --And I would add this to the scripts--
 GiveSanityBoostSmall();
 OR
 GiveSanityBoost();
 ----
 
 PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
 RemoveItem("LibraryKey");
 -----------------Now Here I fix it all At once--------------
 void OnStart ()
 {
 AddUseItemCallback("", "LibraryKey", "mansion_1", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
 }
 void UsedKeyOnDoor(string &in asEntity, int alState)
 {
 SetSwingDoorLocked("mansion_1", false, true);
 
 PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
 RemoveItem("LibraryKey");
 GiveSanityBoostSmall();
 }
 
 void GetStartPoint(string &in asParent, string &in asChild, int alState)
 {
 AddQuest ( "investigate", "Investigate" ) ;
 PlayGuiSound("react_breath_slow", 0.5f);
 }
 
 void FinishStartPoint(string &in asParent, string &in asChild, int alState)
 {
 CompleteQuest ( "investigate", "Investigate" ) ;
 GiveSanityBoostSmall();
 }
 
 -----------------------------
 Plug that shit in and if a message pops up.
 Reply that message so I can fixy
 
				
(This post was last modified: 03-16-2012, 01:21 AM by Xanthos.)
 |  |  
	| 03-16-2012, 01:19 AM |  |  
	
		| EthanLancaster   Junior Member
 
 Posts: 15
 Threads: 9
 Joined: Mar 2012
 Reputation: 
0
 | 
			| RE: Please Help! 
 
				Thank you!!! I no longer get an error but the key will not go to the door. It says cannot use item this way. :/ Do I have to connect the props somehow? Thanks again for your help!
			 |  |  
	| 03-16-2012, 06:54 PM |  |  
	
		| EthanLancaster   Junior Member
 
 Posts: 15
 Threads: 9
 Joined: Mar 2012
 Reputation: 
0
 | 
			| RE: Please Help! 
 
				Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!
 void OnStart ()
 {
 AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
 }
 void KeyOnDoor(string &in asEntity)
 {
 SetSwingDoorLocked("mansion_2", false, true);
 PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
 RemoveItem("LibraryKey");
 GiveSanityBoostSmall();
 }
 
 void GetStartPoint(string &in asParent, string &in asChild, int alState)
 {
 AddQuest("investigate","Investigate");
 PlayGuiSound("react_breath_slow", 0.5f);
 }
 
 void FinishStartPoint(string &in asParent, string &in asChild, int alState)
 {
 CompleteQuest("investigate","Investigate") ;
 GiveSanityBoostSmall();
 }
 
 
 
 
 |  |  
	| 03-16-2012, 08:12 PM |  |  
	
		| Xanthos   Senior Member
 
 Posts: 318
 Threads: 9
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: Please Help! 
 
				 (03-16-2012, 08:12 PM)EthanLancaster Wrote:  Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance!
 void OnStart ()
 {
 AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
 }
 void KeyOnDoor(string &in asEntity)
 {
 SetSwingDoorLocked("mansion_2", false, true);
 PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
 RemoveItem("LibraryKey");
 GiveSanityBoostSmall();
 }
 
 void GetStartPoint(string &in asParent, string &in asChild, int alState)
 {
 AddQuest("investigate","Investigate");
 PlayGuiSound("react_breath_slow", 0.5f);
 }
 
 void FinishStartPoint(string &in asParent, string &in asChild, int alState)
 {
 CompleteQuest("investigate","Investigate") ;
 GiveSanityBoostSmall();
 }
 I decided to post this on your thread so others can see. 
The Error 
void KeyOnDoor(string &in asEntity) 
 
This Fixed 
void KeyOnDoor(string &in asItem, string &in asEntity)
			 
 |  |  
	| 03-16-2012, 09:42 PM |  |  
	
		| EthanLancaster   Junior Member
 
 Posts: 15
 Threads: 9
 Joined: Mar 2012
 Reputation: 
0
 | 
			| RE: Please Help! 
 
				 (03-16-2012, 09:42 PM)Xanthos Wrote:   (03-16-2012, 08:12 PM)EthanLancaster Wrote:  Here is my current script. Please help im so lost. It says cannot use item this way every time. Thanks in advance! I decided to post this on your thread so others can see.
 void OnStart ()
 {
 AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
 AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
 }
 void KeyOnDoor(string &in asEntity)
 {
 SetSwingDoorLocked("mansion_2", false, true);
 PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
 RemoveItem("LibraryKey");
 GiveSanityBoostSmall();
 }
 
 void GetStartPoint(string &in asParent, string &in asChild, int alState)
 {
 AddQuest("investigate","Investigate");
 PlayGuiSound("react_breath_slow", 0.5f);
 }
 
 void FinishStartPoint(string &in asParent, string &in asChild, int alState)
 {
 CompleteQuest("investigate","Investigate") ;
 GiveSanityBoostSmall();
 }
 The Error
 void KeyOnDoor(string &in asEntity)
 
 This Fixed
 void KeyOnDoor(string &in asItem, string &in asEntity)
 
That fixed it! Thank you!!!
			 |  |  
	| 03-16-2012, 10:14 PM |  |  |