Frictional Games Forum (read-only)

Full Version: Unexpected End Of File
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Been sifting through my code for ages and I cant solve it! And im guessing that "Unexpected End Of File" means I have something wrong in my code, from the other threads i've seen?

"main(92,2): ERR : Unexpected end of file"

does "(92,2)" mean that the wrong code is in line 92 ? Because line 92 is the last line...

Heres is my code *It's kinda long :c*:

void PourOpium(string &in flask01_orpiment_1, string &in acid_machine_bottle_empty01_1)
{
SetEntityActive("acid_machine_bottle_empty01_1", false);
SetEntityActive("acid_machine_bottle01_1", true);
SetWheelStuckState("special_burner_1", 0, false);
RemoveItem("flask01_orpiment_1");
AddLocalVarInt("OpiumAdded", 1);
PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);
}

void LightBurner(string &in asEntity, int alState)
{
if (alState == 1)
{
CreateParticleSystemAtEntity("burner1", "ps_fire_lab_burner.ps", "BurnerArea", false);
PlaySoundAtEntity("IgniteSound", "general_fire_burning_low", "BurnerArea", 1, false);
if (GetLocalVarInt("OpiumAdded") == 1)
{
AddTimer("on", 3, "TimerBondCountdown");
}
}
if (alState == -1)
{
DestroyParticleSystem("burner1");
StopSound("IgniteSound", 1);
if (GetLocalVarInt("OpiumAdded") == 1)
{
AddTimer("off", 3, "TimerBondCountdown");
SetLocalVarInt("BondingMix", 1);
}
}
}

void TimerBondCountdown(string &in asTimer)
{
if(asTimer == "on")
{
CreateParticleSystemAtEntity("burnersteam1", "ps_chemical_heat.ps", "BurnerArea_1", false);
PlaySoundAtEntity("FirstBoil","puzzle_boil.snt", "acid_machine_bottle01_1", 1, false);
SetLocalVarInt("BondingMix", 2);
}
if(asTimer == "off")
{
DestroyParticleSystem("burnersteam1");
StopSound("FirstBoil", 1);
SetLocalVarInt("BondingMix", 0);
}
}

void PourIodine(string &in flask01_calamine_1, string &in acid_machine_bottle01_1)
{
if (GetLocalVarInt("BondingMix") == 0)
{
AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);
}
if (GetLocalVarInt("BondingMix") == 2)
{
GivePlayerDamage(101, "BloodSplash", true, true);
PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);
CreateParticleSystemAtEntity("","explosion.ps", "BurnerArea_1", false);
PlaySoundAtEntity("", "break_wood_metal.snt", "BurnerArea_1", 0, false);
AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);
}
if (GetLocalVarInt("BondingMix") == 1)
{
RemoveItem("flask01_calamine_1");
PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);
SetWheelStuckState("special_burner_1", -1, false);
GiveSanityBoost();
AddTimer("", 3, "Laudanum");
}

void Laudanum()
{
SetEntityActive("potion_health_1", true);
}

void OnStart()
{
AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);
AddUseItemCallback("", "flask01_orpiment_1", "acid_machine_bottle_empty01_1", "PourOpium", true);
}

void OnEnter()
{

}

void OnLeave()
{
SetupLoadScreen("LoadingText", "Loading", 7, "HNBKChapterOne.jpg");
}

Any help would be appreciated! <3 u guys Big Grin
http://wiki.frictionalgames.com/hpl2/tut...ed&s[]=end

Code:
void PourOpium(string &in flask01_orpiment_1, string &in acid_machine_bottle_empty01_1)

{

    SetEntityActive("acid_machine_bottle_empty01_1", false);

    SetEntityActive("acid_machine_bottle01_1", true);

    SetWheelStuckState("special_burner_1", 0, false);

    RemoveItem("flask01_orpiment_1");

    AddLocalVarInt("OpiumAdded", 1);

    PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);

}



void LightBurner(string &in asEntity, int alState)

{

    if (alState == 1)

    {

        CreateParticleSystemAtEntity("burner1", "ps_fire_lab_burner.ps", "BurnerArea", false);

        PlaySoundAtEntity("IgniteSound", "general_fire_burning_low", "BurnerArea", 1, false);

        if (GetLocalVarInt("OpiumAdded") == 1)

        {

            AddTimer("on", 3, "TimerBondCountdown");

        }

    }

    if (alState == -1)

    {

        DestroyParticleSystem("burner1");

        StopSound("IgniteSound", 1);

        if (GetLocalVarInt("OpiumAdded") == 1)

        {

            AddTimer("off", 3, "TimerBondCountdown");

            SetLocalVarInt("BondingMix", 1);

        }

    }

}



void TimerBondCountdown(string &in asTimer)

{

    if(asTimer == "on")

    {

        CreateParticleSystemAtEntity("burnersteam1", "ps_chemical_heat.ps", "BurnerArea_1", false);

        PlaySoundAtEntity("FirstBoil","puzzle_boil.snt", "acid_machine_bottle01_1", 1, false);

        SetLocalVarInt("BondingMix", 2);

    }

    if(asTimer == "off")

    {

        DestroyParticleSystem("burnersteam1");

        StopSound("FirstBoil", 1);

        SetLocalVarInt("BondingMix", 0);

    }

}



void PourIodine(string &in flask01_calamine_1, string &in acid_machine_bottle01_1)

{

    if (GetLocalVarInt("BondingMix") == 0)

    {

        AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    }

    if (GetLocalVarInt("BondingMix") == 2)

    {

        GivePlayerDamage(101, "BloodSplash", true, true);

        PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);

        CreateParticleSystemAtEntity("","explosion.ps", "BurnerArea_1", false);

        PlaySoundAtEntity("", "break_wood_metal.snt", "BurnerArea_1", 0, false);

        AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    }

    if (GetLocalVarInt("BondingMix") == 1)

    {

        RemoveItem("flask01_calamine_1");

        PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);

        SetWheelStuckState("special_burner_1", -1, false);

        GiveSanityBoost();

        AddTimer("", 3, "Laudanum");

    }

    }


void Laudanum()

{

    SetEntityActive("potion_health_1", true);

}



void OnStart()

{

    AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    AddUseItemCallback("", "flask01_orpiment_1", "acid_machine_bottle_empty01_1", "PourOpium", true);

}



void OnEnter()

{



}



void OnLeave()

{

    SetupLoadScreen("LoadingText", "Loading", 7, "HNBKChapterOne.jpg");

}

Here, fixed.
Nevermind guys! I think I found it

(07-13-2013, 08:12 PM)The chaser Wrote: [ -> ]http://wiki.frictionalgames.com/hpl2/tut...ed&s[]=end

Code:
void PourOpium(string &in flask01_orpiment_1, string &in acid_machine_bottle_empty01_1)

{

    SetEntityActive("acid_machine_bottle_empty01_1", false);

    SetEntityActive("acid_machine_bottle01_1", true);

    SetWheelStuckState("special_burner_1", 0, false);

    RemoveItem("flask01_orpiment_1");

    AddLocalVarInt("OpiumAdded", 1);

    PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);

}



void LightBurner(string &in asEntity, int alState)

{

    if (alState == 1)

    {

        CreateParticleSystemAtEntity("burner1", "ps_fire_lab_burner.ps", "BurnerArea", false);

        PlaySoundAtEntity("IgniteSound", "general_fire_burning_low", "BurnerArea", 1, false);

        if (GetLocalVarInt("OpiumAdded") == 1)

        {

            AddTimer("on", 3, "TimerBondCountdown");

        }

    }

    if (alState == -1)

    {

        DestroyParticleSystem("burner1");

        StopSound("IgniteSound", 1);

        if (GetLocalVarInt("OpiumAdded") == 1)

        {

            AddTimer("off", 3, "TimerBondCountdown");

            SetLocalVarInt("BondingMix", 1);

        }

    }

}



void TimerBondCountdown(string &in asTimer)

{

    if(asTimer == "on")

    {

        CreateParticleSystemAtEntity("burnersteam1", "ps_chemical_heat.ps", "BurnerArea_1", false);

        PlaySoundAtEntity("FirstBoil","puzzle_boil.snt", "acid_machine_bottle01_1", 1, false);

        SetLocalVarInt("BondingMix", 2);

    }

    if(asTimer == "off")

    {

        DestroyParticleSystem("burnersteam1");

        StopSound("FirstBoil", 1);

        SetLocalVarInt("BondingMix", 0);

    }

}



void PourIodine(string &in flask01_calamine_1, string &in acid_machine_bottle01_1)

{

    if (GetLocalVarInt("BondingMix") == 0)

    {

        AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    }

    if (GetLocalVarInt("BondingMix") == 2)

    {

        GivePlayerDamage(101, "BloodSplash", true, true);

        PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);

        CreateParticleSystemAtEntity("","explosion.ps", "BurnerArea_1", false);

        PlaySoundAtEntity("", "break_wood_metal.snt", "BurnerArea_1", 0, false);

        AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    }

    if (GetLocalVarInt("BondingMix") == 1)

    {

        RemoveItem("flask01_calamine_1");

        PlaySoundAtEntity("", "puzzle_add_chemical.snt", "acid_machine_bottle01_1", 1, false);

        SetWheelStuckState("special_burner_1", -1, false);

        GiveSanityBoost();

        AddTimer("", 3, "Laudanum");

    }

    }


void Laudanum()

{

    SetEntityActive("potion_health_1", true);

}



void OnStart()

{

    AddUseItemCallback("", "flask01_calamine_1", "acid_machine_bottle01_1", "PourIodine", true);

    AddUseItemCallback("", "flask01_orpiment_1", "acid_machine_bottle_empty01_1", "PourOpium", true);

}



void OnEnter()

{



}



void OnLeave()

{

    SetupLoadScreen("LoadingText", "Loading", 7, "HNBKChapterOne.jpg");

}

Here, fixed.

Thank you so much anyway :3 Found out the mistake myself xD Thanks anyway.