convolution223
Member
Posts: 78
Threads: 15
Joined: Jul 2011
Reputation:
0
|
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
convolution223
Member
Posts: 78
Threads: 15
Joined: Jul 2011
Reputation:
0
|
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 |
|
Kyle
Posting Freak
Posts: 911
Threads: 36
Joined: Sep 2010
Reputation:
7
|
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 |
|
Streetboat
Posting Freak
Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation:
56
|
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!
(This post was last modified: 07-20-2011, 06:49 PM by Streetboat.)
|
|
07-20-2011, 06:47 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
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! 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!
People would go crazy thinking the monster has become smart.
|
|
07-21-2011, 03:34 AM |
|
Streetboat
Posting Freak
Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation:
56
|
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!
|
|
07-21-2011, 03:53 AM |
|
convolution223
Member
Posts: 78
Threads: 15
Joined: Jul 2011
Reputation:
0
|
RE: problem with enemies not backing off
I like the way you guys think. I'm going to try fixing the problem with this. Thanks!
|
|
07-21-2011, 04:59 AM |
|
MrCookieh
Member
Posts: 157
Threads: 8
Joined: Jul 2011
Reputation:
0
|
RE: problem with enemies not backing off
Teleport the monster in the closet. The player will freak out
|
|
07-21-2011, 09:58 AM |
|
convolution223
Member
Posts: 78
Threads: 15
Joined: Jul 2011
Reputation:
0
|
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
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 |
|
|