Frictional Games Forum (read-only)
Help With a Monster - 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: Help With a Monster (/thread-9883.html)

Pages: 1 2


Help With a Monster - Marche100 - 08-20-2011

Alright, I just started making my own custom story in Amnesia today, so forgive me if this sounds noobish, because it probably is. I'll post up some pictures to help along my explanation.

Picture is in spoilers because it's big.

Spoiler below!
[Image: monsterhelp1.png]

Ok, so here's the situation. In the beginning of my story you go through that hallway, and the door with the monster inside it is locked. Then you head over to the room on the left and grab the lantern over where that 'area' box is. Then the monster spawns once you grab it, it breaks down the door to get out of its room, and it comes running along the line of node paths I set. You hide in the closet to wait while the monster leaves, then.

Everything goes perfectly until after the monster leaves. When the monster is done going around the node path, it just sort of hangs around and does nothing. It doesn't despawn. It usually heads back into the hallway to wait around, but occasionally it'll wait around in the room to the left, as well. I'm not sure why, but I want it to despawn, because otherwise you can't continue on through the story.

Any ideas on why it isn't despawning?


RE: Help With a Monster - Your Computer - 08-20-2011

I think you're going to have make the monster walk away further across the hall. The monster has pretty good range by default, so the game might think it is not far away enough from the player.


RE: Help With a Monster - Elven - 08-20-2011

You could always manually via scripting make it disappear. For example when monster enters area and Player is still in its room, then make it disappear?


RE: Help With a Monster - Marche100 - 08-20-2011

(08-20-2011, 09:56 PM)Your Computer Wrote: I think you're going to have make the monster walk away further across the hall. The monster has pretty good range by default, so the game might think it is not far away enough from the player.

I did this...

Spoiler below!
[Image: monsterhelp2.png]

...so that he runs over to the room on the left and then he turns around and continues back out the door, down the hall, and into the other room so he can despawn, but he refuses to go back down the hall. He still just hangs around the doorway between the room on the left and hallway.

Or do you mean something else by have him walk away further across the hall?

And how would I make the monster disappear via scripting? I tried adding some stuff at the end of the big thing of "add enemy patrol nodes" but it just ends up crashing.


RE: Help With a Monster - Elven - 08-20-2011

I hope you know at least basic scripting. If you do then basically use this way. For example you name your monster as "monster" and you create area where monster must stand in the end as "monsterStand" (script area). Then onStart() you put:

void AddEntityCollideCallback("monster", "monsterStand", "monsterDelete", true, 0);

And then below you put:

void monsterDelete(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("monster", false);
}

This would be easiest method to force it to disappear Smile


RE: Help With a Monster - Marche100 - 08-20-2011

(08-20-2011, 10:39 PM)Elven Wrote: I hope you know at least basic scripting. If you do then basically use this way. For example you name your monster as "monster" and you create area where monster must stand in the end as "monsterStand" (script area). Then onStart() you put:

void AddEntityCollideCallback("monster", "monsterStand", "monsterDelete", true, 0);

And then below you put:

void monsterDelete(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("monster", false);
}

This would be easiest method to force it to disappear Smile

That would delete the monster as soon as he comes near the closet, though, assuming that I put the area near the closet, which would be the most logical place to put it.. I want him to at least stand around a little bit there in case the player would be stupid enough to stand outside the closet so that the monster could maul him.

Is there a way I could do that, or am I wrong in what I said above and it would work out the way I want it to?

I'll try it first, though, just so I give it a shot and see how it works out. I do know how to implement something that basic, thankfully. Tongue

Edit: Ok, I tried your method, and it's good and it works fine, but I'm having a bit of trouble making it go exactly the way I want it to. I'm trying to get it so that even if you flatten yourself against the closet the monster won't disappear and can kill you, but if you go into the closet he'll disappear with 100% certainty. I'm still working on it though, so I'll try to make the area box a bit bigger in the meantime.




RE: Help With a Monster - Elven - 08-20-2011

Just make path nodes longer. When you at PathNode, then at front of closet put longer time how long he will stand there:

AddEnemyPatrolNode("", "FrontOfCloset", 10, "");

notice that bold is time how long he gonna wait at that patrol node. Then after 10 seconds he will go to next node and you can put area there and make him disappear there.


RE: Help With a Monster - Marche100 - 08-20-2011

(08-20-2011, 10:57 PM)Elven Wrote: Just make path nodes longer. When you at PathNode, then at front of closet put longer time how long he will stand there:

AddEnemyPatrolNode("", "FrontOfCloset", 10, "");

notice that bold is time how long he gonna wait at that patrol node. Then after 10 seconds he will go to next node and you can put area there and make him disappear there.

The only problem with that is that the place where the closet is and where the path of nodes end is a dead end, so there are no more nodes to place. Even if I were to put an area somewhere that he would definitely return to (because he just loves randomly hanging around the room) it would just erase him the first time he walked through it, which would stop him from reaching the closet.

I'm still trying out your first method, and that seems to be the best thing so far, but it's not perfect (sometimes it works flawlessly and he enters the erase area, sometimes it doesn't), so if you have anything else, feel free to say so.

By the way, thanks ahead of time for all your help. This could very well help me with every enemy I put into the game, and otherwise I might have had to make this enemy a hallucination, which wouldn't be as fun.




RE: Help With a Monster - Rownbear - 08-20-2011

You could use a timer, so after about 20 seconds he despawn, depends how far away you want him to walk until the timer goes off.

Or you can put like they said a removemonster script box he walks into to disappear. BUT you put the removemonster scriptbox unactive and another script box which enables the removemonster scriptbox further inside the room. So he walks through the removemonster script which is unactive and then through the scriptbox that activates it. when he walks out the hall the removescriptbox will be enabled and he's gone. Hope it didnt get too confusing.


RE: Help With a Monster - Elven - 08-20-2011

You sure you put pathnodes and ordered monster to follow them via scripting?