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
Triggering Monsters
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: Triggering Monsters

If you already have a deactivated monster in your map, then:
void OnStart()
{
AddEntityCollideCallback("Player", "AreaEen", "CollideRoomEen", true, 1);
}

void CollideRoomEen(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("hanskamerdeur", true, true);
SetEntityActive("monster_name_here", true);
AddEnemyPatrolNode("monster_name_here", "node_name_here", 0, "");
}


////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "hanskamerdeurkey_1", "hanskamerdeur", "UsedKeyOnDoor", true);
}

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


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

}

08-12-2011, 06:28 PM
Website Find


Messages In This Thread
Triggering Monsters - by HansEnMilan - 08-12-2011, 05:54 PM
RE: Triggering Monsters - by Tanshaydar - 08-12-2011, 06:06 PM
RE: Triggering Monsters - by HansEnMilan - 08-12-2011, 06:25 PM
RE: Triggering Monsters - by Tanshaydar - 08-12-2011, 06:28 PM
RE: Triggering Monsters - by HansEnMilan - 08-12-2011, 06:38 PM
RE: Triggering Monsters - by Tanshaydar - 08-12-2011, 06:56 PM
RE: Triggering Monsters - by HansEnMilan - 08-12-2011, 06:59 PM
RE: Triggering Monsters - by MegaScience - 08-13-2011, 06:20 AM



Users browsing this thread: 1 Guest(s)