Frictional Games Forum (read-only)

Full Version: fatal error! HELP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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!
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
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.
(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
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 >.>
(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.
post all 2 scripts names
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.
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
i dont know, the script worked on my second test story.
Pages: 1 2