Frictional Games Forum (read-only)
[LVL ED] Monster Path Help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [LVL ED] Monster Path Help (/thread-12269.html)

Pages: 1 2 3 4


RE: Monster Path Help - eagledude4 - 01-06-2012

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.



RE: Monster Path Help - Your Computer - 01-06-2012

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:

[Image: pic3ms.th.jpg]

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,

PHP Code:
void EnteredEnemyTriggerArea(string &in asParentstring &in asChildint 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
    
}




RE: Monster Path Help - eagledude4 - 01-11-2012

My code now looks like:
Code:
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?





RE: Monster Path Help - Statyk - 01-11-2012

(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.


RE: Monster Path Help - eagledude4 - 01-11-2012

(01-11-2012, 10:19 PM)Statyk Wrote: the "asChild" refers to the area given.

Doesn't my code have the same effect though?





RE: Monster Path Help - Statyk - 01-11-2012

(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...


RE: Monster Path Help - eagledude4 - 01-11-2012

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.

Code:
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, "");
}






RE: Monster Path Help - Statyk - 01-11-2012

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...


RE: Monster Path Help - eagledude4 - 01-11-2012

(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.




RE: Monster Path Help - Statyk - 01-11-2012

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.