Frictional Games Forum (read-only)

Full Version: Help with scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
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");
...
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.
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.
(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);
Pages: 1 2