Forum Thread
by member
  Posts  
Amnesia Custom Story help anyone?? (Forums : Level Design : Amnesia Custom Story help anyone??) Locked
Thread Options
Cveri
Cveri Creator of AAMFP - Revelations & Calm Terror
Sep 6 2012, 4:54am Anchor

So, people, I need some help... I am trying to solve an "Unexpected end of file" problem. I am getting this error:

FATAL ERROR: Could not load script file "custom_stories/Calm Terror/maps/04_dungeons.hps!
main (59,1) : ERR : Unexpected end of file

Also, here is the whole .hps file code:

code:
////////////////////////////
// Run when the map starts
void OnStart()
{
    AddEntityCollideCallback("Player", "Monster_script_10", "SpawnEnemy", true, 1);
    AddEntityCollideCallback("Player", "WaterLurker_script", "SpawnEnemy2", true, 1);
    AddEntityCollideCallback("Player", "PopUp_2", "EnableMessage2", true, 1);
    AddEntityCollideCallback("Player", "PopUp_3", "EnableMessage3", true, 1);    
}

void SpawnEnemy(string &in asParent, string &in asChild, int alState)

{
    SetEntityActive("servant_brute_1", true);
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0, "");
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
}

void SpawnEnemy2(string &in asParent, string &in asChild, int alState)

{
    SetEntityActive("waterlurker_1", true);
}

void EnableMessage2(string &in asChild, string &in asParent, int alState)

{
    SetMessage("Messages", "PopUp2", 0);
}

void EnableMessage3(string &in asChild, string &in asParent, int alState)

{
    SetMessage("Messages", "PopUp3, 0);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
    AddEntityCollideCallback("Player", "Music_area_1", "StartMusic", true, 1);
}

void StartMusic(string &in asParent, string &in asChild, int alState)

{
    PlayMusic("21_amb.ogg", true, 0.8, 2, 1, true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
 
}

 

Please help me, I was searching everywhere for answers and could not solve this...

Thank you for your help in advance!! :)

ShiftedDesign
ShiftedDesign Levels are my thing
Sep 7 2012, 1:40am Anchor
code:
    SetMessage("Messages", "PopUp3, 0);

PopUp3 is missing the other quotation, (")

--

User Posted Image
User Posted Image
User Posted Image
Portfolio: Ianowen.net

Cveri
Cveri Creator of AAMFP - Revelations & Calm Terror
Sep 7 2012, 3:16am Anchor

Wow, thank you so much ShiftedDesign!! It solved the problem! Now I can continue my work...

--

Cveri, creator of Amnesia: A Machine For Pigs - Revelations

 Amnesia: A Machine For Pigs - Revelations

ShiftedDesign
ShiftedDesign Levels are my thing
Sep 7 2012, 11:10am Anchor

Not a problem, good luck in your work!

Also I recommend using a program such as Context or Notepad++ which has color highlights for specific items.
It makes it much easier to catch things like this.

Edited by: ShiftedDesign

--

User Posted Image
User Posted Image
User Posted Image
Portfolio: Ianowen.net

Jan 10 2013, 3:05pm Anchor

Hi i was wondering if you could help me with an issue that i have with amnesia, Im trying to make a custom story (its just a tester as i have never made one before and just getting the hang of things.) When i load it i get his message saying fatal error: could not load script file 'custom_stories/tester/maps/tester.hps'! main (1,1) : ERR : unexpected token '<'

this is the hps file so any help would be very much appreciated.

thank you

code:
<Level>
    <EditorSession>
        <Performance CamClipPlanes="0.05 1000" LightsActive="true" PSActive="true" ShowFog="true" ShowSkybox="true" WorldReflection="true" />
        <ViewportConfig BGColor="0.2 0.2 0.2 1" GAmbientLight="true" GPointLight="true" GridSnap="true" GridSnapSeparation="0.25" SelectedViewport="0" UsingEnlargedViewport="false">
            <Viewport CameraPosition="0 0 180" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="2" Preset="0" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="true" />
            <Viewport CameraPosition="180 0 0" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="0" Preset="1" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="true" />
            <Viewport CameraPosition="0 180 0" CameraTarget="0 0 0" CameraZoom="0" GridHeight="0" GridPlane="1" Preset="2" RenderMode="1" ShowAxes="true" ShowGrid="true" UsingLTCam="true" />
            <Viewport CameraPosition="10 10 10" CameraTarget="0 0 0" CameraZoom="1.06013" GridHeight="0" GridPlane="1" Preset="3" RenderMode="0" ShowAxes="true" ShowGrid="true" UsingLTCam="true" />
        </ViewportConfig>
        <Groups>
            <Group ID="0" Name="None" Visible="true" />
        </Groups>
    </EditorSession>
    <MapData FogActive="false" FogColor="1 1 1 1" FogCulling="true" FogEnd="20" FogFalloffExp="1" FogStart="0" GlobalDecalMaxTris="300" Name="" SkyBoxActive="false" SkyBoxColor="1 1 1 1" SkyBoxTexture="">
        <MapContents>
            <FileIndex_StaticObjects NumOfFiles="0" />
            <FileIndex_Entities NumOfFiles="0" />
            <FileIndex_Decals NumOfFiles="0" />
            <StaticObjects />
            <Primitives />
            <Decals />
            <Entities />
            <Misc />
            <StaticObjectCombos />
        </MapContents>
    </MapData>
</Level>
 
ShiftedDesign
ShiftedDesign Levels are my thing
Jan 12 2013, 7:25pm Anchor

I don't actually work with Amnesia so I don't know how helpful I will be but, how can your .hps file look like that when the other guys looked like this:

code:
////////////////////////////
// Run when the map starts
void OnStart()
{
    AddEntityCollideCallback("Player", "Monster_script_10", "SpawnEnemy", true, 1);
    AddEntityCollideCallback("Player", "WaterLurker_script", "SpawnEnemy2", true, 1);
    AddEntityCollideCallback("Player", "PopUp_2", "EnableMessage2", true, 1);
    AddEntityCollideCallback("Player", "PopUp_3", "EnableMessage3", true, 1);    
}

void SpawnEnemy(string &amp;in asParent, string &amp;in asChild, int alState)


 

Are you sure that this is how it is suppose to be written? Can you give me some more info on it?

--

User Posted Image
User Posted Image
User Posted Image
Portfolio: Ianowen.net

Jan 20 2013, 8:58am Anchor

i sorted it now but thanks anyway

Mar 3 2013, 8:07am Anchor

Alright I've got the same problem and this is how my hps fle looks like

////////////////////////////// Run when entering mapvoid OnEnter(){AddUseItemCallBack("","GuestRoomKey,"mansion_1","UsedKeyOnDoor", true);}void UsedKeyOnDoor(string &in asItem, string &in asEntity{ SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity"", "Unlock_door", "mansion_1",0, false); RemoveItem("GuestRoomKey");} ////////////////////////////// Run when leaving mapvoid OnLeave(){ }

ShiftedDesign
ShiftedDesign Levels are my thing
Mar 4 2013, 1:05pm Anchor
code:
             ////////////////////////////// Run when entering mapvoid
             OnEnter()
             {
               AddUseItemCallBack("","GuestRoomKey,"mansion_1","UsedKeyOnDoor", true);
             }
             void UsedKeyOnDoor(string &amp;in asItem, string &amp;in asEntity)
             {
               SetSwingDoorLocked("mansion_1", false, true);
               PlaySoundAtEntity"", "Unlock_door", "mansion_1",0, false);
               RemoveItem("GuestRoomKey");
             } ////////////////////////////// Run when leaving mapvoid
             OnLeave()
             { }

You were missing a ) on the UsedKeyOnDoor Function.
This is what it should say: void UsedKeyOnDoor(string &in asItem, string &in asEntity)

Edited by: ShiftedDesign

--

User Posted Image
User Posted Image
User Posted Image
Portfolio: Ianowen.net

Jul 2 2013, 12:39pm Anchor

Hello. Apparently I have the same problem as Cveri is having. I have Amnesia and I was working on level editor and scripting which I love to do and every time I go into my custom story, it gets the unexpected end file. I tried checking the file but I didn't see any problems. Here's my Script:

code:
void OnStart()
  {
    AddUseItemCallback("", "ClosetDoorKey_1", "Interactdoor", "Unlock", true);
  }

void Unlock(string &amp;in asItem, string &amp;in asEntity)
  {
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
  }

void look1(string&amp;in asTimer
  {
    StartPlayerLookAt("look1", 1.0f, 1.0f, "");
    AddTimer("", 3, "look2");
  }
 
void look2(string&amp;in asTimer
  {
    StartPlayerLookAt("look2", 1.0f, 1.0f, "");
    AddTimer("" , 3, "look3");
  }
 
void look3(string&amp;in asTimer
  {
    StartPlayerLookAt("look3", 1.0f, 1.0f, "");
    AddTimer("", 3, "look4");
  }
 
void look4(string&amp;in asTimer
  {
    StopPlayerLookAt();
  }
 

I'm still not finished with it but I need help so I can continue working.

Edited by: SlendFinn56

Jul 4 2013, 2:33am Anchor

The idea behind these Business Solutions is for North Steel to partner with our customers to ultimately offer ways for our customers to reduce costs, reduce lead times, and receive quality products.

Sep 2 2013, 9:32am Anchor

Hope someone could help me with wath i think is a simple problem, im trying to learn how to do an Amnesia custom story, and i have made a smal map just for testing, but the problem is that i have saved it in the custom story map, but i cant se it? but i can play it?

Cveri
Cveri Creator of AAMFP - Revelations & Calm Terror
Sep 28 2013, 4:02am Anchor

felixhaljeskog, I believe you already sorted out your problem, but Id like to help other people having the same problem. :)

When you make a custom story map in - ATDD/redist/custom_stories/story_name - you need to have two text files:

1. custom_story_settings.cfg
2. extra_english.lang

In custom_story_settings.cfg you gotta have this:

code:
<Main
  ImgFile = "image_name"
  Name = "Name of Your story"
  Author = "Your name"
 
  MapsFolder = "maps/"
  StartMap = "map_name.map"
  StartPos = "PlayerStartArea_1"
/>

In ImgFile, you can put a picture for the background in the main menu when you choose a CS to play.
MapsFolder is always "maps/". You need to have a maps folder in your custom story`s folder.

extra_english.lang must contain the following:

code:
<LANGUAGE>
<RESOURCES>
  </RESOURCES>
 
  <CATEGORY Name="CustomStoryMain">
    <Entry Name="Description">Description of your Custom Story</Entry>
  </CATEGORY>
   
  <CATEGORY Name="Journal">
    <Entry Name="Note_1_Name">Hello</Entry>
    <Entry Name="Note_1_Text">Hello again</Entry>          
  </CATEGORY>
 
  <CATEGORY Name="LoadingScreen">
    <Entry Name="TextOne">Cool Loading Screen text</Entry>
    <Entry Name="TextTwo">Another LS</Entry>
    <Entry Name="TextThree"></Entry>
    <Entry Name="TextNone"></Entry>
  </CATEGORY>
 
  <CATEGORY Name="Levels">
                <Entry Name="Level1Name">Bedroom</Entry>   
  </CATEGORY>
 
  <CATEGORY Name="Messages">
    <Entry Name="Message1">It locked itself. I must keep going.</Entry>  
  </CATEGORY>
 
  <CATEGORY Name="Inventory">
      <Entry Name="ItemDesc_Flashlight">The flashlight will light up dark places. When in game press $ButLantern to turn it on.</Entry>
        <Entry Name="ItemName_Flashlight">Flashlight</Entry>     
  </CATEGORY>
 
  <CATEGORY Name="DeathHints">
    <Entry Name="Death1">You have to escape...</Entry>
    <Entry Name="Death2">Don`t stop now...</Entry>
    <Entry Name="DeathNone"></Entry>
  </CATEGORY>
 
  <CATEGORY Name="Ending">
    <Entry Name="MainCredits">End. Write smthing for goodybe</Entry>
  </CATEGORY>
</LANGUAGE>

--

Cveri, creator of Amnesia: A Machine For Pigs - Revelations

 Amnesia: A Machine For Pigs - Revelations

Reply to Thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.