Frictional Games Forum (read-only)
dont work Scripting a 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: dont work Scripting a door (/thread-11693.html)



dont work Scripting a door - Spermaharen - 12-05-2011

Hey im trying to scripting a door and my script looks like this !
Have i done something wrong beacuse when i use the key on the door i get a message
The Message goes like this : Cannot use this item this way!
If anyone have a clue please help me!



void OnStart()
{

AddUseItemCallback("", "Key1", "Door", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key1");

}


SPERMAHAREN Cool



RE: dont work Scripting a door - i3670 - 12-05-2011

I take it that the items inside your map are named "Key1" and "Door"?



RE: dont work Scripting a door - Spermaharen - 12-05-2011

(12-05-2011, 06:07 PM)i3670 Wrote: I take it that the items inside your map are named "Key1" and "Door"?
Name on Door : Door
CustomSubItemTypeName : Key1



RE: dont work Scripting a door - i3670 - 12-05-2011

(12-05-2011, 06:26 PM)Spermaharen Wrote:
(12-05-2011, 06:07 PM)i3670 Wrote: I take it that the items inside your map are named "Key1" and "Door"?
Name on Door : Door
CustomSubItemTypeName : Key1

there's your problem. You should type "Key1" in the name box.




RE: dont work Scripting a door - Spermaharen - 12-05-2011

(12-05-2011, 06:30 PM)i3670 Wrote: Name on Door : DoorCustomSubItemTypeName : Key1
(12-05-2011, 06:26 PM)Spermaharen Wrote: there's your problem. You should type "Key1" in the name box.
OMFG That was lame by me
Thank you so much it helps alot !