Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using items from combining items
TarkoRehin Offline
Junior Member

Posts: 11
Threads: 3
Joined: Jan 2011
Reputation: 0
#1
Using items from combining items

How do I use an item obtained from combining two others to open for example a door?

Here's my inventory.hps file:
void CombineOilKey(string &in asItemA, string&in asItemB)
{
AddPlayerSanity(10);
RemoveItem(asItemA); RemoveItem(asItemB);
GiveItem("key_tomb", "Puzzle", "CabinetKey", "key_tomb.tga", 0);
}

void OnGameStart()
{
AddCombineCallback("", "key_cabinet_rusty", "glass_container_oil_1", "CombineOilKey", false);
}

This script works perfectly fine, I use the Oil on the Rusty Key and get the Key I want, however I'm not sure how to use the new key for another script.

Here's the script file for the level "Second_Floor"
void UnlockCabinet(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("unlock_door.snt", "cabinet_simple_1", asEntity, 0.0f, false);
SetSwingDoorLocked("cabinet_simple_1", false, true);
RemoveItem(asItem);
}

void OnStart()
{
AddUseItemCallback("", "key_tomb", "cabinet_simple_1", "UnlockCabinet", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

Obviously this is wrong, but I'm not sure what else to do. I've been staring at the script for the hand drill and hammer & chipper for a long time now and I can't make sense of it anymore >.< please help.

EDIT: Solved it! the above script should now be correct.

I'd very much appreciate if you checked out my Youtube channel: https://www.youtube.com/user/RehinRealm
Thanks!
(This post was last modified: 08-08-2011, 05:05 PM by TarkoRehin.)
08-07-2011, 11:05 PM
Find




Users browsing this thread: 1 Guest(s)