Frictional Games Forum (read-only)
Key in jar - 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: Key in jar (/thread-18508.html)



Key in jar - Damascus - 09-26-2012

I just plain can't figure out how it works! I checked the map and script for Daniel's Room, and found the only hint to be that the "contained item" for the object was "key_study." Nothing in the HPS about the key_jar or anywhere else really. Yet when I set the key_jar to have this contained item, nothing appears when I break it. How can I get a key to appear, and have a custom description.0


RE: Key in jar - jamesclarke555 - 09-26-2012

The key should appear if you have "key_study" set as the contained item.

The problem I had was; I found that the key is hard coded to look for:

<Entry Name="ItemName_KeyStudy">
<Entry Name="ItemDesc_KeyStudy">


If I remember correctly, the description is always picked up from the main Amnesia english.lang file, so you would need to create a total conversion as custom stories will always display "Machine Room Key" when the key is picked up!


RE: Key in jar - Vic7im - 09-27-2012

A cheap trick that might work:

You create the jar, make it Static and without a contained item.
You create the key_custom and place it in the same spot the contained key is, make it inactive.
Create a callback when interacting with the Jar so that it breaks (prophealth = -1) and sets your key_custom active.

This should work, imho.


RE: Key in jar - FlawlessHappiness - 09-27-2012

(09-27-2012, 09:13 AM)Vic7im Wrote: A cheap trick that might work:

You create the jar, make it Static and without a contained item.
You create the key_custom and place it in the same spot the contained key is, make it inactive.
Create a callback when interacting with the Jar so that it breaks (prophealth = -1) and sets your key_custom active.

This should work, imho.
But it wouldn't make sense that the bottle just broke...


RE: Key in jar - Vic7im - 09-27-2012

(09-27-2012, 11:11 AM)beecake Wrote:
(09-27-2012, 09:13 AM)Vic7im Wrote: A cheap trick that might work:

You create the jar, make it Static and without a contained item.
You create the key_custom and place it in the same spot the contained key is, make it inactive.
Create a callback when interacting with the Jar so that it breaks (prophealth = -1) and sets your key_custom active.

This should work, imho.
But it wouldn't make sense that the bottle just broke...
Try this:

Spoiler below!


void OnStart()
{
SetEntityPlayerInteractCallback("Jar", "CreateKey", true);

}




void CreateKey (string &in asEntity)
{
SetPropHealth("Jar", -1);
AddPropImpulse("Jar", 0, 0, 1, "world");
SetEntityActive("Key", true);
}


Result here: http://www31.zippyshare.com/v/62757806/file.html