Triggering Monsters
Hello,
I don't know if this is the right place to post this thread but I am new here.
Well I have tried everything to trigger a monster and make it walk from one position to another and then dissapear.
I've added a monster and 1 PathNode and I added a script area.
But everytime I end up getting different kinds of errors like : Invalid Token ''{'', etc
This is what I've got so far :
////////////////////////////
// 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()
{
}
As you can see I can trigger a door to close itself but I can't seem to trigger a monster, I started off the same way as I started with the door but then instead of CloseDoor I used this scripts :
void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);
Could someone Please help me, I've searched all of the internet but no one can give me a answer.
|