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
problem with enemies not backing off
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#1
problem with enemies not backing off

If a player enters a room (or in this case, a wardrobe) with an unbreakable door, the enemy just keeps hacking away at the door, and won't leave the player alone! the player's just stuck there. I need to make the enemy back off without disappearing. any ideas? I was thinking of maybe using this, but the wiki doesn't give much of an explanation of what it does:
SetEnemyDisabled(string& asName, bool abDisabled);
would this help?
or is there a better way? Because I have pathnodes set up so the monster will walk past the wardrobe and wait for the player to come out if the player's impatient, but if he sees the player enter the wardrobe, the player's totally f***ed.
07-20-2011, 05:35 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: problem with enemies not backing off

At the proper time, you could do one of these two things:

1. SetEntityActive("MonsterName", false);

2. SetEnemyDisableTriggers("MonsterName", true);

Then he should back off or something.

07-20-2011, 05:37 PM
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#3
RE: problem with enemies not backing off

(07-20-2011, 05:37 PM)Kyle Wrote: At the proper time, you could do one of these two things:

1. SetEntityActive("MonsterName", false);

2. SetEnemyDisableTriggers("MonsterName", true);

Then he should back off or something.

but that gets rid of him completely. and the second one just makes him stand there. is there a way i can tell him to follow his pathnodes and stop chasing the player? I had used
ShowEnemyPlayerPosition("monster1");
to make the monster chase the player but once the player's in the wardrobe i'd like for the monster to follow his pathnodes, or just leave the player alone without going away. it would be easy to do if ShowEnemyPlayerPosition was a boolean
(This post was last modified: 07-20-2011, 05:47 PM by convolution223.)
07-20-2011, 05:46 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: problem with enemies not backing off

Simply have the monster get new path nodes when the monster is disabled triggers.

07-20-2011, 06:00 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#5
RE: problem with enemies not backing off

Have a script in front of the closet that has a collide callback set to that enemy- when the monster triggers it, use a timer (set to how long you want the player to cower before the monster gets bored and leaves). The function the timer sets off should do this: set the first monster to inactive, and simultaneously set another monster (initially inactive and standing right in front of the closet) to active. Then give that monster whatever path nodes you like. The player, being trapped, will not realize that the first monster disappeared and then the second one appeared, it will seem like the monster stopped going crazy all over the closets grill. Bonus points if you can play some monster sounds to cover up the swaperoo.

I would post specific scripts for you to use, but I'm at work and posting this on my phone. Good luck! Smile

[Image: signature-2.png]
(This post was last modified: 07-20-2011, 06:49 PM by Streetboat.)
07-20-2011, 06:47 PM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#6
RE: problem with enemies not backing off

(07-20-2011, 06:47 PM)Streetboat Wrote: Have a script in front of the closet that has a collide callback set to that enemy- when the monster triggers it, use a timer (set to how long you want the player to cower before the monster gets bored and leaves). The function the timer sets off should do this: set the first monster to inactive, and simultaneously set another monster (initially inactive and standing right in front of the closet) to active. Then give that monster whatever path nodes you like. The player, being trapped, will not realize that the first monster disappeared and then the second one appeared, it will seem like the monster stopped going crazy all over the closets grill. Bonus points if you can play some monster sounds to cover up the swaperoo.

I would post specific scripts for you to use, but I'm at work and posting this on my phone. Good luck! Smile
That gave me a idea, have the monster have its attack disabled and stuff. Have it go away around a corner, then when you enter the area, it will go back and attack you! Wink

People would go crazy thinking the monster has become smart.

07-21-2011, 03:34 AM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#7
RE: problem with enemies not backing off

Good point. It's totally possible to practically break the script engine to make the enemies appear smart. Lots of work, but sounds worth it! Someone get on that! Smile

[Image: signature-2.png]
07-21-2011, 03:53 AM
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#8
RE: problem with enemies not backing off

Smile I like the way you guys think. I'm going to try fixing the problem with this. Thanks!
07-21-2011, 04:59 AM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#9
RE: problem with enemies not backing off

Teleport the monster in the closet. The player will freak out Big Grin
07-21-2011, 09:58 AM
Find
convolution223 Offline
Member

Posts: 78
Threads: 15
Joined: Jul 2011
Reputation: 0
#10
RE: problem with enemies not backing off

(07-21-2011, 09:58 AM)MrCookieh Wrote: Teleport the monster in the closet. The player will freak out Big Grin

I really badly want to but I saw a video of someone's level and they already did that. Well the monster was waiting for them when they went to go hide... hmm if i turned off the enemy triggers i could probably make it so it appears right next to them in the closet... is that too similar to what was in the video i mentioned (i can't seem to find it to give a link), cuz i don't want to piss anyone off?

that's an awesome idea though
07-21-2011, 07:51 PM
Find




Users browsing this thread: 1 Guest(s)