Frictional Games Forum (read-only)
[SCRIPT] PLEASE HELP KEY DOESNT WORK - 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] PLEASE HELP KEY DOESNT WORK (/thread-16245.html)



PLEASE HELP KEY DOESNT WORK - Hartmann - 06-17-2012

Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}


RE: PLEASE HELP KEY DOESNT WORK - GrAVit - 06-17-2012

(06-17-2012, 08:37 PM)Hartmann Wrote: Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
Do you mean open or unlock? Did you name the entities the same as in the script?


RE: PLEASE HELP KEY DOESNT WORK - Hartmann - 06-18-2012

(06-17-2012, 08:51 PM)GrAVit Wrote:
(06-17-2012, 08:37 PM)Hartmann Wrote: Hey i have some problems with my custom story. the key wont open the door, this is my script


////////////////////////////
// Run first time starting map

void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
Do you mean open or unlock? Did you name the entities the same as in the script?



RE: PLEASE HELP KEY DOESNT WORK - Dutton - 06-18-2012

(06-17-2012, 08:37 PM)Hartmann Wrote: Hey i have some problems with my custom story. the key wont open the door, this is my script





////////////////////////////

// Run first time starting map



void OnStart()

{

AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);

}



void KeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("mansion_1", false, true);

PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);

}





////////////////////////////

// Run when leaving map

void OnLeave()

{



}
On your KeyOnDoor func you used


SetSwingDoorLocked("mansion_1", false, true);

true = locks the door

which means when you use the key on the door. the door will be locked



EDIT:

Sorry i didn't realise i was talking about the bool abEffects statement...