(08-12-2011, 06:06 PM)Tanshaydar Wrote: Hi and welcome to forum.
Yes, this is correct section.
You need to place a monster where you want to spawn it, then deactivate it in the editor. This can be done with unchecking "active" checkbox.
After that, you need to activate the monster, with setentityactive function; then add the patrols.
You need to add patrol nodes in level editor first.
You can find the exact functions here: http://wiki.frictionalgames.com/hpl2/amn..._functions
I tried this but I seem to fail haha, So If I'm correct I use :
void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
then link it with :
void SetEntityActive(string& asName, bool abActive);
and link that up with :
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);
Mind giving me an example that fits in with this:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "AreaEen", "CollideRoomEen", true, 1);
}
void CollideRoomEen(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("hanskamerdeur", true, true);
}
////////////////////////////
// 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()
{
}
I would be very very happy.