| 
		
	
		| JoeBradleyUK   Member
 
 Posts: 115
 Threads: 20
 Joined: Jul 2011
 Reputation: 
0
 | 
			| New Problem: Lang file not working 
 
				My game crashes everytime i start why custom story...why?Here's my hps:
 
 void OnStart()
 {
 AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1);
 AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1);
 AddEntityCollideCallback("ScareTwoMonster", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 AddUseItemCallback("", "KeyDownstairs", "DownstairsDoor", "DownStairsKey", true);
 SetEntityPlayerLookAtCallback("SignDrLyons", "SignDrLyons", false);
 }
 
 void DownStairsKey(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("DownstairsDoor", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "DownstairsDoor", 4.0f, false);
 RemoveItem("KeyDownstairs);
 }
 
 void SignDrLyons(string &in asEntity, int alState)
 {
 SetMessage("Messages", "SignDrLyons", 2.0f);
 }
 
 void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("ScareTwoMonster", false);
 }
 
 void ScareOneCallback(string &in asParent, string &in asChild, int alState)
 {
 SetLampLit("ScareOneLight", true, true);
 SetLampLit("ScareOneLightTwo", true, true);
 SetEntityActive("ScareOneMonster", true);
 ShowEnemyPlayerPosition("ScareOneMonster");
 PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true);
 PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
 SetSwingDoorLocked("ScareOneDoor", true, true);
 GiveSanityDamage(20.0f, true);
 SetPlayerLampOil(0.0f);
 }
 
 void ScareTwoCallback(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("ScareTwoMonster", true);
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 0.0f, "");
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeThree", 30.0f, "");
 StartPlayerLookAt("deskpad_1", 5.0f, 6.0f, "");
 AddTimer("ScareTwo", 8.0f, "ScareTimerTwo");
 GiveSanityDamage(20.0f, true);
 }
 
 void ScareTimerTwo(string &in asTimer)
 {
 StopPlayerLookAt();
 }
 
 void OnEnter()
 {
 }
 void OnLeave()
 {
 }
 My lang:
 
 
 
 That's it then. You've commited murder and you've been sent to prison for life. You've become deranged, and insane for the time you've been in there.[br]You want to find a way out anyway you can. Even if it includes bloodshed.[br]You need to get out.
 
 
 Note Regarding Key To Lower Levels
 If anyone is wondering where the key is to the lower level, I took it to my office, down the hall.[br]I took it for safe keeping as there was a traitor amongst us letting all the prisoners out, as you may know. If anyone has anymore information about this matter, please contact me in my office.[br][br]Dr.Lyons
 
 
 SignDrLyons
 
 
 Downstairs Key
 A key for downstairs
 
 
 
 I really can't see the problem.
 
 :Work In Progress: Insanity
				
(This post was last modified: 10-18-2011, 08:01 PM by JoeBradleyUK.)
 |  |  
	| 10-18-2011, 05:59 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: My game crashes.... 
 
				this is wrong:
 RemoveItem("KeyDownstairs);
 
 this is true:
 
 RemoveItem("KeyDownstairs");
 
 |  |  
	| 10-18-2011, 06:17 PM |  |  
	
		| JoeBradleyUK   Member
 
 Posts: 115
 Threads: 20
 Joined: Jul 2011
 Reputation: 
0
 | 
			| RE: My game crashes.... 
 
				 (10-18-2011, 06:17 PM)Darion97 Wrote:  this is wrong:
 RemoveItem("KeyDownstairs);
 
 this is true:
 
 RemoveItem("KeyDownstairs");
 I fixed that, but it still crashes >.<
			 
 :Work In Progress: Insanity |  |  
	| 10-18-2011, 06:20 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: My game crashes.... 
 
				when the game crashes what it says? 
 This is wrong:
 
 AddEntityCollideCallback("ScareTwoMonster", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 
 This is true:
 AddEntityCollideCallback("Player", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 
 
 
				
(This post was last modified: 10-18-2011, 06:33 PM by Darion97.)
 |  |  
	| 10-18-2011, 06:23 PM |  |  
	
		| JoeBradleyUK   Member
 
 Posts: 115
 Threads: 20
 Joined: Jul 2011
 Reputation: 
0
 | 
			| RE: My game crashes.... 
 
				 (10-18-2011, 06:23 PM)Darion97 Wrote:  when the game crashes what it says?
 This is wrong:
 
 AddEntityCollideCallback("ScareTwoMonster", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 
 This is true:
 AddEntityCollideCallback("Player", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 Sorry but why is it wrong? It worked fine before I got the crash Plus it says "Amnesia.exe cause an EXCEPTION_ACCESS_VIOLATION in module MSVCR71.dll at 0023:7C3417FB, strlen()+0038byte(s)"
			 
 :Work In Progress: Insanity
				
(This post was last modified: 10-18-2011, 06:52 PM by JoeBradleyUK.)
 |  |  
	| 10-18-2011, 06:46 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: My game crashes.... 
 
				Your script is not a problem. because I tried the script and it works for me.... 
			 
				
(This post was last modified: 10-18-2011, 07:24 PM by Darion97.)
 |  |  
	| 10-18-2011, 06:54 PM |  |  
	
		| JoeBradleyUK   Member
 
 Posts: 115
 Threads: 20
 Joined: Jul 2011
 Reputation: 
0
 | 
			| RE: My game crashes.... 
 
				 (10-18-2011, 06:54 PM)Darion97 Wrote:  try this:
 void OnStart()
 {
 AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1);
 AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1);
 AddUseItemCallback("", "KeyDownstairs", "DownstairsDoor", "DownStairsKey", true);
 SetEntityPlayerLookAtCallback("SignDrLyons", "SignDrLyons", false);
 }
 
 void DownStairsKey(string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("DownstairsDoor", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "DownstairsDoor", 4.0f, false);
 RemoveItem("KeyDownstairs);
 }
 
 void SignDrLyons(string &in asEntity, int alState)
 {
 SetMessage("Messages", "SignDrLyons", 2.0f);
 }
 
 void ScareOneCallback(string &in asParent, string &in asChild, int alState)
 {
 SetLampLit("ScareOneLight", true, true);
 SetLampLit("ScareOneLightTwo", true, true);
 SetEntityActive("ScareOneMonster", true);
 ShowEnemyPlayerPosition("ScareOneMonster");
 PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true);
 PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true);
 SetSwingDoorLocked("ScareOneDoor", true, true);
 GiveSanityDamage(20.0f, true);
 SetPlayerLampOil(0.0f);
 }
 
 void ScareTwoCallback(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("ScareTwoMonster", true);
 AddEntityCollideCallback("ScareTwoMonster", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1);
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, "");
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 0.0f, "");
 AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeThree", 30.0f, "");
 StartPlayerLookAt("deskpad_1", 5.0f, 6.0f, "");
 AddTimer("ScareTwo", 8.0f, "ScareTimerTwo");
 GiveSanityDamage(20.0f, true);
 }
 
 void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("ScareTwoMonster", false);
 }
 
 void ScareTimerTwo(string &in asTimer)
 {
 StopPlayerLookAt();
 }
 
 void OnEnter()
 {
 }
 void OnLeave()
 {
 }
 What did you change   ? 
			 
 :Work In Progress: Insanity |  |  
	| 10-18-2011, 07:21 PM |  |  
	
		| Darion97   Junior Member
 
 Posts: 29
 Threads: 1
 Joined: Jun 2011
 Reputation: 
1
 | 
			| RE: My game crashes.... 
 
				I change the function for monster, but i can see the problem is another. 
			 |  |  
	| 10-18-2011, 07:26 PM |  |  
	
		| JoeBradleyUK   Member
 
 Posts: 115
 Threads: 20
 Joined: Jul 2011
 Reputation: 
0
 | 
			| RE: My game crashes.... 
 
				 (10-18-2011, 07:26 PM)Darion97 Wrote:  I change the function for monster, but i can see the problem is another. 
It turns out something in my lang file was causing it to spaz out... anyway I got rid of it and now the lang file doesn't work. Here is my lang and hps again:
 
void OnStart() 
{ 
AddEntityCollideCallback("Player", "ScareOne", "ScareOneCallback", true, 1); 
AddEntityCollideCallback("Player", "ScareTwoArea", "ScareTwoCallback", true, 1); 
AddEntityCollideCallback("ScareTwoMonster", "ScareTwoMonsterDisappear", "ScareTwoMonsterVanish", true, 1); 
AddUseItemCallback("", "KeyDownstairs", "DownstairsDoor", "DownStairsKey", true); 
SetEntityPlayerLookAtCallback("SignDrLyons", "SignDrLyons", false); 
}
 
void DownStairsKey(string &in asItem, string &in asEntity) 
{ 
SetSwingDoorLocked("DownstairsDoor", false, true); 
PlaySoundAtEntity("", "unlock_door.snt", "DownstairsDoor", 4.0f, false); 
RemoveItem("KeyDownstairs"); 
}
 
void SignDrLyons(string &in asEntity, int alState)  
{ 
SetMessage("Messages", "SignDrLyons", 2.0f); 
}
 
void ScareTwoMonsterVanish(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("ScareTwoMonster", false); 
}
 
void ScareOneCallback(string &in asParent, string &in asChild, int alState) 
{ 
SetLampLit("ScareOneLight", true, true); 
SetLampLit("ScareOneLightTwo", true, true); 
SetEntityActive("ScareOneMonster", true); 
ShowEnemyPlayerPosition("ScareOneMonster"); 
PlaySoundAtEntity("", "react_scare3.snt", "Player", 20.0f, true); 
PlayMusic("LevelOneMusic.ogg", true, 10.0f, 2.0f, 2.0f, true); 
SetSwingDoorLocked("ScareOneDoor", true, true); 
GiveSanityDamage(20.0f, true); 
SetPlayerLampOil(0.0f); 
}
 
void ScareTwoCallback(string &in asParent, string &in asChild, int alState) 
{ 
SetEntityActive("ScareTwoMonster", true); 
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeOne", 0.0f, ""); 
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeTwo", 0.0f, ""); 
AddEnemyPatrolNode("ScareTwoMonster", "ScareTwoNodeThree", 30.0f, ""); 
StartPlayerLookAt("deskpad_1", 5.0f, 6.0f, ""); 
AddTimer("ScareTwo", 8.0f, "ScareTimerTwo"); 
GiveSanityDamage(20.0f, true); 
}
 
void ScareTimerTwo(string &in asTimer) 
{ 
StopPlayerLookAt(); 
}
 
void OnEnter() 
{ 
} 
void OnLeave() 
{ 
}
 
My lang:
 
<LANGUAGE> 
 <CATEGORY Name="CustomStoryMain"> 
 <Entry Name="Description">That's it then. You've commited murder and you've been sent to prison for life. You've become deranged, and insane for the time you've been in there.[br]You want to find a way out anyway you can. Even if it includes bloodshed.[br]You need to get out.</Entry> 
 </CATEGORY> 
 <CATEGORY Name="Journal"> 
 <Entry Name="Note_KeyNote_Name">Note Regarding Key To Lower Levels</Entry> 
 <Entry Name="Note_KeyNote_Text">If anyone is wondering where the key is to the lower level, I took it to my office, down the hall.[br]I took it for safe keeping as there was a traitor amongst us letting all the prisoners out, as you may know. If anyone has anymore information about this matter, please contact me in my office.[br][br]Dr.Lyons</Entry> 
 </CATEGORY> 
 <CATEGORY Name="Messages"> 
 <Entry Name="SignDrLyons"> 
 </CATEGORY> 
 <CATEGORY Name="Inventory"> 
 <Entry name="ItemName_KeyDownstairs">Downstairs Key</Entry> 
 <Entry name="ItemDesc_KeyDownstairs">A key for downstairs</Entry> 
 </CATEGORY> 
</LANGUAGE> 
			 
 :Work In Progress: Insanity
				
(This post was last modified: 10-18-2011, 07:34 PM by JoeBradleyUK.)
 |  |  
	| 10-18-2011, 07:33 PM |  |  
	
		| GrAVit   Senior Member
 
 Posts: 580
 Threads: 15
 Joined: Oct 2011
 Reputation: 
22
 | 
			| RE: New Problem: Lang file not working 
 
				Shouldn't<CATEGORY Name="Messages">
 <Entry Name="SignDrLyons">
 </CATEGORY>
 Be like this?
 <CATEGORY Name="Messages">
 <Entry Name="SignDrLyons"></Entry>
 </CATEGORY>
 
 I don't really know, just a suggestion..
 
 
 |  |  
	| 10-18-2011, 09:03 PM |  |  |