Frictional Games Forum (read-only)

Full Version: [SOLVED]Use combined object on door? Mr. Noob wants some help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I am having a little problem. I finally managed to combine my hammer and chipper into an item in my inventory, but when i then want it to i.e. unlock a door, it says "Cannot use the item this way". I would assume that it is the same code as using a key on a door ? Anyways, here is my code from both my inventory.hps and mapname.hps:

Code:
void OnGameStart()
{
    AddCombineCallback("hammer_and_chipper", "stone_hammer_1", "stone_chipper_1", "HammerChipper", false);
}

void HammerChipper(string &in item_1, string &in item_2)
{
    RemoveItem(item_1);
    RemoveItem(item_2);
    GiveItem("hammer_and_chipper", "Puzzle", "HammerAndChipper", "hammerandchipper.tga", 1);
}

Code:
void OnStart()
{
    AddUseItemCallback("hammer_and_chipper", "hammer_and_chipper", "cellar_wood01_1", "BreakDoor1", false);
    
}

void BreakDoor1(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("cellar_wood01_1", false, true);
}

Thanks in advance :-)
In your AddUseItemCallback, ignore the internal name.
Thanks, but still doesn't work though Undecided

EDIT: Well dag nammit. Apparently i had to restart the level editor, notepad++ and amnesia for it to work -.-'

But thanks for the help!