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
Key Problem
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#4
RE: Key Problem

My Whole Script? Okay

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Mansion_5", "MonsterActivate", true);
AddUseItemCallback("", "LockedDoorKey_1", "LockedDoor_1", "UsedKeyOnDoor", true);    
AddUseItemCallback("", "Key_2", "Door_2", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Scare_1", "CollideScare_1", true, 1);
AddEntityCollideCallback("Player", "Doorslam_1", "CollideDoorslam_1", true, 1);
AddEntityCollideCallback("Player", "MonsterActivate", "CollideMonsterActivate", true, 1);
}

void MonsterActivate(string &in Entity)
{
    SetEntityActive("Frank", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("LockedDoor_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
    RemoveItem("LockedDoorKey");

    SetSwingDoorLocked("Door_2", false, true);
    PlaySoundAtEntity("", "unlock_door", "Door_2", 0, false);
    RemoveItem("Key_2");
}

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

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

void CollideMonsterActivate(string &in asParent, string &in asChild, int alState)
{
    SetNPCAwake("Frank_2", true, false);
    AddEnemyPatrolNode("Frank_2", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Frank_2", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Frank_2", "PathNodeArea_17", 0, "");
    AddEnemyPatrolNode("Frank_2", "PathNodeArea_27", 0, "");
    AddEnemyPatrolNode("Frank_2", "PathNodeArea_36", 0, "");
    SetEnemyDisabled("Frank_2", true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

Ignore the bottom part with all the waypoints i have to fix that Unless someone knows how to fix that? It won't activate. no error or anything but not the point.

-Grey Fox

Current Project
Forgotten
07-13-2011, 11:38 PM
Find


Messages In This Thread
Key Problem - by GreyFox - 07-13-2011, 10:39 PM
RE: Key Problem - by SkuLLfac3 - 07-13-2011, 10:54 PM
RE: Key Problem - by xtron - 07-13-2011, 11:20 PM
RE: Key Problem - by GreyFox - 07-13-2011, 11:38 PM
RE: Key Problem - by SkuLLfac3 - 07-14-2011, 12:12 AM
RE: Key Problem - by Zypherzemus - 07-14-2011, 02:09 AM
RE: Key Problem - by xtron - 07-14-2011, 03:04 AM
RE: Key Problem - by GreyFox - 07-15-2011, 03:07 PM



Users browsing this thread: 1 Guest(s)