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


Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script again..
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: script again..

First, in the level editor find the area "placeWW", in the second tab, make sure "Item Interaction" is checked. Here's the script based on what I think you're trying to accomplish:


void OnStart()
{
SetLocalVarInt("PlaceItemVar", 0);
AddUseItemCallback("", "contWW_2", "placeWW", "ItemInOven", true); ///when the player uses "contWW_2" on "placeWW", it triggers "ItemInOven".
SetEntityConnectionStateChangeCallback("ovenlever", "PullLever"); //Triggers the function "PullLever" when the lever is pulled.
}

void ItemInOven(string &in asItem, string &in asEntity) //Removes the item from inventory, adds a variable
{
RemoveItem(asItem);
AddLocalVarInt("PlaceItemVar", 1);
}

void PullLever(string &in asEntity, int alState) //If the variable is 1 and the lever is pulled, "contBmeat" will be set active
{
if(GetLocalVarInt("PlaceItemVar") == 1 && alState == -1)
{
SetEntityActive("contBmeat", true);
}
}

I hope that's more along the lines of what you want to accomplish;l if there are still any issues/problems, reply back with explicit detail of exactly you want the player to do for this puzzle.

Hope that helped!

I rate it 3 memes.
09-10-2012, 12:49 AM
Find


Messages In This Thread
script again.. - by Alento - 09-09-2012, 11:43 PM
RE: script again.. - by Adny - 09-10-2012, 12:15 AM
RE: script again.. - by Alento - 09-10-2012, 12:22 AM
RE: script again.. - by Adny - 09-10-2012, 12:28 AM
RE: script again.. - by Alento - 09-10-2012, 12:35 AM
RE: script again.. - by Adny - 09-10-2012, 12:49 AM



Users browsing this thread: 1 Guest(s)