Use item in other levels
Yea so the idea is that you pick up an item in one level.
Use it on an area to get another item, in the same level.
Then that is used on an area in another level.
But the last thing won't work!
My keys work the same way (Except they ain't traded for another item)
My script:
LEVEL 1
void OnEnter()
{
AddUseItemCallback("", "glas", "gryde", "GlasGryde", true);
AddUseItemCallback("", "fiskeolie", "gryde1", "UseItemOnArea", true);
}
///////////////////// This is where you trade the item ("glas") to get "fiskeolie" (glass_container_mix_done)
void GlasGryde(string &in asItem, string &in asEntity)
{
GiveItem("", "glass_container_mix_done", "fiskeolie", "glass_container_mix_done.tga", 1);
RemoveItem("glas");
AddPlayerSanity(5.0f);
}
/////////////////////This is where the item is used in LEVEL 2 (But i also put it in this script file)
void UseItemOnArea(string &in asItem, string &in asEntity)
{
RemoveItem("fiskeolie");
SetEntityActive("Fiskeolie_static_1", true);
SetSwingDoorLocked("mansion_5", true, true);
StartPlayerLookAt("mansion_8", 10, 10, "");
AddTimer("", 0.3, "LookAtDoor_1");
}
LEVEL 2
void OnStart()
{
AddUseItemCallback("", "fiskeolie", "gryde1", "UseItemOnArea", true);
}
/////////////////////Same script from LEVEL 1
void UseItemOnArea(string &in asItem, string &in asEntity)
{
RemoveItem("fiskeolie");
SetEntityActive("Fiskeolie_static_1", true);
SetSwingDoorLocked("mansion_5", true, true);
StartPlayerLookAt("mansion_8", 10, 10, "");
AddTimer("", 0.3, "LookAtDoor_1");
}
But in LEVEL 2 i can't use the item on the area...
I tried making the item (with same subitemtypename) in LEVEL 2, so the player just had to pick it up.
It worked perfectly! What am i missing?
Trying is the first step to success.
|