Frictional Games Forum (read-only)
Script help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script help (/thread-21639.html)

Pages: 1 2


Script help - tezpull666 - 05-26-2013

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!


RE: Script help - Bridge - 05-26-2013

Should there be a pair of two single quotes in SetLevelDoorLocked, instead of "level_wood"?


RE: Script help - Romulator - 05-27-2013

(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


RE: Script help - tezpull666 - 05-27-2013

(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??


RE: Script help - Bridge - 05-27-2013

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");
}



RE: Script help - tezpull666 - 05-27-2013

(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]


RE: Script help - Bridge - 05-27-2013

So is there actually a door called "level_wood_1" in your map?


RE: Script help - tezpull666 - 05-27-2013

(05-27-2013, 06:16 PM)Bridge Wrote: So is there actually a door called "level_wood_1" in your map?
yes


RE: Script help - Bridge - 05-27-2013

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?


RE: Script help - Kullin - 05-27-2013

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)