Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More scripting errors. Please help!
Author Message
EthanLancaster Offline
Junior Member

Posts: 15
Joined: Mar 2012
Reputation: 0
Post: #1
More scripting errors. Please help!
This scripting has been giving me alot of trouble. Im trying to get a key to unlock a door. Can someone please show me whats wrong with it?

void OnStart ()
{
AddUseItemCallback("", "LibraryKey", "mansion_2", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "StartPoint_Quest", "GetStartPoint", true, 1);
AddEntityCollideCallback("Player", "StartPoint_Quest", "FinishStartPoint", true, 1);
}
void KeyOnDoor(string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 1, false);
RemoveItem("LibraryKey");
GiveSanityBoostSmall();
}

void GetStartPoint(string &in asParent, string &in asChild, int alState)
{
AddQuest("investigate","Investigate");
PlayGuiSound("react_breath_slow", 0.5f);
}

void FinishStartPoint(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("investigate","Investigate") ;
GiveSanityBoostSmall();
}
03-16-2012 08:28 PM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,175
Joined: Mar 2011
Reputation: 56
Post: #2
RE: More scripting errors. Please help!
Callback functions for item use on an entity require two parameters. Your function KeyOnDoor will need a second parameter. The first is the item reference (which item was used by the player), while the second is the entity reference (the entity the item was used on). Change your parameters -- the statements in the parenthesis directly following your function name (in this case, it is KeyOnDoor) -- to reflect this.

(This post was last modified: 03-16-2012 08:33 PM by palistov.)
03-16-2012 08:33 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)