Frictional Games Forum (read-only)
[SCRIPT] Item from other Level - 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] Item from other Level (/thread-14701.html)



Item from other Level - Knittel - 04-11-2012

Hello everyone,

I have a small problem in my Amnesia Custom Story. I have placed a Hammer (name = "TheHammer") in TheEntry.map and I want to use it to open an door in Hall.map.



My Script: Hall.hps
Code:
void OnStart()  
{

AddUseItemCallback("", "TheHammer", "CellarDoor", "DestroyDoor", true);[...]

}



void DestroyDoor ()  

{
SetMessage("Messages", "A11_Door", 0);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
SetSwingDoorLocked("CellarDoor", false, false);
AddPlayerSanity(8);
}







The Problem is: Nothing happens when I use the Hammer on the Door. When I use it a 2nd time it says "This item is useless for this situation".
I hope you can help me.
Thanks in advance.





RE: Item from other Level - Rapture - 04-11-2012

(04-11-2012, 03:06 PM)Knittel Wrote: Hello everyone,

I have a small problem in my Amnesia Custom Story. I have placed a Hammer (name = "TheHammer") in TheEntry.map and I want to use it to open an door in Hall.map.



My Script: Hall.hps
Code:
void OnStart()  
{

AddUseItemCallback("", "TheHammer", "CellarDoor", "DestroyDoor", true);[...]

}



void DestroyDoor ()  

{
SetMessage("Messages", "A11_Door", 0);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
SetSwingDoorLocked("CellarDoor", false, false);
AddPlayerSanity(8);
}







The Problem is: Nothing happens when I use the Hammer on the Door. When I use it a 2nd time it says "This item is useless for this situation".
I hope you can help me.
Thanks in advance.
Add

string &in entity, string &in type

to


void DestroyDoor ()

so its like...

void DestroyDoor (string &in entity, string &in type)






RE: Item from other Level - Cranky Old Man - 04-11-2012


You shouldn't be surprised that you'll only have one chance to interact with the door, as you've set it to be a once-only interaction.