Frictional Games Forum (read-only)
Script help (Key to door) - 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 (Key to door) (/thread-12967.html)



Script help (Key to door) - QysteiN - 01-30-2012

Yo yo. Im kinda stuck with something again.
I made the door and the key. But how do i make the key fit with the door? :<


RE: Script help (Key to door) - i3670 - 01-30-2012

http://www.frictionalgames.com/forum/thread-12567.html?highlight=Keys

The search field is your friend.



RE: Script help (Key to door) - flamez3 - 01-30-2012

void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofdoor", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("nameofkey");
}



RE: Script help (Key to door) - QysteiN - 01-30-2012

I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

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


RE: Script help (Key to door) - Saren - 01-30-2012

(01-30-2012, 11:11 AM)QysteiN Wrote: I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
Dude what on earth are you doing, if you need help make your own thread......





RE: Script help (Key to door) - flamez3 - 01-30-2012

You are using 2 ' to make the quotation. Hold shift and press the button left of the Enter to make ".
(01-30-2012, 11:14 AM)Saren Wrote:
(01-30-2012, 11:11 AM)QysteiN Wrote: I created a script:
Anyone can spot whats wrong?

I get error whenever i try to load my custom story:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback(''awesomekey_1'', ''castle_1'', ''UsedKeyOnDoor'', True);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(''castle_1''' , false, true);
PlaySoundAtEntity('' '', ''unlock_door'' , ''castle_1'' , 0, false);
RemoveItem(''awesomekey_1'');
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
Dude what on earth are you doing, if you need help make your own thread......
This is his/her thread.




RE: Script help (Key to door) - Saren - 01-30-2012

Omg sry, I went into the wrong 1... xD


RE: Script help (Key to door) - QysteiN - 01-30-2012

thanks flamez once again lol =D


RE: Script help (Key to door) - flamez3 - 01-30-2012

(01-30-2012, 12:07 PM)QysteiN Wrote: thanks flamez once again lol =D
: )