Frictional Games Forum (read-only)
Need 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: Need help! (/thread-19358.html)

Pages: 1 2


RE: Need help! - Projektamensia - 11-27-2012

And how can I increase that range then?


RE: Need help! - FlawlessHappiness - 11-27-2012

If YC doesn't mention in the video then i would guess either in the .ent or it's not possible.

Though, if you watch the video, YC put's a line inside the .ent file that makes the monster not disappear... Try doing that... Remember this is a custom monster, so it should be in your custom story folder...


RE: Need help! - Projektamensia - 11-27-2012

Nice, I got it working now, thanks for all the help!

Now I just need to fix the loop since I saw it did not worked...
My code is like this:

void OnStart()
{

AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
AddEntityCollideCallback("Enemy_Grunt", "PNScriptArea", "MonsterFunction2", false, 1);
}


void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy_Grunt", true);
AddTimer("", 1, "MonsterFunction2");
}

void MonsterFunction2(string &in asTimer)
{
for (int i = 1; i <40; i++)
{
AddEnemyPatrolNode("Enemy_Grunt", "PathNodeArea_"+i, 0, "");
}
}




The last pathnode(Pathnode nr. 39) is behind the script box PNScriptArea so he walks through the script box to trigger the loop again but this does not seems to work. Any suggestions? Smile


RE: Need help! - FlawlessHappiness - 11-27-2012

(string &in asTimer) This means it's a timer..

When you make a collide function like AddEntityCollideFunction, it will not work with a timer function.
I would do it like this:


Spoiler below!

void OnStart()
{
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
AddEntityCollideCallback("Enemy_Grunt", "PNScriptArea", "startmonster", false, 1);
}



void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Enemy_Grunt", true);

for (int i = 1; i <40; i++)AddEnemyPatrolNode("Enemy_Grunt", "PathNodeArea_"+i, 0, "");
}



Are you sure you want this:
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);

To be false? This means that if the player leaves the area "monact" the monster will go active again.. Maybe you should set it to true?


RE: Need help! - Projektamensia - 11-27-2012

I have watched it like 20 times now and as I can see it is impossible to fix my problem. Sad


RE: Need help! - FlawlessHappiness - 11-27-2012

Don't lose hope! Smile Just make it another way than the first idea you got.
You can do as FG already did in the sewers.
A brute that is in the way, out of the entrance, and you have to lure it away with sounds, while running for your life.


RE: Need help! - Your Computer - 11-27-2012

If you've seen the video, then you know that constantly adding path nodes to the monster is not required, since the monster is designed to patrol. The question is whether or not you've set up and added the path nodes to the monster in some kind of circular formation (e.g. 1,2,3... 39,38,37... 1). If they are set up in some kind of linear fashion (e.g. 1,2,3... 39,1,2,3... 39) then going from node 39 to node 1 may be an issue for the monster. The monster is designed to take the shortest path to its next destination, even if there are walls or other objects in the way. If it gets stuck, the game may decide there's no way to reach the beginning node (assuming getting stuck is a condition looked for by the game), which may deactivate the monster.


RE: Need help! - Projektamensia - 11-28-2012

Okay guys, I got it!


I got it working now Tongue Thanks for all your help!!!

You can download our latest alpha here
http://www.moddb.com/mods/the-horrors-of-castle-greenborogh/downloads/alpha-version-310


Notice that it is still in the alpha stage and this update you guys helped me with is not in the alpha you can download there. Our custom story is a really good one since we got a couple of persons who made some game plays with/without commentary and uploaded it to youtube and we got over 2 thousand downloads in total.

Again guys, THANK YOU FOR ALL YOUR HELP and please try our custom story out and give us some feedback(it is our last alpha before the beta realese).