Frictional Games Forum (read-only)
enemy pathnode not working!=Solved! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: enemy pathnode not working!=Solved! (/thread-25088.html)



enemy pathnode not working!=Solved! - Wafflychicken - 04-17-2014

hi guys

so i've come up too a problem with my custom story where I basically want my enemy grunt who is not active to become active as soon as I walk into the area script for him. I also want him to follow the path node's that I have put down but when I enter the area box in game nothing happens, he doesnt spawn at all and when i set him to not active and go inside the box he just stands there and doesnt do anything if someone could tell me why he is not responding to my script i would appreciate it

anyway here is the .hps file

void OnStart()
{
SetLocalVarInt("DoorLocked", 1);
AddUseItemCallback("","key_1","Locked_Door", "UseKeyOnDoor", true);
SetEntityPlayerInteractCallback("Locked_Door", "DoorLockedPlayer", false);
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
}

void EventCollide(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);

AddEnemyPatrolNode("grunt", "Node_1", 0.001f, "");
AddEnemyPatrolNode("grunt", "Node_2", 0.001f, "");
AddEnemyPatrolNode("grunt", "Node_3", 0.001f, "");
AddEnemyPatrolNode("grunt", "Node_4", 0.001f, "");
}



void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
SetLocalVarInt("DoorLocked", 0);
}

void DoorLockedPlayer(string &in asEntity)
{
if(GetLocalVarInt("DoorLocked") == 1)
{
SetMessage("Messages", "msgname", 2);
}
}

void OnEnter()
{
PlayMusic("IntroTheme.ogg", false, 0.9, 1.0, 1, true) ;
}

void OnLeave()
{
StopMusic(1, 1);
}


RE: enemy pathnode not working!=Solved! - Mudbill - 04-17-2014

You solved it? Oh, alright then.


RE: enemy pathnode not working!=Solved! - Wafflychicken - 04-18-2014

(04-17-2014, 02:24 AM)Mudbill Wrote: You solved it? Oh, alright then.

yeah I got it working there was nothing wrong with it it just turns out that it was created on a different map and i forgot to add it to that .hps file silly me Undecided