Frictional Games Forum (read-only)
fatal error! HELP - 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: fatal error! HELP (/thread-21645.html)

Pages: 1 2


fatal error! HELP - pewds..fan - 05-27-2013

HI EVERYONE! I´m having a proplem with my amnesia custom story..
when im trying to go trought my level door in my level 2 to 3 it just says
FATAL ERROR
EXECUTE STRING (1,9) : EXPECTED ')'


////////////////////////////
// Run first time starting map
void OnStart()
{

}

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "mansion_1", "UsedKeyOnLocked", true);
}

void UsedKeyOnLocked(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
AutoSave();
}



IF YOU CAN FIND THE MISTAKE IT WOULD HELP ME A LOT!


RE: fatal error! HELP - Adrianis - 05-27-2013

Can't see anything obviously wrong with that script - is that the script for level 3, or level 2?
If the error pops up when your going to level 3 from level 2, then the error will be in the script for level 3 as this kind of error will be caught when the scripts compile, which happens when the game loads a map

btw, this kind of thread should be made in the 'Development Support' sub-forum Smile


RE: fatal error! HELP - PutraenusAlivius - 05-27-2013

I find nothing wrong except the fact that you might wanna move that to void OnStart(). Or perhaps this is not the full script. In case, give us the full one.


RE: fatal error! HELP - Adrianis - 05-27-2013

(05-27-2013, 03:43 PM)Robosprog Wrote: That wouldn't make any difference to how the script is executed other than it being activated sooner.

It would mean it is only ever executed once, anything in OnEnter will be executed as many times as you enter the level


RE: fatal error! HELP - pewds..fan - 05-27-2013

this script for map 3 but i cant out my level 2 scrpt there too



BTW. soooorry for putting this to the wrong forum and i´ve just started making my 1st cs (this) and my maps are small and i suck at acripting so i dont have much scripts >.>


RE: fatal error! HELP - The chaser - 05-27-2013

(05-27-2013, 03:29 PM)pewds..fan Wrote: HI EVERYONE! I´m having a proplem with my amnesia custom story..
when im trying to go trought my level door in my level 2 to 3 it just says
FATAL ERROR
EXECUTE STRING (1,9) : EXPECTED ')'


////////////////////////////
//Run first time starting map
void OnStart()
{

}

////////////////////////////
//Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "mansion_1", "UsedKeyOnLocked", true);
}

void UsedKeyOnLocked(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);
RemoveItem("key_1");
}

////////////////////////////
//Run when leaving map
void OnLeave()
{
AutoSave();
}



IF YOU CAN FIND THE MISTAKE IT WOULD HELP ME A LOT!

Try this script, maybe it works.


RE: fatal error! HELP - amnesiaplayer321 - 05-27-2013

post all 2 scripts names


RE: fatal error! HELP - amnesiaplayer321 - 05-28-2013

Code:
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "UsedKeyOnLocked", true);
}

void UsedKeyOnLocked(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);
RemoveItem("key_1");
}

void OnLeave()
{
AutoSave();
}
try this one.


RE: fatal error! HELP - Adrianis - 05-28-2013

That's the same code but arranged differently, so if there was a problem in the code, that wouldn't solve it. Regardless, he/she made another thread with more of the script an I think the problem was resolved there. Thanks anyway mate


RE: fatal error! HELP - amnesiaplayer321 - 05-28-2013

i dont know, the script worked on my second test story.