Frictional Games Forum (read-only)
Having Trouble making a door lock and close behind me. Help Please! :) - 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: Having Trouble making a door lock and close behind me. Help Please! :) (/thread-16297.html)



Having Trouble making a door lock and close behind me. Help Please! :) - Watskeeee - 06-19-2012

So far, this is my coding of the first half.

void OnStart()
{
AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);
AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor", true);
}

AddEntityCollideCallback("Player", "RoomofSecretsArea", "CollideRoomTwo", "true", 1);
}

Void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorroom01", true, true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorroom01", false, true);
PlaySoundAtEntity("", "unlock_door", "doorroom01", 0, false);
RemoveItem("key01");
}


void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
StartPlayerLookAt("servant_brute_1", 15, 15, "");
AddTimer("monstertimer", 2, "monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");

}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}





I know theres something wrong in there, but I can't see where..


RE: Having Trouble making a door lock and close behind me. Help Please! :) - Datguy5 - 06-19-2012

This is the wrong place to post this.You have to post scripting,level editor etc. problems into development support.

void OnStart()
{
AddUseItemCallback("", "key01", "doorroom01", "KeyOnDoor", true);
AddUseItemCallback("", "key02", "doorroom02", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "RoomofSecretsArea", "CollideRoomTwo", "true", 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("doorroom01", true, true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("doorroom01", false, true);
PlaySoundAtEntity("", "unlock_door", "doorroom01", 0, false);
RemoveItem("key01");
}


void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
StartPlayerLookAt("servant_brute_1", 15, 15, "");
AddTimer("monstertimer", 2, "monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");

}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}
Try dat.


RE: Having Trouble making a door lock and close behind me. Help Please! :) - Watskeeee - 06-19-2012

Sorry, I didn't know, Its my first map.

Thanks for the help aswell! ^____^


RE: Having Trouble making a door lock and close behind me. Help Please! :) - Datguy5 - 06-19-2012

(06-19-2012, 01:30 PM)Watskeeee Wrote: Sorry, I didn't know, Its my first map.

Thanks for the help aswell! ^____^

Glad i could help.And good luck with your map!