Frictional Games Forum (read-only)
[CHAOS] Monster Path - 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: [CHAOS] Monster Path (/thread-20238.html)



Monster Path - assassinhawk45 - 02-08-2013

I have been trying to set a monster and its path nodes. When I open the map, it just stands there. Another problem that I am having is that when ever I put a monster in, it always looks along the x-axis, even though it has been rotated in the editor.
Any ways here is my script. I have already checked the names of everything.
Code:
////////////////////////////
// Run when starting map
void OnStart()
{
SetEntityCallbackFunc("tinder", "OnPickup");    
SetEntityCallbackFunc("scroll", "OnPickup2");
AddEntityCollideCallback("Player", "trigger", "monster", true, 1);
AddEntityCollideCallback("servant_grunt_1", "disable", "disable", true, 1);
}
void OnPickup(string &in asEntity, string &in type)
{
  SetEntityActive("body", true);
  PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
    AddTimer("", 0.7, "scared");
}
void scared(string &in asTimer)
{
SetEntityActive("body", false);
}
void OnPickup2(string &in asEntity, string &in type)
{
SetEntityActive("fish", true);
PlaySoundAtEntity("", "impact_water_high.snt", "Player", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(15, true);
AddTimer("", 0.4, "look");
}
void look(string &in asTimer)
{
StartPlayerLookAt("fish", 3, 5, "");
}
void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_10", 1, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PosNodeArea_19", 0, "");
}
void disable(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
AutoSave();
}[/code]
If you can spot what I did wrong, I'd appreciate it.


RE: Monster Path - palistov - 02-08-2013

Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.


RE: Monster Path - No Author - 02-08-2013

Try to put path node into the map.
And then the script it with the "AddEnemyPatrolNode" if I'm correct.


RE: Monster Path - PutraenusAlivius - 02-08-2013

(02-08-2013, 06:41 AM)palistov Wrote: Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.
Hi. I also have this problem too. But there is no .nodes file in my maps/ folder. How do i add them?


RE: Monster Path - MulleDK19 - 02-08-2013

Looks like you're using PosNodes instead of PathNodes. PosNodes are for ropes. PathNodes are for the AI.


RE: Monster Path - NaxEla - 02-08-2013

(02-08-2013, 07:17 AM)JustAnotherPlayer Wrote:
(02-08-2013, 06:41 AM)palistov Wrote: Monsters always spawn with a set rotation. Despite efforts, nobody has found a way to make them spawn in a particular rotation successfully. At least not that I've heard of.

As for your monster not following paths, check the folder your map is in, there should be a nodes file in there. servant_grunt_1.pathnodes or something like that. Been a while since I've done anything with that stuff. Make sure all the nodes are there and that they are neighbored to other nodes. I'm pretty sure if your nodes are too far apart they won't be neighbored, so the grunt might not travel between them. Also, be warned: your grunt will stop at each of the nodes you've assigned him. He will pause for a second or so, even though you've set his wait time to 0. If you want him to travel to a certain point, just assign him that one node. The AI will direct him along a path based on where your nodes are, and who their neighbor nodes are.

You can visually see the node network in-game by checking the "entity info" box while a grunt is active.
Hi. I also have this problem too. But there is no .nodes file in my maps/ folder. How do i add them?

The file should be created when the map is run.


RE: Monster Path - No Author - 02-08-2013

(02-08-2013, 07:22 AM)MulleDK19 Wrote: Looks like you're using PosNodes instead of PathNodes. PosNodes are for ropes. PathNodes are for the AI.

There's my answer. Use that and use the script.


RE: Monster Path - assassinhawk45 - 02-08-2013

Wow. I really need to pay more attention to the level editor. Thanks!