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
unlock door
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: unlock door

I'll walk you through the mistakes then post a full revision Big Grin

Spoiler below!

void OnStart()
{ <-----Extra bracket
( <---Here you used parentheses instead of a bracket
AddUseItemCallback("", "firstdoorkey", "firstdoor", "UsedKeyOnDoor", "true"); <----true should not be declared (in quotation marks)
) <---Here you used parentheses instead of a bracket

void MyFunc(string &in asItem, string &in asEntity) <---This function is MyFunc, but in the callback you used UsedKeyOnDoor
( <---Here you used parentheses instead of a bracket
SetSwingDoorLocked("firstdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "firstdoor", 0, false);
RemoveItem("firstdoorkey");
) <---Here you used parentheses instead of a bracket



Finally, here's a full revision; copy and paste this into your hps file. Make sure to delete any previous contents:

Spoiler below!


void OnStart()
{
AddUseItemCallback("", "firstdoorkey", "firstdoor", "UsedKeyOnDoor", true);
}

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



void OnEnter()
{

}


void OnLeave()
{

}


If you have any more problems after this, they're not script (hps) related.

Hope that helped!

I rate it 3 memes.
(This post was last modified: 10-08-2012, 09:03 PM by Adny.)
10-08-2012, 09:02 PM
Find


Messages In This Thread
unlock door - by rodrigo1999 - 10-08-2012, 08:53 PM
RE: unlock door - by Adny - 10-08-2012, 09:02 PM
RE: unlock door - by The chaser - 10-08-2012, 09:13 PM
RE: unlock door - by rodrigo1999 - 10-08-2012, 09:27 PM



Users browsing this thread: 1 Guest(s)