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
OnPlayerSpotted???
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
Question  OnPlayerSpotted???

Is there a script for something like
OnPlayerSpotted("Monster", false)
{

}

So when it is not searching anymore something triggers?

Trying is the first step to success.
03-12-2012, 08:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: OnPlayerSpotted???

Nope.

Tutorials: From Noob to Pro
03-12-2012, 08:32 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: OnPlayerSpotted???

If you want to test if the enemy has de-spawned you might be able to do that with a large script area covering your map and a timer which performs a collision test between the enemy and the script area. Testing if the player is seen by the monster isn't going to be possible in the general case, but there may be a hack/solution for your specific scenario if you could elaborate.
(This post was last modified: 03-12-2012, 08:41 PM by Apjjm.)
03-12-2012, 08:40 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: OnPlayerSpotted???

I just want the monster to, when it's not searching, go back to where it came from. Is it possible?
EDIT: and stay there
EDIT: Does it work if i make a pathnode? Then i guess it will return to the pathnode, and then get deactivated. Then when i interact with the door, it will activate again.

Trying is the first step to success.
(This post was last modified: 03-12-2012, 10:12 PM by FlawlessHappiness.)
03-12-2012, 09:47 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#5
RE: OnPlayerSpotted???

The game works that when the Monster isn't chasing you he goes back to the last Path node he walked to. I think

03-12-2012, 10:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: OnPlayerSpotted???

When the monster gives up searching for the player, it returns back to where it started and continues on its path (set by path nodes). The monster will get deactivated if the player is out of the monster's activation distance and if the player isn't staring at it. Reactivating the monster after it's been deactivated depends on whether or not it killed the player (though my memory on this is a bit lacking).

Tutorials: From Noob to Pro
(This post was last modified: 03-12-2012, 10:28 PM by Your Computer.)
03-12-2012, 10:26 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: OnPlayerSpotted???

Nice! I did it Wink Here is my script if anyone wants it!

What happens is that when i touch the door, the monster gets active, and when i walk in the door it gets player position, but only if the monster is in that room.


void OnStart()
{
SetEntityPlayerInteractCallback("door_teacher", "OnInteract", false);
AddEntityCollideCallback("player", "playercollide1", "IfMonsterCollide", true, 1);
}

void IfMonsterCollide(string &in asParent, string &in asChild, int alState)
{
GetEntitiesCollide("monsterteacher1", "monstercollide1");

if(true)
{
ShowEnemyPlayerPosition("monsterteacher1");
}
}

void OnInteract(string &in asEntity)
{
SetEntityActive("monster_teacher1", true);
AddEnemyPatrolNode("monster_teacher1", "PathNodeArea_1", 2, "");
}

Trying is the first step to success.
03-12-2012, 10:40 PM
Find




Users browsing this thread: 3 Guest(s)