Frictional Games Forum (read-only)

Full Version: Script help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
void OnStart()
{
AddUseItemCallback("", "key_tomb_rusty_1", "level_wood_1", "FUNCTION", true);
}

PHP Code:
void OnEnter()


}

void OnLeave()


}

void FUNCTION(string &in asItemstring &in asEntity)
{
    
SetLevelDoorLocked(''level_wood_1''false);
    
PlayGuiSound("unlock_door.snt"door0false);
    
RemoveItem("key_tomb_rusty_1");


When i did this it said:
FATAL ERROR:Could not load script file 'custom_stories/the broken hell-prologue/maps/saco.hps'!

Please help

EDIT:It is now working!
Should there be a pair of two single quotes in SetLevelDoorLocked, instead of "level_wood"?
(05-26-2013, 07:26 PM)Bridge Wrote: [ -> ]Should there be a pair of two single quotes in SetLevelDoorLocked, instead of "level_wood"?

That should fix it. You should also include what the error says to, so we can sort of understand what we are to look for Smile
(05-27-2013, 10:25 AM)ROMul8r Wrote: [ -> ]
(05-26-2013, 07:26 PM)Bridge Wrote: [ -> ]Should there be a pair of two single quotes in SetLevelDoorLocked, instead of "level_wood"?

That should fix it. You should also include what the error says to, so we can sort of understand what we are to look for Smile
How can i do that??
Code:
void OnEnter()
{

}

void OnLeave()
{

}

void FUNCTION(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_wood_1", false);
    PlayGuiSound("unlock_door.snt", door, 0, false);
    RemoveItem("key_tomb_rusty_1");
}
(05-27-2013, 05:31 PM)Bridge Wrote: [ -> ]
Code:
void OnEnter()
{

}

void OnLeave()
{

}

void FUNCTION(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_wood_1", false);
    PlayGuiSound("unlock_door.snt", door, 0, false);
    RemoveItem("key_tomb_rusty_1");
}
Still doest work it said this:

[Image: WhXEfQy.png]
So is there actually a door called "level_wood_1" in your map?
(05-27-2013, 06:16 PM)Bridge Wrote: [ -> ]So is there actually a door called "level_wood_1" in your map?
yes
I'm not an expert on Amnesia scripting but (19, 37) should mean line 19, character 37 and your code only has 11 lines. Is this all of it?
The error is in line 19, And 37 the first letter of the word with a error so yea your right bridge,

But it says that it can't find the door, so make sure the door name is right. AND PRESS ENTER WHEN YOU ENTER A NAME IN THE LEVEL EDITITOR'!! Haha just so you see that!

And post the whole script, because a script. with 11 lines cant give a error on line 19. So give the whole script..

Whait a second, I just realised that on line 19 it gives a error because it says "door" in the script, do you understand what I mean? ( I know your from Germany)
Pages: 1 2