Frictional Games Forum (read-only)

Full Version: Unexpected end of file crash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Everything else has been working fine until I added this for my chemistry puzzle:
Code:
void PlaceJar2(string &in asParent, string &in asChild)
{
    StartPlayerLookAt("unfinished_cure_2", 1.0, 1.0, "");
    RemoveItem("heated_jar");
    AddTimer("looking", 2.0, "LookJar");
}

void LookJar(string &in asTimer)
{
    SetEntityActive("unfinished_cure_2", true);
    StopPlayerLookAt();
    PlaySoundAtEntity("", "impact_glass_med.snt", "unfinished_cure_2", 0, false);
    AddUseItemCallback("", "sodamide", "funnel", "AddSodamide", true);
}

void AddSodamide(string &in asParent, string &in asChild)
{
    StartPlayerLookAt("unfinished_cure_2", 1.0, 1.0, "");
    RemoveItem("sodamide");
    AddTimer("looking2", 2.0, "LookJar2");
}

void LookJar2(string &in asTimer)
{
    SetEntityActive("unfinished_cure_2", false);
    StopPlayerLookAt();
    PlaySoundAtEntity("", "puzzle_add_chemical.snt", "cure", 0, false);
    AddTimer("pickitup", 2.0, "PickUpCure");
}

void PickUpCure(string &in asTimer)
{
    SetEntityActive("cure", true);
    StartPlayerLookAt("cure", 1.0, 1.0, "");
    AddTimer("stoplooking", 1.0, "StopCureLook");
    CompleteQuest("curequest", "CureQuest");
}

void StopCureLook(string &in asTimer)
{
    StopPlayerLookAt();
}
The crash window says "Unexpected end of file" and tells me its on my last line. So I remove the "void StopCureLook" temporarily to see if it fixes the problem, and the same thing happens saying it's on my last line again.
Can you post the whole .hps in here?
Even If it says its an error on the last line doesn't mean it is on the last line, Its saying that some thing is missing im the script somewhere. Like a "
Yeah, that's what I assumed.

Anyways, the whole script:
Code:
void OnStart()
{
    WakeUp();
    SetPlayerLampOil(0);
    SetWheelStuckState("burner", 2, false);
    AddUseItemCallback("", "crowbar", "kitchen_door", "UsedCrowbarOnDoor", true);
    AddUseItemCallback("", "jar_mix", "PlaceJarArea", "PlaceJar", true);
    AddUseItemCallback("", "heated_jar", "PlaceJarArea2, "PlaceJar2", true);
    SetEntityConnectionStateChangeCallback("burner", "LightBurner");
    AddEntityCollideCallback("crowbar_joint", "break_door_script", "CollideAreaBreakDoor", true, 1);
    AddEntityCollideCallback("Player", "curequest_area", "CureMemento", true, 1);
}

void OnEnter()
{
    PlayMusic("25_amb.ogg", true, 1.0f, 5, 0, true);
    SetMapDisplayNameEntry("00_hub.map");
}

void WakeUp()
{
    FadeOut(0);
    FadeIn(20);
    PlayGuiSound("player_cough.snt", 1.0f);
    FadeImageTrailTo(2, 2);
    SetPlayerActive(false);    
    FadePlayerRollTo(50, 220, 220);
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);
    SetInventoryDisabled(true);
    AddTimer("trig1", 3.0f, "Recover");
}

void Recover(string &in asTimer)
{
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);
    FadeRadialBlurTo(0.0, 1);
    SetPlayerCrouching(false);
    SetInventoryDisabled(false);
    FadeImageTrailTo(0,1);
}

void CrowbarHint(string &in entity)
{
    if(GetSwingDoorLocked("kitchen_door") == true)
    {
        SetMessage("Messages", "kitchen_door_hint", 0);
    }
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
    AddTimer("", 0.2, "TimerSwitchShovel");
    RemoveItem("crowbar");
}

void TimerSwitchShovel(string &in asTimer)
{
    PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
    SetEntityActive("crowbar_joint", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorLocked("kitchen_door", false, true);
    AddPropImpulse("kitchen_door", 0, 0, -50, "World");
    SetSwingDoorDisableAutoClose("kitchen_door", true);
    SetSwingDoorClosed("kitchen_door", false, false);
    SetMoveObjectState("kitchen_door", 1);
    PlaySoundAtEntity("","break_wood_metal", "door_break_effect", 0, false);
    CreateParticleSystemAtEntity("", "ps_hit_wood", "door_break_effect", false);
    SetEntityActive("crowbar_joint", false);
    SetLocalVarInt("Door", 1);
}

void CureMemento(string &in asParent, string &in asChild, int alState)
{
    AddQuest("curequest", "CureQuest");
}

void PlaceJar(string &in asParent, string &in asChild)
{
    SetEntityActive("unfinished_cure_1", true);
    StartPlayerLookAt("unfinished_cure_1", 1.0, 1.0, "");
    RemoveItem("jar_mix");
    SetWheelStuckState("burner", 0, false);
    AddLocalVarInt("JarSet", 1);
    PlaySoundAtEntity("", "impact_glass_med.snt", "unfinished_cure_1", 0, 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("JarSet") == 1)
        {
            AddTimer("on", 3, "HeatedJar");
        }
    }
    if (alState == -1)
    {
        DestroyParticleSystem("burner1");
        StopSound("IgniteSound", 1);
        if (GetLocalVarInt("JarSet") == 1)
        {
            AddTimer("off", 3, "HeatedJar");
        }
    }
}

void HeatedJar(string &in asTimer)
{
    SetEntityActive("unfinished_cure_1", false);
    SetEntityActive("heated_jar", true);
    StopSound("IgniteSound", 1);
    DestroyParticleSystem("burner1");
    SetWheelStuckState("burner", 2, false);
}

void PlaceJar2(string &in asParent, string &in asChild)
{
    StartPlayerLookAt("unfinished_cure_2", 1.0, 1.0, "");
    RemoveItem("heated_jar");
    AddTimer("looking", 2.0, "LookJar");
}

void LookJar(string &in asTimer)
{
    SetEntityActive("unfinished_cure_2", true);
    StopPlayerLookAt();
    PlaySoundAtEntity("", "impact_glass_med.snt", "unfinished_cure_2", 0, false);
    AddUseItemCallback("", "sodamide", "funnel", "AddSodamide", true);
}

void AddSodamide(string &in asParent, string &in asChild)
{
    StartPlayerLookAt("unfinished_cure_2", 1.0, 1.0, "");
    RemoveItem("sodamide");
    AddTimer("looking2", 2.0, "LookJar2");
}

void LookJar2(string &in asTimer)
{
    SetEntityActive("unfinished_cure_2", false);
    StopPlayerLookAt();
    PlaySoundAtEntity("", "puzzle_add_chemical.snt", "cure", 0, false);
    AddTimer("pickitup", 2.0, "PickUpCure");
}

void PickUpCure(string &in asTimer)
{
    SetEntityActive("cure", true);
    StartPlayerLookAt("cure", 1.0, 1.0, "");
    AddTimer("stoplooking", 1.0, "StopCureLook");
    CompleteQuest("curequest", "CureQuest");
}

void StopCureLook(string &in asTimer)
{
    StopPlayerLookAt();
}
(04-06-2013, 01:40 PM)BlueRex Wrote: [ -> ]Yeah, that's what I assumed.

Anyways, the whole script:

AddUseItemCallback("", "heated_jar", "PlaceJarArea2, "PlaceJar2", true);

there ya' go
It worked! Thank you. Smile
(04-06-2013, 04:18 PM)BlueRex Wrote: [ -> ]It worked! Thank you. Smile

Next time please change title to [solved] or something thanks.