FurtherGames
Member
Posts: 72
Threads: 23
Joined: Apr 2013
Reputation:
1
|
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:
void OnStart() { AddEntityCollideCallback("Player", "ScriptArea_4", "Func1", true, 0); AddEntityCollideCallback("Player", "ScriptArea_5", "Func2", true, 0); AddEntityCollideCallback("Player", "ScriptArea_6", "Func3", true, 0); AddEntityCollideCallback("Player", "ScriptArea_7", "Func4", true, 0); AddEntityCollideCallback("Player", "ScriptArea_8", "Func5", true, 0); SetLocalVarInt("lamplit", 0); }
void OnEnter() {
}
void OnLeave() {
}
void Func1(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick01_1", false, true); SetLightVisible("PointLight_1", false); AddLocalVarInt("lamplit", 1); check(); }
void Func2(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_2", false, true); SetLightVisible("PointLight_11", false); AddLocalVarInt("lamplit", 1); check(); }
void Func3(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_1", false, true); SetLightVisible("PointLight_12", false); AddLocalVarInt("lamplit", 1); check(); }
void Func4(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_1", false, true); AddLocalVarInt("lamplit", 1); check(); }
void Func5(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_2", false, true); 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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Fatal Error when loading Custom Story?
Just remove the ; in the else and after the Variable. Like this:
void OnStart() { AddEntityCollideCallback("Player", "ScriptArea_4", "Func1", true, 0); AddEntityCollideCallback("Player", "ScriptArea_5", "Func2", true, 0); AddEntityCollideCallback("Player", "ScriptArea_6", "Func3", true, 0); AddEntityCollideCallback("Player", "ScriptArea_7", "Func4", true, 0); AddEntityCollideCallback("Player", "ScriptArea_8", "Func5", true, 0); SetLocalVarInt("lamplit", 0); }
void OnEnter() {
}
void OnLeave() {
}
void Func1(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick01_1", false, true); SetLightVisible("PointLight_1", false); AddLocalVarInt("lamplit", 1); check(); }
void Func2(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_2", false, true); SetLightVisible("PointLight_11", false); AddLocalVarInt("lamplit", 1); check(); }
void Func3(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_1", false, true); SetLightVisible("PointLight_12", false); AddLocalVarInt("lamplit", 1); check(); }
void Func4(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_1", false, true); AddLocalVarInt("lamplit", 1); check(); }
void Func5(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_2", false, true); SetLightVisible("PointLight_13", false); AddLocalVarInt("lamplit", 1); check(); } void check() { if(GetLocalVarInt("lamplit")==5) { FadeOut(2); } else {
} }
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
05-04-2013, 04:19 PM |
|
FurtherGames
Member
Posts: 72
Threads: 23
Joined: Apr 2013
Reputation:
1
|
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:
void OnStart() { AddEntityCollideCallback("Player", "ScriptArea_4", "Func1", true, 0); AddEntityCollideCallback("Player", "ScriptArea_5", "Func2", true, 0); AddEntityCollideCallback("Player", "ScriptArea_6", "Func3", true, 0); AddEntityCollideCallback("Player", "ScriptArea_7", "Func4", true, 0); AddEntityCollideCallback("Player", "ScriptArea_8", "Func5", true, 0); SetLocalVarInt("lamplit", 0); }
void OnEnter() {
}
void OnLeave() {
}
void Func1(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick01_1", false, true); SetLightVisible("PointLight_1", false); AddLocalVarInt("lamplit", 1); check(); }
void Func2(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_2", false, true); SetLightVisible("PointLight_11", false); AddLocalVarInt("lamplit", 1); check(); }
void Func3(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick_floor_1", false, true); SetLightVisible("PointLight_12", false); AddLocalVarInt("lamplit", 1); check(); }
void Func4(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_1", false, true); AddLocalVarInt("lamplit", 1); check(); }
void Func5(string &in asParent, string &in asChild, int alState) { SetLampLit("candlestick02_2", false, true); 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 |
|
|