Aller au contenu

Photo

Advice: How to get an NPC to avoid stepping in a Trigger


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Darin

Darin
  • Members
  • 282 messages
 So, trying to script a pit that opens in the floor (Haunted Halls, area 26 "Plungefall")  basic idea: floor is weakened, and first thing entering over 150 lbs. (may have to make sure creature is medium) will cause a collapse in the floor...

using the [ |   ] castle wall with the hole in it for the space; have a walkmesh helper over it to allow it to be walked on, and floor placeables covering it to be the intact floor.  I have two triggers; one for the pit itself and one to see if a Dwarf or a Rogue notices the weakened floor and warns the party.  In any event, once the trigger is set off, floor pieces are destroyed and entering character (and anyone else in the trigger) drops to another part of the area, knocked down, takes damage, yadda yadda yadda...

My question is this:  when either (1) the pit is revealed or (2) someone says "hey, avoid the right hand side of this corridor, it will collapse" how do I prevent NPCs from entering the trigger?  Clearly if you see a huge hole in the floor, you don't step there... but NPC AI is not the brightest in the world.  The other trigger is larger and encompasses the first trigger; but a "move away from" action does not seem like the best solution... (choppy, at best).  So I ask, is there something I can set on the trigger that would say "hey, NPC guy, don't walk here" but will not prevent the space from being walked on (say, by a dumb player).

#2
kamal_

kamal_
  • Members
  • 5 260 messages
Use another trigger, outside the weakened floor trigger, and have that trigger only run for non-pc characters. Force them to walk waypoints around it if they're not in combat.

Modifié par kamal_, 26 juin 2013 - 08:37 .


#3
Darin

Darin
  • Members
  • 282 messages
only issue there is making it bi-directional... and the fact that, if a fight breaks out near it, all of a sudden they all lose their senses and fall in (the later is likely going to happen anyway, but yeah).

#4
kamal_

kamal_
  • Members
  • 5 260 messages

EpicFetus wrote...

only issue there is making it bi-directional... and the fact that, if a fight breaks out near it, all of a sudden they all lose their senses and fall in (the later is likely going to happen anyway, but yeah).

You can make n-directional triggers by detecting which waypoint/ipoint is closest (and inside the trigger) and running a conditional based on which is closest.

Modifié par kamal_, 26 juin 2013 - 11:08 .


#5
Tchos

Tchos
  • Members
  • 5 080 messages
On a related note, this video has a nice method of falling into a pit.  Some good ideas here, even if you don't use the plugin.



#6
kamal_

kamal_
  • Members
  • 5 260 messages

Tchos wrote...

On a related note, this video has a nice method of falling into a pit.  Some good ideas here, even if you don't use the plugin.


Didn't view the whole thing to see if he did exteriors as well, but my dynamic jumping code will dynamically assign falling damage based on the map's terrain (obviously exterior only).

Modifié par kamal_, 26 juin 2013 - 11:12 .


#7
Morbane

Morbane
  • Members
  • 1 883 messages
make the trigger (only need the one) ignore npcs

ergo

if(!GetIsPc()) return;

just the simplest version of course but you are over analysing you problem.

#8
Tchos

Tchos
  • Members
  • 5 080 messages
I think it would also work really well with Ar Pharazon's animated trap placeables (or tiles). There's an opening pit in there.  (But that's more for an intentional trap, not just a weak floor).

Modifié par Tchos, 26 juin 2013 - 11:56 .


#9
Dann-J

Dann-J
  • Members
  • 3 161 messages

kamal_ wrote...

Tchos wrote...

On a related note, this video has a nice method of falling into a pit.  Some good ideas here, even if you don't use the plugin.


Didn't view the whole thing to see if he did exteriors as well, but my dynamic jumping code will dynamically assign falling damage based on the map's terrain (obviously exterior only).


It would be possible to adapt Kamal's jumping code so that NPCs who know the pit is there jump across it, rather than try to go around it.