Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with scripting
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#11
RE: Help with scripting

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.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-14-2012, 12:56 PM
Website Find
Varrsharighall Offline
Junior Member

Posts: 6
Threads: 1
Joined: Sep 2012
Reputation: 0
#12
RE: Help with scripting

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?
void TimerShowGruntx1Player(string &in asTimer)
{
    ShowEnemyPlayerPosition("grunt_x1");
    AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");
}
...

void OnStart()
{

    ShowEnemyPlayerPosition("grunt_x1");
    AddTimer("ShowGruntx1Player", 15, "TimerShowGruntx1Player");
...
(This post was last modified: 09-14-2012, 03:14 PM by Varrsharighall.)
09-14-2012, 03:13 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#13
RE: Help with scripting

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.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-14-2012, 03:18 PM
Website Find
Varrsharighall Offline
Junior Member

Posts: 6
Threads: 1
Joined: Sep 2012
Reputation: 0
#14
RE: Help with scripting

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
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#15
RE: Help with scripting

(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);

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-14-2012, 04:51 PM
Website Find




Users browsing this thread: 1 Guest(s)