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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help getting a needle to unlock a door
Author Message
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #1
getting a needle to unlock a door
what is the script used to get a hollow need to unlock a wooden door?
03-31-2012 04:35 AM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #2
RE: getting a needle to unlock a door
AddUseItemCallback

SetSwingDoorLocked

RemoveItem

PlaySoundAtEntity

(This post was last modified: 03-31-2012 10:16 AM by SilentStriker.)
03-31-2012 10:15 AM
Find all posts by this user Quote this message in a reply
HollowRiku13 Offline
Member

Posts: 93
Joined: Dec 2011
Reputation: 2
Post: #3
RE: getting a needle to unlock a door
void OnStart()
{
AddUseItemCallback("", "Nameofyourneedle", "Nameofyourdoor", "Needle", true);
}


void Needle(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofyourdoor", false);
PlaySoundAtEntity("", "unlock_door", "nameofyourdoor", 0, false);
RemoveItem("nameofyourneedle");
}

I hope it works, sorry if it's kinda rushed, I'm in a hurry.
03-31-2012 10:17 AM
Find all posts by this user Quote this message in a reply
Kreekakon Offline
Posting Freak

Posts: 1,507
Joined: Mar 2012
Reputation: 44
Post: #4
RE: getting a needle to unlock a door
Here's a tutorial. It helped me when I was first in this pinch.
http://wiki.frictionalgames.com/hpl2/tut...cks_a_door
03-31-2012 10:28 AM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #5
RE: getting a needle to unlock a door
(03-31-2012 10:17 AM)HollowRiku13 Wrote:  void OnStart()
{
AddUseItemCallback("", "Nameofyourneedle", "Nameofyourdoor", "Needle", true);
}


void Needle(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofyourdoor", false);
PlaySoundAtEntity("", "unlock_door", "nameofyourdoor", 0, false);
RemoveItem("nameofyourneedle");
}

I hope it works, sorry if it's kinda rushed, I'm in a hurry.
or he can just write RemoveItem(asItem);

03-31-2012 10:52 AM
Find all posts by this user Quote this message in a reply
zombiehacker595 Offline
Member

Posts: 141
Joined: Mar 2012
Reputation: 3
Post: #6
RE: getting a needle to unlock a door
(03-31-2012 10:52 AM)SilentStriker Wrote:  
(03-31-2012 10:17 AM)HollowRiku13 Wrote:  void OnStart()
{
AddUseItemCallback("", "Nameofyourneedle", "Nameofyourdoor", "Needle", true);
}


void Needle(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofyourdoor", false);
PlaySoundAtEntity("", "unlock_door", "nameofyourdoor", 0, false);
RemoveItem("nameofyourneedle");
}

I hope it works, sorry if it's kinda rushed, I'm in a hurry.
or he can just write RemoveItem(asItem);
works great thanks Smile
03-31-2012 11:17 AM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #7
RE: getting a needle to unlock a door
(03-31-2012 10:52 AM)SilentStriker Wrote:  
(03-31-2012 10:17 AM)HollowRiku13 Wrote:  void OnStart()
{
AddUseItemCallback("", "Nameofyourneedle", "Nameofyourdoor", "Needle", true);
}


void Needle(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofyourdoor", false);
PlaySoundAtEntity("", "unlock_door", "nameofyourdoor", 0, false);
RemoveItem("nameofyourneedle");
}

I hope it works, sorry if it's kinda rushed, I'm in a hurry.
or he can just write RemoveItem(asItem);
Technically he could just write


SetLevelDoorLocked(asEntity , false);

PlaySoundAtEntity("", "unlock_door", "asEntity", 0, false); c:

03-31-2012 04:41 PM
Find all posts by this user Quote this message in a reply
HollowRiku13 Offline
Member

Posts: 93
Joined: Dec 2011
Reputation: 2
Post: #8
RE: getting a needle to unlock a door
I'm sorry, as I said, yesterday I was in a hurry, I just copied a part of my script.
04-01-2012 12:38 AM
Find all posts by this user Quote this message in a reply
Iyiyt Offline
Junior Member

Posts: 13
Joined: Jul 2012
Reputation: 0
Post: #9
RE: getting a needle to unlock a door
Actually, I'm having a problem with this. I set the door as "locked" in my level editor, and when I use the needle on it, it makes the noise but it stays locked. So I set the door as unlocked, and in my script, in OnEnter, I put "SetLevelDoorLocked(true);", so it would hopefully stay locked until I used the needle. But no, the door is just unlocked. What am I doing wrong? Here's my script:
void OnEnter()
{
ChangePlayerStateToNormal();
SetLanternDisabled(false);
SetEntityPlayerLookAtCallback("JimmyOne", "JimmyOne", true);
SetLevelDoorLocked("RoomDoor", true);
AddUseItemCallback("", "JimmyOne", "RoomDoor", "UnlockOne", true);
}

void JimmyOne(string &in asEntity, int alState)
{
SetMessage("Message", "JimmyMessageOne", 6.0f);
}

void UnlockOne(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("RoomDoor", false);
PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
RemoveItem("JimmyOne");
}
(This post was last modified: 08-08-2012 02:14 AM by Iyiyt.)
08-07-2012 11:57 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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