enemy pathnode not working!=Solved!
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);
}
(This post was last modified: 04-17-2014, 12:29 AM by Wafflychicken.)
|