Frictional Games Forum (read-only)

Full Version: sigh... a fatal error.. again!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I need help on this fatal error please!

This is what my maps .hps file says:

Code:
void OnStart()
{
AddUseItemCallback("", "key_laboratory_1", "level_dungeon_2", "unlock_level_dungeon_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_10", "unlock_cabinet_metal_10", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_9", "unlock_cabinet_metal_9", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_8", "unlock_cabinet_metal_8", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_7", "unlock_cabinet_metal_7", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_6", "unlock_cabinet_metal_6", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_5", "unlock_cabinet_metal_5", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_4", "unlock_cabinet_metal_4", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_3", "unlock_cabinet_metal_3", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_2", "unlock_cabinet_metal_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_1", "unlock_cabinet_metal_1", true);
}

void unlock_level_dungeon_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_dungeon_2", false);
    PlaySoundAtEntity("", "unlock_door", "level_dungeon_2", 0, false);
    RemoveItem("key_laboratory_1");
}

void unlock_cabinet_metal_10(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_10", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_10", 0, false);
}

void unlock_cabinet_metal_9(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_9", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_9", 0, false);
}

void unlock_cabinet_metal_8(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_8", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);

void unlock_cabinet_metal_7(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_7", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);
}

void unlock_cabinet_metal_6(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_6", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_6", 0, false);
}

void unlock_cabinet_metal_5(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_5", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_5", 0, false);
}

void unlock_cabinet_metal_4(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_4", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_4", 0, false);
}

void unlock_cabinet_metal_3(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_3", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_3", 0, false);
}

void unlock_cabinet_metal_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_2", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_2", 0, false);
}

void unlock_cabinet_metal_1(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_1", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_1", 0, false);
}

And this is what the error says:

Code:
FATAL ERROR: Could not load script file
'custom_stories/(secret)/maps/c:/Program Files (x86)/Steam/SteamApps/common/amnesia the dark descent/custom_stories/(secret)/maps/dungeon.hps'!
ExecuteString (1, 1) : ERR : No matching signatures to 'OnEnter()'
ExecuteString (1, 1) : ERR : No matching signatures to 'OnLeave()'
main (80, 2) : ERR : Unexpected end of file

Please help!
Thanks,
TheDavenia
Try this:

Code:
void OnStart()
{
AddUseItemCallback("", "key_laboratory_1", "level_dungeon_2", "unlock_level_dungeon_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_10", "unlock_cabinet_metal_10", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_9", "unlock_cabinet_metal_9", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_8", "unlock_cabinet_metal_8", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_7", "unlock_cabinet_metal_7", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_6", "unlock_cabinet_metal_6", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_5", "unlock_cabinet_metal_5", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_4", "unlock_cabinet_metal_4", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_3", "unlock_cabinet_metal_3", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_2", "unlock_cabinet_metal_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_1", "unlock_cabinet_metal_1", true);
}

void unlock_level_dungeon_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_dungeon_2", false);
    PlaySoundAtEntity("", "unlock_door", "level_dungeon_2", 0, false);
    RemoveItem("key_laboratory_1");
}

void unlock_cabinet_metal_10(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_10", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_10", 0, false);
}

void unlock_cabinet_metal_9(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_9", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_9", 0, false);
}

void unlock_cabinet_metal_8(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_8", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);
}
void unlock_cabinet_metal_7(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_7", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);
}

void unlock_cabinet_metal_6(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_6", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_6", 0, false);
}

void unlock_cabinet_metal_5(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_5", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_5", 0, false);
}

void unlock_cabinet_metal_4(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_4", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_4", 0, false);
}

void unlock_cabinet_metal_3(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_3", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_3", 0, false);
}

void unlock_cabinet_metal_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_2", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_2", 0, false);
}

void unlock_cabinet_metal_1(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_1", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_1", 0, false);
}

You forgot to end a function ( } ).
(07-18-2011, 02:12 PM)Kyle Wrote: [ -> ]Try this:

Code:
void OnStart()
{
AddUseItemCallback("", "key_laboratory_1", "level_dungeon_2", "unlock_level_dungeon_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_10", "unlock_cabinet_metal_10", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_9", "unlock_cabinet_metal_9", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_8", "unlock_cabinet_metal_8", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_7", "unlock_cabinet_metal_7", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_6", "unlock_cabinet_metal_6", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_5", "unlock_cabinet_metal_5", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_4", "unlock_cabinet_metal_4", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_3", "unlock_cabinet_metal_3", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_2", "unlock_cabinet_metal_2", true);
AddUseItemCallback("", "hollow_needle_1", "cabinet_metal_1", "unlock_cabinet_metal_1", true);
}

void unlock_level_dungeon_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_dungeon_2", false);
    PlaySoundAtEntity("", "unlock_door", "level_dungeon_2", 0, false);
    RemoveItem("key_laboratory_1");
}

void unlock_cabinet_metal_10(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_10", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_10", 0, false);
}

void unlock_cabinet_metal_9(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_9", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_9", 0, false);
}

void unlock_cabinet_metal_8(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_8", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);
}
void unlock_cabinet_metal_7(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_7", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_7", 0, false);
}

void unlock_cabinet_metal_6(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_6", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_6", 0, false);
}

void unlock_cabinet_metal_5(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_5", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_5", 0, false);
}

void unlock_cabinet_metal_4(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_4", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_4", 0, false);
}

void unlock_cabinet_metal_3(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_3", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_3", 0, false);
}

void unlock_cabinet_metal_2(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_2", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_2", 0, false);
}

void unlock_cabinet_metal_1(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("cabinet_metal_1", false);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_1", 0, false);
}

You forgot to end a function ( } ).

Fatal error is gone but the closets don't unlock?
I can use the needle on them but they wont unlock?
Change SetLevelDoorLocked to SetSwingDoorLocked if you're trying to unlock cabinets.
Edit: only for the cabinets of course, level doors still need it.
(07-18-2011, 02:23 PM)Ouroboros Wrote: [ -> ]Change SetLevelDoorLocked to SetSwingDoorLocked if you're trying to unlock cabinets.
Edit: only for the cabinets of course, level doors still need it.

now i get this:

[Image: ferror.png]
You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.
Do you have anything in OnEnter() and/or OnLeave()? If you do, something might be missing and causing errors all the way down.

Edit: Roenlond is right, I completely missed that.
Thanks guys
(07-18-2011, 02:40 PM)Roenlond Wrote: [ -> ]You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.

I got one more question what do i got to add as a function that if i unlock the closet the doors fly open and a scream sound or something plays?
(07-18-2011, 03:04 PM)TheDavenia Wrote: [ -> ]Thanks guys
(07-18-2011, 02:40 PM)Roenlond Wrote: [ -> ]You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.

I got one more question what do i got to add as a function that if i unlock the closet the doors fly open and a scream sound or something plays?

You have to do something like
Code:
SetSwingDoorAutoCloseDisable(closet name, true);
SetSwingDoorClosed(closet name, false, true);
And then you have to find out the body name of the closet type you're using and use
Code:
//for metal closets/cabinets
AddBodyForce("metal_cabinet_1_rightDoor", 0, 0, 0, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 0, 0, 0, "world");

This link will take you to a wiki page I made actually just a little bit ago about it. The three 0s are the directions to add the force, so if it opened toward -Z, it would be 0, 0, -900.
First zero is X, second is Y, and the third is Z.
(07-18-2011, 03:35 PM)Ouroboros Wrote: [ -> ]
(07-18-2011, 03:04 PM)TheDavenia Wrote: [ -> ]Thanks guys
(07-18-2011, 02:40 PM)Roenlond Wrote: [ -> ]You need three columns for setswingdoorlocked, not just two. Add a true/false to each of them if you wish to use effects when it happens.

I got one more question what do i got to add as a function that if i unlock the closet the doors fly open and a scream sound or something plays?

You have to do something like
Code:
SetSwingDoorAutoCloseDisable(closet name, true);
SetSwingDoorClosed(closet name, false, true);
And then you have to find out the body name of the closet type you're using and use
Code:
//for metal closets/cabinets
AddBodyForce("metal_cabinet_1_rightDoor", 0, 0, 0, "world");
AddBodyForce("metal_cabinet_1_leftDoor", 0, 0, 0, "world");

This link will take you to a wiki page I made actually just a little bit ago about it. The three 0s are the directions to add the force, so if it opened toward -Z, it would be 0, 0, -900.
First zero is X, second is Y, and the third is Z.

A little bit to complicated for me i'm just a starter could you add it for me please?
Here's the code or the cabinet:
Code:
void unlock_cabinet_metal_9(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("cabinet_metal_9", false, true);
    PlaySoundAtEntity("", "unlock_door", "cabinet_metal_9", 0, false);
}
Pages: 1 2