Frictional Games Forum (read-only)
I cant get my script to work :( - 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: I cant get my script to work :( (/thread-12971.html)



I cant get my script to work :( - DnALANGE - 01-30-2012

Can someone please check this out for a little second...
I just want to make "daniel" to look back to an "unlocked" door.
so he opens the door and the door SLAMS back and close... { the door must stay UNLOCKED- need to get open still }
I jope some can help me PLEASE!
Here is my script so far...
////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key_1", "monsterdoor", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_1", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key_3", "door_3", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("Player" , "ScaryTrigger" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "ScaryTrigger" , "Func01" , true, 1);
AddEntityCollideCallback("Player" , "serge1" , "MonsterFunc2" , true , 1);
AddEntityCollideCallback("Player" , "serge1" , "Func02" , true, 1);
AddEntityCollideCallback("Player" , "RoomTwoArea" , "CollideRoomTwo" , true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
StartPlayerLookAt("mansion_2", "10.0f", "10.0f", "");
AddTimer("", 1,0f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem("key_1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_2");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "door_3", 0, false);
RemoveItem("key_3");
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("servant_brute_1", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_2" , true);
}

void Func02(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("servant_brute_2", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc2(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}



////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: I cant get my script to work :( - Your Computer - 01-30-2012

Explain what isn't working.


RE: I cant get my script to work :( - DraKerZz97 - 02-03-2012

What isnt working? all of it?????


RE: I cant get my script to work :( - Shives - 02-03-2012

You better create an Area next to the door ans name it for example "look"
Then you replace mansion_2 with look
Then it should look like this

StartPlayerLookAt("look", "10.0f", "10.0f", "");



RE: I cant get my script to work :( - BTOWN360 - 03-20-2012

firstly you need the extra_english.lang file to get your keys to work properly...they should be unlocking doors tho just no name to them.
also i think if you get rid of the timer for mansion_2 it might work...it does for me




RE: I cant get my script to work :( - Ultimegastriker - 05-05-2012

(02-03-2012, 07:32 PM)Shives Wrote: You better create an Area next to the door ans name it for example "look"
Then you replace mansion_2 with look
Then it should look like this

StartPlayerLookAt("look", "10.0f", "10.0f", "");
thats it