The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
enemy pathnode not working!=Solved!
Wafflychicken Offline
Junior Member

Posts: 13
Threads: 3
Joined: Apr 2014
Reputation: 1
#1
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.)
04-17-2014, 12:04 AM
Find


Messages In This Thread
enemy pathnode not working!=Solved! - by Wafflychicken - 04-17-2014, 12:04 AM



Users browsing this thread: 1 Guest(s)