Frictional Games Forum (read-only)

Full Version: Key in jar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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!
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.
(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...
(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