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
Help with grunt maze pathfinding?
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#14
RE: Help with grunt maze pathfinding?

(06-13-2013, 10:31 PM)Amn Wrote: I mean a timer to repeat the process.
Mostly to keep the grunt controlled.
Because sometimes, as you know, they disappear, get stuck and such. Grunt stuff.

I would make a function that resets the grunt, adds all the pathnodes again and starts a timer to call itself later.

Im going to test the resetprop function on the grunts and see if it works, but here is what I gathered from what you said.

ResetProp("servant_grunt_1");
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "node1", 1.0f, "idle");
AddTimer("gruntPath", 2.0f, "GruntMazePatrol");

Is this the kind of code you meant? (Of course with more nodes that is)

I just wanted to report that I tested out some code (which I am posting below) and it seemed to work. I have no way of knowing if the resetprop function worked, but no errors showed up and the test grunt patrolled the area repeatedly with no problems (I disabled his triggers so I could observe). I am going to try implementing this code with the main grunt and will let you know if it works or not. If I am not doing something right, please respond and let me know.
CODE:
void GruntTest(string &in asParent, string &in asChild, int alState)
{
ResetProp("servant_grunt_2");
SetEnemyDisableTriggers("servant_grunt_2", true);
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_1", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_2", 1.0f, "idle");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 1.0f, "idle");
AddTimer("gruntPath", 2.0f, "GruntTest");
}

I tested it out and it worked great except for one small error which I believe I know how to fix.
As soon as he reached node 17 (the last node I made) he began to wander around trying to walk through the walls. Since I did not make his path loop back on itself I believe he was trying to walk through the bookshelves to node 1. I will make his path loop back to an area where he can easily walk to node 1. Other than that, I am thankful for all of your help. If I am missing anything or if there are any other suggestions please let me know. I will mark this post as sovled at the end of the day just in case I am missing something.
(This post was last modified: 06-16-2013, 12:54 AM by zergling50.)
06-16-2013, 12:30 AM
Find


Messages In This Thread
Help with grunt maze pathfinding? - by zergling50 - 04-06-2013, 09:08 PM
RE: Help with grunt maze pathfinding? - by NaxEla - 04-11-2013, 07:55 AM
RE: Help with grunt maze pathfinding? - by GrAVit - 06-12-2013, 07:59 AM
RE: Help with grunt maze pathfinding? - by GrAVit - 06-13-2013, 10:02 PM
RE: Help with grunt maze pathfinding? - by zergling50 - 06-16-2013, 12:30 AM



Users browsing this thread: 2 Guest(s)