eagledude4
Member
Posts: 144
Threads: 14
Joined: Dec 2011
Reputation:
0
|
RE: Monster Path Help
Follow the player into a room based on which area they enter.
You can look at the picture above to see the layout of the map.
Its hard to see the truth when you've been blinded by lies.
|
|
01-06-2012, 02:04 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Monster Path Help
You already have two areas encompassing each room, so let's divide the path nodes into two groups, red and blue (purple is where they both include the same path nodes). Look at this image:
In the collide callback, you check for what area the player collided with and add path nodes to the monster for that area. For example,
void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_grunt_1", true); if (asChild == "name_of_area_on_the_left") { // add the circled path nodes in the red box }
else if (asChild == "name_of_area_on_the_right") { // add the circled path nodes in the blue box } }
|
|
01-06-2012, 09:52 PM |
|
eagledude4
Member
Posts: 144
Threads: 14
Joined: Dec 2011
Reputation:
0
|
RE: Monster Path Help
My code now looks like:
void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) {
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
if(GetEntitiesCollide("Player", "SonRoomArea") == true) {
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 8, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
} else if(GetEntitiesCollide("Player", "DadRoomArea") == true) {
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_30", 8, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
}
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_31", 0, "");
}
I don't fully understand what "if (asChild == "name_of_area_on_the_left")" means.
I just seen your post on this thread: http://www.frictionalgames.com/forum/thread-12444.html
You said that if the player is out of the monster's range, the monster doesn't follow it's path?
Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-11-2012, 10:27 PM by eagledude4.)
|
|
01-11-2012, 10:17 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Monster Path Help
(01-11-2012, 10:17 PM)eagledude4 Wrote: I've done exactly what you described (at least to my knoweldge). The only thing that's different with your code is you have
if (asChild == "name_of_area_on_the_left")
and I have
if(GetEntitiesCollide("Player", "SonRoomArea") == true) {
I don't fully understand what yours means though. the "asChild" refers to the area given. "name_of_area_on_the_left" is the name of the left area... What else is there to explain? Replace that with the name of the area that you applied in the map.
You have some studying to do.
(This post was last modified: 01-11-2012, 10:20 PM by Statyk.)
|
|
01-11-2012, 10:19 PM |
|
eagledude4
Member
Posts: 144
Threads: 14
Joined: Dec 2011
Reputation:
0
|
RE: Monster Path Help
(01-11-2012, 10:19 PM)Statyk Wrote: the "asChild" refers to the area given.
Doesn't my code have the same effect though?
Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-11-2012, 10:22 PM by eagledude4.)
|
|
01-11-2012, 10:22 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Monster Path Help
(01-11-2012, 10:22 PM)eagledude4 Wrote: (01-11-2012, 10:19 PM)Statyk Wrote: the "asChild" refers to the area given.
Doesn't my code have the same effect though? Not exactly. Try using Your Computer's example and come back if you have issues...
|
|
01-11-2012, 10:26 PM |
|
eagledude4
Member
Posts: 144
Threads: 14
Joined: Dec 2011
Reputation:
0
|
RE: Monster Path Help
Will do, but can I get confirmation on this?:
Quote:They will only continue following the patrol path if the player is within their activation distance or if the player can still see the monster. Otherwise, they'll be deactivated.
I need the grunt to follow the path regardless of where the player is, or if the grunt can see the player.
EDIT: I just triggered the grunt and entered one of the areas, but the grunt didn't break down the door to continue it's path.
void EnteredEnemyTriggerArea(string &in asParent, string &in asChild, int alState) {
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
if (asChild == "SonRoomArea") {
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 8, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
} else if (asChild == "DadRoomArea") {
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_30", 8, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
}
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_31", 0, "");
}
Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-11-2012, 10:36 PM by eagledude4.)
|
|
01-11-2012, 10:30 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Monster Path Help
Make sure he's following the path...
I hate to sound rude, but try to look at it and figure it out on your own THE BEST YOU CAN. I feel like you're just letting us move your mouse where necessary. I love to help, but I can't help unless you help yourself.
When you teach a child to walk for the first time, do you move it's legs one foot in front of the other? No. You help them up and let them try to walk on their own...
|
|
01-11-2012, 10:41 PM |
|
eagledude4
Member
Posts: 144
Threads: 14
Joined: Dec 2011
Reputation:
0
|
RE: Monster Path Help
(01-11-2012, 10:41 PM)Statyk Wrote: Make sure he's following the path...
I hate to sound rude, but try to look at it and figure it out on your own THE BEST YOU CAN. I feel like you're just letting us move your mouse where necessary. I love to help, but I can't help unless you help yourself.
When you teach a child to walk for the first time, do you move it's legs one foot in front of the other? No. You help them up and let them try to walk on their own...
I can't watch the monster, because then he doesn't act the way he's supposed to. He will stop following the path entirely, and just come after me.
I'm not asking you to do everything for me, I just want someone's opinion on whats wrong with what I'm doing.
Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-11-2012, 10:43 PM by eagledude4.)
|
|
01-11-2012, 10:42 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Monster Path Help
Tip. Go into the level editor and to the enemy. go to it's "Entity" tab and make sure "DisableTriggers" is CHECKED. He will not go after the player or react to sounds n matter what.
|
|
01-11-2012, 10:45 PM |
|
|