Frictional Games Forum (read-only)
Script causing game to randomly crash (No FATAL ERROR) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script causing game to randomly crash (No FATAL ERROR) (/thread-7885.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14


Script causing game to randomly crash (No FATAL ERROR) - RawkBandMan - 05-08-2011

When I went to go to the 2nd map of my custom, it crashed immediatly, no FATAL ERROR code or anything, but the hpl.log gave me this

ERROR: Couldn't build script 'c:/program files/steam/steamapps/common/amnesia the dark descent/custom_stories/Escape Hell (DEMO)/maps/ch01/NorthCells.hps'!

Here is my script

Spoiler below!

void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100);
}
AddEntityCollideCallback("Player", "BruteWalkAway", "ActivateBrute", true, 1);
AddEntityCollideCallback("servant_brute_1", "Disappear", "FadeEnemy", true, 1);
}

void ActivateBrute(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddTimer("Freeze", 2.0f, "FreezePlayer");
SetLightVisible("torch_static01_6", false);
SetLightVisible("torch_static01_7", false);
SetLightVisible("torch_static01_8", false);
SetLightVisible("torch_static01_9", false);
SetLightVisible("torch_static01_10", false);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.5f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.5f, "");

}

void FreezePlayer(string &in asTimer)
{
SetPlayerActive(false);
StartPlayerLookAt("servant_brute_1", "", "", "");
AddTimer("Look", 5.0f, "LookAt");
}

void LookAt(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

void FadeEnemy(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", false);
}






RE: Where can I find water? - Greven - 05-08-2011

http://www.youtube.com/watch?v=v4WudNebX08&feature=youtube_gdata_player Smile


RE: Where can I find water? - RawkBandMan - 05-08-2011

(05-08-2011, 05:19 PM)Greven Wrote: http://www.youtube.com/watch?v=v4WudNebX08&feature=youtube_gdata_player Smile

Thank you!

Now I need to make credits for my level. Any help on how?


RE: Where can I find water? - Roenlond - 05-08-2011

Credits are made in the extra_english.lang file.

I do not have any example here, but I will try to write from my memory.

in extra_english.lang:

<CATEGORY Name ="Ending">
<Entry Name ="StartCredits">
Title of Story[br]
Made By:[br]
blablabla[br]
</Entry>
</CATEGORY>

and to call it, use this in your functions, preferably void OnLeave()

void OnLeave()
{
StartCredits("musicfiletoplay", true, "Ending", "StartCredits", 0);
}

That should do the trick, tell me if you have any troubles Smile


RE: Where can I find water? - Simpanra - 05-08-2011

(05-08-2011, 05:19 PM)Greven Wrote: http://www.youtube.com/watch?v=v4WudNebX08&feature=youtube_gdata_player Smile

yay =D thanks for referencing my vid ^___^


RE: Where can I find water? - RawkBandMan - 05-08-2011

Thanks guys! I just have 2 more things. 1.For the credits, to I put the void OnLeave() in my mapname.hps? and 2. I tried to make a key unlock the door, and it worked. But, the name for it is not showing up. It just says "Picked Up" No name or anything, then in the inventory, there is no name of the key, or a description.

heres my .hps and my extra_english.cfg

extra_english.cfg
Spoiler below!
<LANGUAGE>

<CATEGORY Name="Test">
<Entry Name="Description>
Mr Testy! </Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_AwesomeKey">Awesome Key</Entry>
<Entry Name="ItemDesc_AwesomeKey">Key for a door that's just so important</Entry>
</CATEGORY>
</LANGUAGE>


.hps
Spoiler below!
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "castle_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{
SetSwingDoorLocked("castle_1", false, true) ;
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("awesomekey_1");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}




RE: Where can I find water? - Greven - 05-08-2011

(05-08-2011, 08:33 PM)Simpanra Wrote:
(05-08-2011, 05:19 PM)Greven Wrote: http://www.youtube.com/watch?v=v4WudNebX08&feature=youtube_gdata_player Smile

yay =D thanks for referencing my vid ^___^

np mate, your videos are great and you really help people like the one above Smile

//foodar100 :3


RE: Where can I find water? - Simpanra - 05-08-2011

(05-08-2011, 09:22 PM)Greven Wrote: np mate, your videos are great and you really help people like the one above Smile

//foodar100 :3

=D thanks ^_^

P.S, what does "//foodar100" mean? =P


RE: Where can I find water? - Greven - 05-08-2011

(05-08-2011, 09:28 PM)Simpanra Wrote:
(05-08-2011, 09:22 PM)Greven Wrote: np mate, your videos are great and you really help people like the one above Smile

//foodar100 :3

=D thanks ^_^

P.S, what does "//foodar100" mean? =P

It means im the foodar100 who commented on your youtube channel Big Grin


Answer to the key question:

You need to select your key in your level editor and go into the entity tab where you will find the CustomSubItemTypeName where you write the name of the key (from youre extraenglish.cfg file)


RE: Where can I find water? - Simpanra - 05-08-2011

=D no way! hows it going man? =)

Silly youtube blocking your posts cos of spam x3