z3akx 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 15 
	Threads: 4 
	Joined: Dec 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				So i'll put it like this?   
In the Global.hps
 ////////////////////////////// Run at the start gamevoid OnGameStart(){SetGlobalVarInt("AbandonedHouseDoorUnluck", 0);}
  
In the Forest.hps
 void OnStart(){    PlayMusic("ambience_wind_eerie.ogg", true, 0.4f, 0, 0, false);AddEntityCollideCallback("Player", "ScriptArea_1", "scream", true, 1); SetEntityPlayerLookAtCallback("corpse_male_leg_1", "LookAtScare_1", true);AddEntityCollideCallback("Player", "ScriptArea_2", "Bugs", true, 1);AddEntityCollideCallback("Player", "BreakFence", "OldFence", true, 1);AddEntityCollideCallback("Player", "AreaCaveMonster", "CollideActivateBreath", true, 1); SetEntityPlayerInteractCallback("Cave", "Level_Cave", false);SetEntityPlayerLookAtCallback("Cave", "CaveText", false); SetEntityPlayerInteractCallback("WindowAbandonedHouse", "Level_AbandonedHouse", false); SetEntityPlayerLookAtCallback("WindowAbandonedHouse", "WindowText", false); if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1)} 
SetLevelDoorLocked("Level_AbandonedHouse", false);  
{    else return;}
  
And in AbandonedHouse.hps
 void BreakBlockade(string &in asParent, string &in asChild, int alState) {SetEntityActive("Blockade", false);    SetEntityActive("BlockadeBroken", true); CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);SetEntityActive("Crowbar_2", false);    SetEntityActive("CrowbarBroken", true); PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false); SetLevelDoorLocked("Level_Forest", false);    GiveSanityBoostSmall(); AddGlobalVarInt("AbandonedHouseDoorUnluck", 1);}
  
If not then i dont get it :/  
 (04-30-2012, 06:21 PM)z3akx Wrote:  So i'll put it like this?   
 
In the Global.hps 
 
////////////////////////////// Run at the start gamevoid OnGameStart(){SetGlobalVarInt("AbandonedHouseDoorUnluck", 0);}
  
 
In the Forest.hps 
 
void OnStart(){    PlayMusic("ambience_wind_eerie.ogg", true, 0.4f, 0, 0, false);AddEntityCollideCallback("Player", "ScriptArea_1", "scream", true, 1); SetEntityPlayerLookAtCallback("corpse_male_leg_1", "LookAtScare_1", true);AddEntityCollideCallback("Player", "ScriptArea_2", "Bugs", true, 1);AddEntityCollideCallback("Player", "BreakFence", "OldFence", true, 1);AddEntityCollideCallback("Player", "AreaCaveMonster", "CollideActivateBreath", true, 1); SetEntityPlayerInteractCallback("Cave", "Level_Cave", false);SetEntityPlayerLookAtCallback("Cave", "CaveText", false); SetEntityPlayerInteractCallback("WindowAbandonedHouse", "Level_AbandonedHouse", false); SetEntityPlayerLookAtCallback("WindowAbandonedHouse", "WindowText", false); if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1)} 
SetLevelDoorLocked("Level_AbandonedHouse", false);  
{    else return;}
  
 
And in AbandonedHouse.hps 
 
void BreakBlockade(string &in asParent, string &in asChild, int alState) {SetEntityActive("Blockade", false);    SetEntityActive("BlockadeBroken", true); CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false);SetEntityActive("Crowbar_2", false);    SetEntityActive("CrowbarBroken", true); PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false); SetLevelDoorLocked("Level_Forest", false);    GiveSanityBoostSmall(); AddGlobalVarInt("AbandonedHouseDoorUnluck", 1);}
  
 
If not then i dont get it :/ Wow thats hard as hell to read dont know why it's set it up like that sorry    
			 
			
			
			
				
(This post was last modified: 04-30-2012, 06:22 PM by z3akx.)
 
				
			 
		 |  
	 
 | 
 
	| 04-30-2012, 06:21 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				Could you please make it more readable? xD 
 
you can do that by editing the post ^^
			 
			
			
 
			
				
(This post was last modified: 04-30-2012, 06:47 PM by SilentStriker.)
 
				
			 
		 |  
	 
 | 
 
	| 04-30-2012, 06:35 PM  | 
	
		
	 | 
 
 
	
		
		z3akx 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 15 
	Threads: 4 
	Joined: Dec 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				Im so sorry man that failed xD 
In the Global.hps
 
////////////////////////////// Run at the start game 
void OnGameStart() 
{ 
SetGlobalVarInt("AbandonedHouseDoorUnluck", 0); 
}
 
In the Forest.hps
 
void OnStart(){	PlayMusic("ambience_wind_eerie.ogg", true, 0.4f, 0, 0, false); 
AddEntityCollideCallback("Player", "ScriptArea_1", "scream", true, 1); SetEntityPlayerLookAtCallback("corpse_male_leg_1", "LookAtScare_1", true); 
AddEntityCollideCallback("Player", "ScriptArea_2", "Bugs", true, 1); 
AddEntityCollideCallback("Player", "BreakFence", "OldFence", true, 1); 
AddEntityCollideCallback("Player", "AreaCaveMonster", "CollideActivateBreath", true, 1); SetEntityPlayerInteractCallback("Cave", "Level_Cave", false); 
SetEntityPlayerLookAtCallback("Cave", "CaveText", false); SetEntityPlayerInteractCallback("WindowAbandonedHouse", "Level_AbandonedHouse", false); SetEntityPlayerLookAtCallback("WindowAbandonedHouse", "WindowText", false); if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1) 
} 
SetLevelDoorLocked("Level_AbandonedHouse", false);  
{	else return; 
}
 
And in AbandonedHouse.hps
 
void BreakBlockade(string &in asParent, string &in asChild, int alState)  
{ 
	SetEntityActive("Blockade", false);	 
SetEntityActive("BlockadeBroken", true); 
	CreateParticleSystemAtEntity("breakps", "ps_hit_wood", "AreaBreakEffect", false); 
SetEntityActive("Crowbar_2", false);	 
SetEntityActive("CrowbarBroken", true);  
PlaySoundAtEntity("break","break_wood_metal", "AreaBreakEffect", 0, false); SetLevelDoorLocked("Level_Forest", false);	 
GiveSanityBoostSmall();  
AddGlobalVarInt("AbandonedHouseDoorUnluck", 1); 
}
 
That should be better   
Though i have no idea why the text keeps changing place from how i write it to how it's shown soz   
			 
			
			
			
		 |  
	 
 | 
 
	| 04-30-2012, 06:51 PM  | 
	
		
	 | 
 
 
	
		
		SilentStriker 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 950 
	Threads: 26 
	Joined: Jul 2011
	
 Reputation: 
43
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				Yes everything is correct except:  
if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1)
 
}
 
SetLevelDoorLocked("Level_AbandonedHouse", false); 
 
{	else return;
 
it should be inside OnEnter   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 04-30-2012, 06:52 PM  | 
	
		
	 | 
 
 
	
		
		z3akx 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 15 
	Threads: 4 
	Joined: Dec 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				Okay now im getting this error 
 
FATAL ERROR: Could not load script file 'custom_stories/blabla/bla/blabla/Maps/Forest.hps'! ExecuteString(1, 1) : ERR : No matching signatures to 'OnLeave()'  
main (21,20) : ERR : Expected identifier  
main (22,2) : ERR : Unexpected token '}'  
main (24,2) : ERR : Unexpected token '}'  
 
the "main" part is this 
 
 
void OnStart() 
{ 
if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1) 
	} 
	SetLevelDoorLocked("Level_AbandonedHouse", false);  
	}	 
	else return; 
	} 
} 
 
 
I dont get it -.- 
it's probably because i dont understand how the scripting are connected to one another :-)
			 
			
			
			
		 |  
	 
 | 
 
	| 04-30-2012, 07:40 PM  | 
	
		
	 | 
 
 
	
		
		FragdaddyXXL 
 
 
		
			Member 
			
			
			
 
			
	Posts: 136 
	Threads: 20 
	Joined: Apr 2012
	
 Reputation: 
7
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				 (04-30-2012, 07:40 PM)z3akx Wrote:  Okay now im getting this error 
 
FATAL ERROR: Could not load script file 'custom_stories/blabla/bla/blabla/Maps/Forest.hps'! ExecuteString(1, 1) : ERR : No matching signatures to 'OnLeave()'  
main (21,20) : ERR : Expected identifier  
main (22,2) : ERR : Unexpected token '}'  
main (24,2) : ERR : Unexpected token '}'  
 
the "main" part is this 
 
 
void OnStart() 
{ 
if(GetGlobalVarInt("UnluckAbandonedHouseDoor") == 1) 
	} 
	SetLevelDoorLocked("Level_AbandonedHouse", false);  
	}	 
	else return; 
	} 
} 
 
 
I dont get it -.- 
it's probably because i dont understand how the scripting are connected to one another :-) Check your curly brackets. You have 1 opening curly bracket "{" and 4 closing curly brackets "}".
			  
			
			
 
			
				
(This post was last modified: 04-30-2012, 08:07 PM by FragdaddyXXL.)
 
				
			 
		 |  
	 
 | 
 
	| 04-30-2012, 08:06 PM  | 
	
		
	 | 
 
 
	
		
		z3akx 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 15 
	Threads: 4 
	Joined: Dec 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: How to unluck a door from another map? 
			 
			
				Oh lawl    yeah it's working now and i got my cousin to tell me how it all worked together so i understand it now    thanks for the help dude   !
			  
			
			
			
		 |  
	 
 | 
 
	| 04-30-2012, 08:11 PM  | 
	
		
	 | 
 
 
	 
 |