Frictional Games Forum (read-only)

Full Version: Bottle/Breakable item key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As you may know there are items where on break another item pops out of it but for a key would it's name be the item it came out of?
What it looks like from the original Amnesia scripting is that whatever the jar's name is ("jar") that the object inside of it will be the jar's name plus _item ("jar_item"). Try that out.
thanks ill try it out
Triadtimes is correct,

It's "NAME_ITEM"

-Grey Fox
it didnt work am i doin something wrong im sing the lithium bromide bottle from justine and have study key on break i also renamed the bottle to "bromide"
heres my script for it

{
AddUseItemCallback("", "bromide_key_study", "DOOR", "FUNCTION", true);
}


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




(12-07-2011, 01:34 AM)hoppem Wrote: [ -> ]it didnt work am i doin something wrong im sing the lithium bromide bottle from justine and have study key on break i also renamed the bottle to "bromide"
heres my script for it

{
AddUseItemCallback("", "bromide_key_study", "DOOR", "FUNCTION", true);
}


void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DOOR", false, true);
PlaySoundAtEntity("", "unlock_door", "DOOR", 0, false);
RemoveItem("bromide_key_study");
}
I think I know what's wrong, what did you call the item? By the looks of it "bromide". Sorry, but, when I said put "_item" it didn't mean put "_" then the item in the container I meant put "_item"

What I think it should look like (if the bottle's name stays "bromide") is:
Code:
OnStart(){
AddUseItemCallback("", "bromide_item", "DOOR", "FUNCTION", true);
}


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

Hope this works.

IT WORKS yes very many thanks from hoppem!!!