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
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: enemy pathnode not working!=Solved!

You solved it? Oh, alright then.

04-17-2014, 02:24 AM
Find
Wafflychicken Offline
Junior Member

Posts: 13
Threads: 3
Joined: Apr 2014
Reputation: 1
#3
RE: enemy pathnode not working!=Solved!

(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
04-18-2014, 03:04 AM
Find




Users browsing this thread: 2 Guest(s)