Frictional Games Forum (read-only)

Full Version: enemy pathnode not working!=Solved!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}
You solved it? Oh, alright then.
(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