05-14-2014, 06:01 PM
Ok what i wanna and what i try to do is to make a script when player enter some kinda room and step there are 2 areas (i make it so same when he enter 1 he will enter and 2 area in the same time) so the area 1 should make him look back what it does,so while he is looking back or turning around then timer from area 2 should react so then doors HARD close and lock so there is 1 key in room and when i make it pick up just to pick up key doors unlock (without using key)
My .hps
Problems:
It is IFC (isolated full conversion) so maybe i need put some sounds in my files ?
My .hps
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "CloseDoor", "CollideLockDoor", true, 1);
AddEntityCollideCallback("Player", "Area01", "LookBack01", true, 1);
AddTimer("DoorDown", 3, "CollideLockDoor");
}
void LookBack01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door01", 2, 25, "CallbackName");
AddTimer("", 3, "StopLookingAtDoor");
}
void StopLookingAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}
void CollideLockDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("Door01", true, true);
PlaySoundAtEntity("bang", "scare_slam_door", "castle_1", 0.0f, false);
StartScreenShake(0.02f, 1.0f, 0.5f, 1.0f);
}
{
AddEntityCollideCallback("Player", "CloseDoor", "CollideLockDoor", true, 1);
AddEntityCollideCallback("Player", "Area01", "LookBack01", true, 1);
AddTimer("DoorDown", 3, "CollideLockDoor");
}
void LookBack01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door01", 2, 25, "CallbackName");
AddTimer("", 3, "StopLookingAtDoor");
}
void StopLookingAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}
void CollideLockDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("Door01", true, true);
PlaySoundAtEntity("bang", "scare_slam_door", "castle_1", 0.0f, false);
StartScreenShake(0.02f, 1.0f, 0.5f, 1.0f);
}
Problems:
Spoiler below!
1:He turns behind but the doors are closed till he turns behind!
2:Sound is not appearing
2:Sound is not appearing
It is IFC (isolated full conversion) so maybe i need put some sounds in my files ?