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


Thread Rating:
  • 19 Vote(s) - 4.32 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#1
Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

I made this thread to help diminish the amount of reptitive/common questions that pop up here in the Development Support section of the forum. Hopefully if you're having a problem, this will clear it up for you without you having to make a thread. If nothing here helps, feel free to create a thread for it, do not respond in here with questions regarding your error!

Common Scripting Errors
________________________________________________
Q) I start a level and the game crashes with a report that comes up:

FATAL ERROR: Could not load script file
'.....map.hps'!
main (
#, #): ERR : Expected/Unexpected "____"

A)

Spoiler below!

This means at the hps the game trying to load, there is either something missing or unnecessary in the location described in: main (#, #). The first "#" is how many lines of code down it is, the second "#" is how many digits to the right it is in that line. If you played Battleship before, it's a lot like giving the code to an enemy to try and hit their ships. Though sometimes it does not appear EXACT.

Example)
FATAL ERROR: Could not load script file
'.....map.hps'!
main (46, 2): ERR : Expected ";"


Line 43: void function(string &in asParent, string &in asChild, int alState)
Line 44: {
Line 45: PlaySoundAtEntity("", "spookysounds.snt", "ScriptArea_1", 0, false)
Line 46: AddTimer("", 5, "function2");
Line 47: }

Can you find it?... Line 46, two digits over (where AddTimer is starting) is expecting a ";". Obviously, there should not be one before it, so if Line 46 cannot be read, there is a problem before it. At the end of line 45, there should be a ";". Place that there and you should be good to go.

~ ~ ~

Q) I start a level and the game crashes with a report that comes up:

FATAL ERROR: Could not load script file
'.....map.hps'!
main (
#, #): ERR : '_________' is not declared!

A)

Spoiler below!

This means that a phrase in a function does not have quotations around it, or otherwise, not declared. Simply add quotations around the phrase the error gave and ta-dah!

Example)
FATAL ERROR: Could not load script file
'.....map.hps'!
main (45, 24): ERR : 'spookysounds' is not declared


Line 43: void function(string &in asParent, string &in asChild, int alState)
Line 44: {
Line 45: PlaySoundAtEntity("", spookysounds.snt, "ScriptArea_1", 0, false);
Line 46: AddTimer("", 5, "function2");
Line 47: }

As the error states, there are no quotation marks around "spookysounds.snt" in Line 45, 24 digits over.

~ ~ ~

Q) The game doesn't crash, but the script doesn't work! Nothing happens!
A)

Spoiler below!

There are a couple of possible reasons, try and see which one fits yours:
1 - Check to make sure your declarations are spelled correctly or that they are being declared at the correct place. (if you want a sound to occur at ScriptArea_1, make sure it says that and not ScriptArea_2)
2 - Make sure you have the correct syntax in your function callback!
3 - Are you scripting in the correct .hps and not perhaps a backup? (I've done it before...)
4 - If a script area is responsible, make sure:
....... a. The proper script areas are properly sized and active
....... b. The script area you are using is not activating somehow directly from the start and you are not within visual/audio distance to hear it activate. This can be caused by the AddEntityCollideCallback in your script. 1: Entering the Script Area, -1: Leaving the Script Area, 0: Leaving/entering the Script Area

~ ~ ~

Common .lang File Errors
________________________________________________
IMPORTANT: First off, note that if there is a problem in the .lang file, Amnesia WILL NOT give an error report. If there is an error, anything involving the .lang will not show in game. For example, if you create an entry for, say, a SetMessage, and you created it incorrectly, the custom story description, the credits, notes, diaries, etc will not show in-game. KEEP THIS IN MIND!


Q) I added a few entries and now nothing shows anywhere!
A)

Spoiler below!

1: This is quite common as I have stated above. Make sure you spelled the most recent entry you created correctly and make sure you closed it off correctly!
<Entry Name="blahblah">Herpity Derp</Entry>

2: Make sure you have the proper Category created and that everything in the .lang is enclosed in:
<LANGUAGE>
...
...
...
</LANGUAGE>

3: Make sure you don't have unknown objects in your entries! (I've seen a "<P>" used before and it doesn't do anything, it only caused a failure)

4: Make sure the file itself is spelled EXACTLY: "extra_english.lang". No capitals or spelling errors. It should also be .lang, not .txt, .hps, .rtf, etc.

5: Make sure you have it located in: redist/custom_stories/MyCustomStory/... Don't put it in any other sub-folders!

~ ~ ~


Q) I pressed Enter/Return Key in my lang file to break lines, but it doesn't break in-game! It just stays one whole line!
A)

Spoiler below!

Pressing Enter/Return Key does nothing but help you keep things organized. To break lines, use [br].

~ ~ ~


Q) I added a voice for my paper, but it won't play when I pick it up/the paper doesn't even open immediately!
A)

Spoiler below!

To explain this easier and with a visual presentation,I suggest watching Your Computer's tutorial on Diaries and Notes, it helps a lot!

1: The entity must be "diary_paper01", and not a note entity!

2: The "[voice narration.ogg]" must have its own line in the .lang. Putit at the top and write it like this:
<CATEGORY Name="Journal">
<Entry Name="Diary_diary1_Name1">Diary Letter #1</Entry>
<Entry Name="Diary_diary1_Text1"> [voice diary1_pt1.ogg][br]
blahblahblahblah

[br][voice diary1_pt2.ogg][br]
blahblahbahblah
</Entry>
<CATEGORY>


The audio clip determines the length of time the page stays up and what page it "reads". Note above that what is depicted will have two pages, and need two different sound clips for each page.

~ ~ ~

Common Level Problems
________________________________________________

Q) I added new assets in the Level Editor, but they don't show up in-game! / Primitives don't show!
A)

Spoiler below!

Check your custom story folder for a .map_cache located in the same location as the corresponding map. If there is one, delete it and run the level again.

~ ~ ~

Q) I added a new model that showed up when I imported to ModelEditor and picked a material, but it is invisible in the Level Editor!
A)

Spoiler below!

This is a problem related to the model. The material simply helps the model use other textures mixed with variables such as translucency or UV animation. You need to open the model's .dae file in something like Notepad(++) and press Ctrl+F. This will bring up the search option. Search for "library_images" and under it, you will find directories to the diffuse of each mesh within the model. Make sure the directory is locating the proper texture you want and save it.

Once you saved it, open the .dae in ModelView. If the model loads with the texture, you should be good to go. To fix it further if need be, open the material regarding the model in MaterialEditor and do with it what you will. Save when finished and try loading the model in the Level Editor again. It should show up.

This could help you with visuals:
http://www.frictionalgames.com/forum/thread-17299.html

~ ~ ~


Q) I saved a map and opened it again and got a message that said:

WARNING:
Found some errors while loading file. Check log for details. File index out of bounds!

A)

Spoiler below!

The level editor is simply not loading any custom textures, particles, entities, static objects, billboards, etc. To fix, exit the level editor, BE CAREFUL NOT TO SAVE, and open the "resources.cfg" in your redist folder. Add this directory in there:

<Directory Path="/custom_stories" AddSubDirs="true" />

The Level Editor uses the directories in the resources.cfg to load assets. The custom_stories folder directory is not in there by default, so you have to add it manually if you have custom assets in your custom story folder. Save your resources.cfg and open the map in Level Editor again. Everything should load and the error should not come up anymore.
(If you are trying to load an Isolated Full Conversion, simply add a directory to your IFC as well and it should work as well)

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

This is all I have off the top of my head for now! If anyone has more to contribute or something I need to fix, please respond here and I'll get to it as soon as I can. Hopefully this helped!
(This post was last modified: 03-11-2013, 07:29 PM by Statyk.)
01-09-2013, 08:59 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#2
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

Very nice Statyk! Hopefully this will help lots of people without them needing to make a thread.

In Ruins [WIP]
01-09-2013, 09:30 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

Awesome Smile

You might want to add the VirtualStore path for windows users when finding the map.cache

or make a new question.

Q: I cannot find my .map file. Where is it?
A: It may be in the VirtualStore, if you are using Windows

Trying is the first step to success.
(This post was last modified: 01-10-2013, 10:44 AM by FlawlessHappiness.)
01-09-2013, 11:49 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

Damn it Statyk, I was making practically the same thread, you thief! Y u do dis :'(

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-10-2013, 10:27 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#5
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

Thanks guys. And BeeKayk, I would, but I'm not 100% sure what it does or how it works, so I don't want to go off telling people the wrong thing. If someone would like to clarify it for me, I'd be more than happy to add it.
(This post was last modified: 01-10-2013, 05:50 PM by Statyk.)
01-10-2013, 05:50 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

I know Your Computer can ^_^

Trying is the first step to success.
01-10-2013, 07:04 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

A very common error is that when people modifies the level or script, the level remains it's previous state. For this we remove the map_cache Wink

Quote:Map caches are cancers of modding.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-10-2013, 07:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

(01-10-2013, 05:50 PM)Statyk Wrote: Thanks guys. And BeeKayk, I would, but I'm not 100% sure what it does or how it works, so I don't want to go off telling people the wrong thing. If someone would like to clarify it for me, I'd be more than happy to add it.

Scroll down to virtualization and file virtualization: http://msdn.microsoft.com/en-us/library/...56960.aspx

(01-10-2013, 07:18 PM)The chaser Wrote:
Quote:Map caches are cancers of modding.

Map caches do have a practical purpose. While they should be deleted during testing, if your custom story is complete and ready for distribution, you should consider having the game generate a map cache for each map in the story so that users with slower computers can load big maps faster.

Tutorials: From Noob to Pro
01-10-2013, 07:29 PM
Website Find
Trackstep14 Offline
Junior Member

Posts: 1
Threads: 0
Joined: Jan 2015
Reputation: 0
#9
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

This covers a lot of my issues( so thanks for that Smile, but my biggest problem is that my custom story won't even show up in the custom stories menuSad. I have (or at least I think) my cfg. settings file pointing to a correct map file, and a correct ma folder along with a scripting file. I dunno what's wrong.
01-21-2015, 01:39 AM
Find
TheButtonBreaker Offline
Junior Member

Posts: 1
Threads: 0
Joined: May 2015
Reputation: 0
#10
RE: Common Custom Story Errors + Fixes! -- READ HERE BEFORE POSTING!!

I put the model in game and setup the functions to be picked up in model editor...Then when I try to pick it up it does not get picked up, the hand to pick up is there and it wont pick up...Please help!!!
05-26-2015, 02:53 AM
Find




Users browsing this thread: 3 Guest(s)