Frictional Games Forum (read-only)
Help with scripting - 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 scripting (/thread-18296.html)

Pages: 1 2


RE: Help with scripting - Robby - 09-14-2012

You try calling "ShowEnemyPlayerPosition" every second by using a timer. That's what I did, but that also causes it to attack every second if it is in front of you. That will never stop the chase.

And without pathnodes, the monster will always create a pathnode at your position. If there's a wall inbetween you and it, it will try to go through it.

If you use pathnodes, it will follow the nearest pathnode to get to you.


RE: Help with scripting - Varrsharighall - 09-14-2012

As you said, it runs to me properly but also it still attacks me (with disabled triggers). How to resolve this? Is it even possible to turn off struggle during that?
Code:
void TimerShowGruntx1Player(string &in asTimer)
{
    ShowEnemyPlayerPosition("grunt_x1");
    AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");
}
...

void OnStart()
{

    ShowEnemyPlayerPosition("grunt_x1");
    AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");
...



RE: Help with scripting - Robby - 09-14-2012

I don't know how to make an enemy follow you without attacking. You might need to do something with the model itself. And I know nothing about that.

And yes, the attack behaviour is normal. You can't change it unless you do something else. And that's outside my experience box.


RE: Help with scripting - Varrsharighall - 09-14-2012

Thank you all!
I modified model (.ent) according to your advice above. I change SightRange, HearVolume and NormalAttackDistance to 0 and HuntPauseMinTime to 998, HuntPauseMaxTime to 999 also. It works. Monster runs to me and doesn't attack. This first part is nearly over.
By adding this:
Spoiler below!

void OnEnter()
{

SetEntityActive("grunt_x1", true);

ShowEnemyPlayerPosition("grunt_x1");
AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");

It will still remain when I re-enter area.


RE: Help with scripting - Robby - 09-14-2012

(09-14-2012, 04:36 PM)Varrsharighall Wrote: Thank you all!
I modified model (.ent) according to your advice above. I change SightRange, HearVolume and NormalAttackDistance to 0 and HuntPauseMinTime to 998, HuntPauseMaxTime to 999 also. It works. Monster runs to me and doesn't attack. This first part is nearly over.
By adding this:
Spoiler below!

void OnEnter()
{

SetEntityActive("grunt_x1", true);

ShowEnemyPlayerPosition("grunt_x1");
AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");

It will still remain when I re-enter area.
You can add to OnLeave() the following function

SetEntityActive("MonsterName", false);