Andehande 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 2 
	Threads: 1 
	Joined: Mar 2012
	
 Reputation: 
0
		
	 | 
	
		
			
Flying Jesus Help? 
			 
			
				I need help with the "Flying Jesus Script" 
 
Error is : FATAL ERROR: Could not load script file 'custom_stories/TheChallenge/Maps/Chocolatebar.hps'! 
main (23,1) : ERR Unexpected Token '{' 
 
I just cant make it work... Here is the script 
 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
 
//////////////////////////// 
// Key to first door 
 
{ 
 AddUseItemCallback("", "Storage Room Key", "Kolmonen", "UsedKeyOnDoor", true); 
} 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
	SetSwingDoorLocked("Kolmonen", false, true); 
 PlaySoundAtEntity("", "unlock_door", "Kolmonen", 0, false); 
	RemoveItem("Storage Room Key"); 
} 
 
/////////////////////////// 
// Teleporting Naked Guy 
 
 
{ <-- This is (23,1)  
AddEntityCollideCallback("Player", "FlyingJesus", "HolyJesus", true, 1)  
AddEntityCollideCallback("Jesus", "FlyingJesus", "Sound", true, 1) 
} 
  
void HolyJesusJesus(string &in asParent, string &in asChild, int alState) 
 
{ 
SetEntityActive("Jesus", true) 
AddPropForce("Jesus", 0, 0, 30000, "World") 
} 
  
void Sound(string &in asParent, string &in asChild, int alState) 
{ 
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false); 
} 
 
 
//////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
  
} 
  
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
  
} 
 
 
Please help me :/
			 
			
			
			
		 |  
	 
 | 
 
	| 03-10-2012, 10:25 AM  | 
	
		
	 | 
 
 
	
		
		Stepper321 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 263 
	Threads: 26 
	Joined: Nov 2011
	
 Reputation: 
8
		
	 | 
	
		
			
RE: Flying Jesus Help? 
			 
			
				theres no; void name(syntax)  
I see you tried to make a callback when something happens, but nothing happends cause there are no callbacks WHERE something happens. You will need to create the callback func when start or enter the map, i recommend OnEnter, it doens't get problem the most.  
Here is your fixed script. Quote://////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
 
} 
 
//////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
	AddEntityCollideCallback("Player", "FlyingJesus", "HolyJesus", true, 1)  
	AddEntityCollideCallback("Jesus", "FlyingJesus", "Sound", true, 1) 
	AddUseItemCallback("", "Storage Room Key", "Kolmonen", "UsedKeyOnDoor", true); 
} 
 
//////////////////////////// 
// Key to first door 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("Kolmonen", false, true); 
PlaySoundAtEntity("", "unlock_door", "Kolmonen", 0, false); 
RemoveItem("Storage Room Key"); 
} 
 
/////////////////////////// 
// Teleporting Naked Guy 
 
void HolyJesusJesus(string &in asParent, string &in asChild, int alState) 
 
{ 
SetEntityActive("Jesus", true) 
AddPropForce("Jesus", 0, 0, 30000, "World") 
} 
 
void Sound(string &in asParent, string &in asChild, int alState) 
{ 
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, false); 
} 
 
 
 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
 
} 
			 
			
			
 
Signature to awesome to be displayed. 
			
				
(This post was last modified: 03-10-2012, 12:12 PM by Stepper321.)
 
				
			 
		 |  
	 
 | 
 
	| 03-10-2012, 12:09 PM  | 
	
		
	 | 
 
 
	
		
		JMFStorm 
 
 
		
			Member 
			
			
			
 
			
	Posts: 205 
	Threads: 8 
	Joined: Aug 2011
	
 Reputation: 
28
		
	 | 
	
		
			
RE: Flying Jesus Help? 
			 
			
				Also I would recommend you to put these scripts under the void OnStart command 
void OnStart () 
{ 
AddEntityCollideCallback("Player", "FlyingJesus", "HolyJesus", true, 1)  
AddEntityCollideCallback("Jesus", "FlyingJesus", "Sound", true, 1) 
AddUseItemCallback("", "Storage Room Key", "Kolmonen", "UsedKeyOnDoor", true); 
} 
And not under the "void OnEnter" if you don't want those functions to happen again if the player leaves the map and comes back. 
			 
			
			
 
			
		 |  
	 
 | 
 
	| 03-10-2012, 05:30 PM  | 
	
		
	 | 
 
 
	
		
		Stepper321 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 263 
	Threads: 26 
	Joined: Nov 2011
	
 Reputation: 
8
		
	 | 
	
		
			
RE: Flying Jesus Help? 
			 
			
				 (03-10-2012, 05:30 PM)JMFStorm Wrote:  Also I would recommend you to put these scripts under the void OnStart command 
void OnStart () 
{ 
AddEntityCollideCallback("Player", "FlyingJesus", "HolyJesus", true, 1)  
AddEntityCollideCallback("Jesus", "FlyingJesus", "Sound", true, 1) 
AddUseItemCallback("", "Storage Room Key", "Kolmonen", "UsedKeyOnDoor", true); 
} 
And not under the "void OnEnter" if you don't want those functions to happen again if the player leaves the map and comes back. But it messed everything at mine. 
			  
			
			
 
Signature to awesome to be displayed. 
			
		 |  
	 
 | 
 
	| 03-10-2012, 06:43 PM  | 
	
		
	 | 
 
 
	 
 |