Frictional Games Forum (read-only)
Amnesia HPL Problem! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Amnesia HPL Problem! (/thread-17443.html)



Amnesia HPL Problem! - Brothersvv09 - 08-03-2012

<removed><removed><removed><removed>


RE: Amnesia HPL Problem! - Froge - 08-03-2012

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.


RE: Amnesia HPL Problem! - Steve - 08-03-2012

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


RE: Amnesia HPL Problem! - Brothersvv09 - 08-03-2012

<removed><removed><removed><removed><removed>


RE: Amnesia HPL Problem! - Froge - 08-03-2012

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


RE: Amnesia HPL Problem! - Brothersvv09 - 08-03-2012

<removed><removed><removed><removed>


RE: Amnesia HPL Problem! - Froge - 08-04-2012

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

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


RE: Amnesia HPL Problem! - Brothersvv09 - 08-04-2012

<removed><removed><removed><removed>


RE: Amnesia HPL Problem! - Steve - 08-04-2012

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");
}