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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Didn't Work...
Neurological Offline
Member

Posts: 71
Threads: 11
Joined: Sep 2010
Reputation: 1
#2
RE: Script Didn't Work...

I'm not a script expert but I think you missed the closing branch on OnLeave, and maybe you should add:

AddUseItemCallback("", "awesomekey_2" , "lockedcellardoor1" , "UsedKeyOnDoor" , true);

under OnStart right after:

AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1);

So in the end the full script would look like this:

void OnStart()

{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideRoomTwo" , true, 1);
AddUseItemCallback("", "awesomekey_2" , "lockedcellardoor1" , "UsedKeyOnDoor" , true);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("cellar_wood01_1", true, true);
GiveSanityDamage(25, true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockedcellardoor1" , false, true);
PlaySoundAtEntity("", "unlock_door" , "lockedcellardoor1" , 0, false);
RemoveItem(awesomekey_2);
}

void OnEnter()
{

}

void OnLeave()
{

}

Neurological - Music Entertainment
http://www.neuro-lab.net
10-10-2010, 01:35 AM
Find


Messages In This Thread
Script Didn't Work... - by Kyle - 10-10-2010, 01:17 AM
RE: Script Didn't Work... - by Neurological - 10-10-2010, 01:35 AM
RE: Script Didn't Work... - by Kyle - 10-10-2010, 02:39 AM
RE: Script Didn't Work... - by Neurological - 10-10-2010, 02:46 AM
RE: Script Didn't Work... - by Kyle - 10-10-2010, 01:33 PM



Users browsing this thread: 1 Guest(s)