Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal Error when loading Custom Story?
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#1
Wink  Fatal Error when loading Custom Story?

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: (Select All)
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.
(This post was last modified: 05-04-2013, 04:34 PM by FurtherGames.)
05-04-2013, 03:33 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Fatal Error when loading Custom Story?

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


PHP Code: (Select All)
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
{

}


THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
05-04-2013, 04:19 PM
Find
FurtherGames Offline
Member

Posts: 72
Threads: 23
Joined: Apr 2013
Reputation: 1
#3
RE: Fatal Error when loading Custom Story?

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


PHP Code: (Select All)
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]
05-04-2013, 04:34 PM
Find




Users browsing this thread: 2 Guest(s)