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
Amnesia HPL Problem!
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#1
Amnesia HPL Problem!

<removed><removed><removed><removed>
(This post was last modified: 01-19-2019, 02:23 AM by Brothersvv09.)
08-03-2012, 05:01 AM
Find
Froge Offline
Posting Freak

Posts: 2,955
Threads: 176
Joined: Jul 2012
Reputation: 125
#2
RE: Amnesia HPL Problem!

The semicolon indicates that a line of code has ended. Therefore you should put it at the end of a line of code rather than at the start. Speaking of which, quotations are needed around Key_1 for RemoveItem.

[Image: p229xcq]
08-03-2012, 05:17 AM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#3
RE: Amnesia HPL Problem!

like what Chronofox said you have to put the ";" in the end of the line and not in front and you forgot to make some { and } so this should work:
void OnStart()
{
AddUseItemCallback("", "Key_1", "LockedDoor1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
RemoveItem("Key_1");
}
and you also need quotations for LockedDoor1 and Key_1 which I included in my code.
I hope this helps Big Grin

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 08-03-2012, 09:30 AM by Steve.)
08-03-2012, 09:26 AM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#4
RE: Amnesia HPL Problem!

<removed><removed><removed><removed><removed>
(This post was last modified: 01-19-2019, 02:23 AM by Brothersvv09.)
08-03-2012, 10:32 PM
Find
Froge Offline
Posting Freak

Posts: 2,955
Threads: 176
Joined: Jul 2012
Reputation: 125
#5
RE: Amnesia HPL Problem!

Create a key for each door? Or do you mean you need one key to unlock both doors?

[Image: p229xcq]
08-03-2012, 11:12 PM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#6
RE: Amnesia HPL Problem!

<removed><removed><removed><removed>
(This post was last modified: 01-19-2019, 02:23 AM by Brothersvv09.)
08-03-2012, 11:43 PM
Find
Froge Offline
Posting Freak

Posts: 2,955
Threads: 176
Joined: Jul 2012
Reputation: 125
#7
RE: Amnesia HPL Problem!

void OnStart()
{
AddUseItemCallback("", "Key_2", "LockedDoor2", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor2", false, true);
RemoveItem("Key_2");
}

[Image: p229xcq]
08-04-2012, 12:35 AM
Find
Brothersvv09 Offline
Member

Posts: 57
Threads: 29
Joined: Aug 2012
Reputation: 0
#8
RE: Amnesia HPL Problem!

<removed><removed><removed><removed>
(This post was last modified: 01-19-2019, 02:23 AM by Brothersvv09.)
08-04-2012, 12:49 AM
Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#9
RE: Amnesia HPL Problem!

I think you did something worng the last time because this is really just how you do it:
 
void OnStart()
{
AddUseItemCallback("", "Key_1", "LockedDoor1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Key_2", "LockedDoor2", "KeyOnDoor", true);
}
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor1", false, true);
RemoveItem("Key_1");
}
 
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor2", false, true);
RemoveItem("Key_2");
}

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 08-04-2012, 12:36 PM by Steve.)
08-04-2012, 12:36 PM
Find




Users browsing this thread: 1 Guest(s)