Frictional Games Forum (read-only)

Full Version: Script problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok what's wrong here? you go into room 3(this script is for room 3) and castle_2 is locked. Then you go into another map and get the key for it so you can come back and unlock it, but Map 3 won't even load. I need helpConfused



void OnStart()
{
AddUseItemCallback("", "Key3", "castle_1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("Key3");
}

{
AddUseItemCallback("", "Key4", "castle_2", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_2", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false);
RemoveItem("Key4");
}
void OnEnter()
{

}

void OnLeave()
{

}
Have you named the level door that's in the other map right? Make sure that all names match.
(03-31-2013, 05:17 PM)Tigerwub Wrote: [ -> ]Have you named the level door that's in the other map right? Make sure that all names match.

It's just a swing door so You go outside of map 3, get the Key4 then come back into map 3 use it to unlock the swing door castle_2 but I don't know what's wrong with the script because it won't even load the map it said unknown character or something
Does the game crash when you load the custom story? Can you write down what it says in the error window?
(03-31-2013, 06:02 PM)Tigerwub Wrote: [ -> ]Does the game crash when you load the custom story? Can you write down what it says in the error window?

FATAL ERROR: Could not load script file 'custom_stories/Mark's
story/csmaps/C:/Program Files (x86)/Amnesia-The Dark
Descent/redist/custom_stories/Mark's story/csmaps/map_3.hps'!
main(12,1) : ERR : Unexpected token '{'
Ah, ofc

PHP Code:
{
    
AddUseItemCallback("""Key4",    "castle_2""UsedKeyOnDoor"true);


Put that in the 'void Onstart' instead.

Also, as Robosprog said, this is the wrong subforum.
(03-31-2013, 06:18 PM)Robosprog Wrote: [ -> ]How are people failing to post in the right section?


Post in Development Support from now on.
Oh I'm sorry I thought I did. thanks for telling me though