Frictional Games Forum (read-only)
Fatal Error when loading Custom Story? - 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 when loading Custom Story? (/thread-21394.html)



Fatal Error when loading Custom Story? - FurtherGames - 05-04-2013

It's not the first time I've had one, but all the other errors I have solved! But not this one. I think I know where the error is but I don't know what the error is.

I started a custom map, it's going well. I been scripting so that when the Player collides with a Script Area, a candle will go out. It's sort of hard to explain because it's more complex than that.

Inside one room, there are FIVE Candles. You can blow them out by walking up to them (Colliding with the area). Once all five candles have been blown out, the screen will fade. But because I don't want there to be a specific order the candles have to be blown out in, I've set it to after each candle has been blown out, the scripting will check for a Varible Count of 5 for "lamplit". Each time you blow out a candle the script checks for the count and adds one varible count is added on aswell. So no matter what candle you blow out last it should always fade to black. The script is made up of "if(GetLocalVarInt...". I'm having trouble with the "Else"

THE ERROR:
FATAL ERROR: Could not load script file 'custom_stories/Razors/maps/01_Tomb.hps'
main (121, 1) : ERR : Expected expression value

Line 121 is where the Else statement is placed.

HPS File:
PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_4""Func1"true0);
    
AddEntityCollideCallback("Player""ScriptArea_5""Func2"true0);
    
AddEntityCollideCallback("Player""ScriptArea_6""Func3"true0);
    
AddEntityCollideCallback("Player""ScriptArea_7""Func4"true0);
    
AddEntityCollideCallback("Player""ScriptArea_8""Func5"true0);
    
SetLocalVarInt("lamplit"0);
    
}

void OnEnter()
{

}

void OnLeave()


}

void Func1(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick01_1"falsetrue);
SetLightVisible("PointLight_1"false); 
AddLocalVarInt("lamplit"1);
check();
}

void Func2(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_2"falsetrue);
SetLightVisible("PointLight_11"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func3(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_1"falsetrue);
SetLightVisible("PointLight_12"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func4(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_1"falsetrue);
AddLocalVarInt("lamplit"1);
check();
}

void Func5(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_2"falsetrue);
SetLightVisible("PointLight_13"false);
AddLocalVarInt("lamplit"1);
check();
}
void check()
{
if(
GetLocalVarInt("lamplit")==5);
    {
    
FadeOut(2);
    }
else;
{

}


Please help! I don't want anything to happen in the "Else;" part.


RE: Fatal Error when loading Custom Story? - The chaser - 05-04-2013

Just remove the ; in the else and after the Variable. Like this:


PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_4""Func1"true0);
    
AddEntityCollideCallback("Player""ScriptArea_5""Func2"true0);
    
AddEntityCollideCallback("Player""ScriptArea_6""Func3"true0);
    
AddEntityCollideCallback("Player""ScriptArea_7""Func4"true0);
    
AddEntityCollideCallback("Player""ScriptArea_8""Func5"true0);
    
SetLocalVarInt("lamplit"0);
    
}

void OnEnter()
{

}

void OnLeave()


}

void Func1(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick01_1"falsetrue);
SetLightVisible("PointLight_1"false); 
AddLocalVarInt("lamplit"1);
check();
}

void Func2(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_2"falsetrue);
SetLightVisible("PointLight_11"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func3(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_1"falsetrue);
SetLightVisible("PointLight_12"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func4(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_1"falsetrue);
AddLocalVarInt("lamplit"1);
check();
}

void Func5(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_2"falsetrue);
SetLightVisible("PointLight_13"false);
AddLocalVarInt("lamplit"1);
check();
}
void check()
{
if(
GetLocalVarInt("lamplit")==5)
    {
    
FadeOut(2);
    }
else
{

}




RE: Fatal Error when loading Custom Story? - FurtherGames - 05-04-2013

(05-04-2013, 04:19 PM)The chaser Wrote: Just remove the ; in the else and after the Variable. Like this:


PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_4""Func1"true0);
    
AddEntityCollideCallback("Player""ScriptArea_5""Func2"true0);
    
AddEntityCollideCallback("Player""ScriptArea_6""Func3"true0);
    
AddEntityCollideCallback("Player""ScriptArea_7""Func4"true0);
    
AddEntityCollideCallback("Player""ScriptArea_8""Func5"true0);
    
SetLocalVarInt("lamplit"0);
    
}

void OnEnter()
{

}

void OnLeave()


}

void Func1(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick01_1"falsetrue);
SetLightVisible("PointLight_1"false); 
AddLocalVarInt("lamplit"1);
check();
}

void Func2(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_2"falsetrue);
SetLightVisible("PointLight_11"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func3(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick_floor_1"falsetrue);
SetLightVisible("PointLight_12"false);
AddLocalVarInt("lamplit"1);
check();
}

void Func4(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_1"falsetrue);
AddLocalVarInt("lamplit"1);
check();
}

void Func5(string &in asParentstring &in asChildint alState)
{
SetLampLit("candlestick02_2"falsetrue);
SetLightVisible("PointLight_13"false);
AddLocalVarInt("lamplit"1);
check();
}
void check()
{
if(
GetLocalVarInt("lamplit")==5)
    {
    
FadeOut(2);
    }
else
{

}


Yours doesn't look that different to mine, but it did the trick! Thanks so much![/b]