The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Use item in other levels
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
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.
04-23-2012, 09:22 AM
Find


Messages In This Thread
Use item in other levels - by FlawlessHappiness - 04-23-2012, 09:22 AM
RE: Use item in other levels - by Mine Turtle - 04-23-2012, 09:40 AM
RE: Use item in other levels - by i3670 - 04-23-2012, 10:26 AM
RE: Use item in other levels - by Cranky Old Man - 04-23-2012, 10:39 AM
RE: Use item in other levels - by Cranky Old Man - 04-23-2012, 10:54 AM
RE: Use item in other levels - by Mine Turtle - 04-23-2012, 10:57 AM
RE: Use item in other levels - by Cranky Old Man - 04-23-2012, 11:07 AM
RE: Use item in other levels - by Mine Turtle - 04-23-2012, 12:25 PM
RE: Use item in other levels - by Knittel - 04-23-2012, 01:06 PM
RE: Use item in other levels - by Cranky Old Man - 04-24-2012, 07:08 PM
RE: Use item in other levels - by Cranky Old Man - 04-24-2012, 08:12 PM



Users browsing this thread: 2 Guest(s)