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
More scripting errors. Please help!
EthanLancaster Offline
Junior Member

Posts: 15
Threads: 9
Joined: Mar 2012
Reputation: 0
#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
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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




Users browsing this thread: 1 Guest(s)