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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected end of file crash
Lleviathyn Offline
Member

Posts: 63
Threads: 3
Joined: Mar 2013
Reputation: 2
#1
Unexpected end of file crash

Everything else has been working fine until I added this for my chemistry puzzle:
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.
(This post was last modified: 06-13-2013, 03:41 AM by Lleviathyn.)
04-06-2013, 04:47 AM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Unexpected end of file crash

Can you post the whole .hps in here?
04-06-2013, 06:12 AM
Find Reply
mrsomeepicrandomguy Offline
Member

Posts: 74
Threads: 15
Joined: Feb 2013
Reputation: 0
#3
RE: Unexpected end of file crash

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 "
04-06-2013, 01:02 PM
Find Reply
Lleviathyn Offline
Member

Posts: 63
Threads: 3
Joined: Mar 2013
Reputation: 2
#4
RE: Unexpected end of file crash

Yeah, that's what I assumed.

Anyways, the whole script:
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
Find Reply
Tiger Away
Posting Freak

Posts: 1,874
Threads: 16
Joined: Nov 2012
Reputation: 55
#5
RE: Unexpected end of file crash

(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
(This post was last modified: 04-06-2013, 02:06 PM by Tiger.)
04-06-2013, 02:06 PM
Find Reply
Lleviathyn Offline
Member

Posts: 63
Threads: 3
Joined: Mar 2013
Reputation: 2
#6
RE: Unexpected end of file crash

It worked! Thank you. Smile
04-06-2013, 04:18 PM
Find Reply
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#7
RE: Unexpected end of file crash

(04-06-2013, 04:18 PM)BlueRex Wrote: It worked! Thank you. Smile

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

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
04-15-2013, 08:30 AM
Website Find Reply




Users browsing this thread: 1 Guest(s)