Frictional Games Forum (read-only)
Looping? (Still 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: Looping? (Still need help) (/thread-16458.html)

Pages: 1 2 3 4


RE: Looping? - SiderealStop - 06-24-2012

Mm I had no problem with hiding. I'd hide until it was almost all the way around then go find it and it was still there. It was only at the end of the path that it would go away.

Anyway, tested it. So far it doesn't follow any path. I did get into its view and if followed me out around the corner but when I hid and it lost sight of me, it just stood there, not going anywhere. @-@

*edit*
At least it's not crashing! 8D


RE: Looping? - Cruzore - 06-24-2012

No idea then Sad Someone else has to help you, sorry.


RE: Looping? - SiderealStop - 06-24-2012

Thanks so much for your help though! =D I'll keep looking at it-

Anyone else have any idea? =3


RE: Looping? (Still need help) - Cruzore - 06-24-2012

Okay, 1 more idea though: Place as many patrol nodes as you need, and set them active in the script, as you did before. However, use a different grunt:
open the grunt .ent file at the model editor, go to settings>user defined variables.
the 8th one should be activation distance. set it high(there was a way to check how long you need it, but I forgot. Just set it high and experiment) and save as>into the "entities" folder in your custom story folder(make sure it's a different name though, it can be anything). then, place a normal grunt and use import mesh or something, and browse to your new made grunt. That should work. If not, delete all path nodes in the level editor, save the map, delete the path node file in your maps folder, and place new path nodes again.

http://wiki.frictionalgames.com/hpl2/tutorials/script/monsterpathnodes This might help you understand it. You need the area, in this site you can refer it to the PNscriptarea one, at 1 end of the loop and...yeah. Somehow you'll make it.


RE: Looping? (Still need help) - SiderealStop - 06-24-2012

Haha thanks for all the help! I'll take a look at that. Also tried what you said, still not working ;A;


RE: Looping? (Still need help) - Your Computer - 06-25-2012

Eh, it'd much easier if i just referred you to http://www.youtube.com/watch?v=xWPU6frXmUY&list=PLD326789BC99530C8&index=19


RE: Looping? (Still need help) - Damascus - 06-25-2012

Here's the script mentioned earlier that I ususally refer to, with some explanation added. For loops are fairly advanced scripting, though, so it takes some studying.

It repeats the function multiple times, and the second number (9 in my script) should be one more than the number of pathnodes. All your pathnodes should be numbered in order in the route you want your monster to take.

PHP Code:
for (int i 09i++)  //repeats function for values of i from 1 to 9
    
{
        if (
== 9)
        {
            
0;    //when i reaches 9, it resets to 0 instead, restarting the counter
        
}
        
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_"+i0.001f"");  //adds patrol nodes for enemy looping from 1 to 8
    


Your enemy will still deactivate if you hide from it, though, even if it hasn't finished its loop.


RE: Looping? (Still need help) - SiderealStop - 06-25-2012

Oh cool o3o Trying that out. Though...I have 13 path nodes, would I replace 9 with 14?

*edit*
And thanks Your Computer ^^ I'll take a look at that! =3

*edit 2*
I tried the script, replaced the 9 with 14 and it works - at least doesn't crash - but I want the player to be able to hide on the opposite side of the room and the grunt still patrols. Do you know any way to make it so it doesn't deactivate if you hide from it? =3

Would changing the 'activation distance' in the model editor help with that or is that only for when it first starts patrolling/first gets activated?


RE: Looping? (Still need help) - Damascus - 06-25-2012

Unfortunately I haven't found any way to keep the grunt from disappearing. :/ Seems to be hard wired into the game.


RE: Looping? (Still need help) - Cruzore - 06-25-2012

changing the activation distance to a higher number should prevent the grunt from dissapearing, but I am not sure about that.