Aller au contenu

Photo

When does the on blocked event fire?


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

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
When I read the standard on blocked AI script, I can see that the on blocked event is used to handle blocking doors.  I am wondering if the event fires every time a creature is blocked, and if that can be used to have a creature react to other obstacles in the area.  Has anyone ever messed with this?

#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Don't think anyone really knows.

From my understanding, it fires whenever the creature has to stop because something is in their way, creature, door, or whatever. But that is just conjecture.

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Well, I experimented with a script that made a soldier attack a barricade when it blocked the soldier's path and it didn't work. I wasn't very persistent, though, because I have bigger fish to fry right now. If I ever figure something out, I'll post it.

#4
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Matt,

If a creature is wandering around and they bump into an object that is blocking their path, then the creature can react to the blocking object using the GetBlockingDoor() function. From what I have seen of OC, it looks like you can also determine the "object type" to help decide how said creature will react to the given blocking object. However, I have only ever seen it check for creatures and doors. (*) Doors can then be bashed or opened according to intelligence of the creature ... and I guess other blocking creatures may possibly be attacked.

(*) Although the function description implies it will only ever work if the blocking object is a door.

Check out gb_comp_blocked.

Lance.

Modifié par Lance Botelle, 18 août 2011 - 03:10 .


#5
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
I'd imagine it has to be something which is "blocking", it won't do it if it's just baked into the walkmessh or something they can path around, the engine will just path them where they need to go.

Not sure if that means it will ignore walkmesh cutters and placeables which can be bashed.

Be a good thing to test and document.

#6
Dann-J

Dann-J
  • Members
  • 3 161 messages
In my experience, usable placeables that have their collision status set to 'true' don't seem to fire the OnBlocked event at all. Creatures that walk into them simply stop dead in their tracks, and don't seem to be able to walk around them. It may suggest that only a very few blockage types might be supported (probably only creatures and doors).

I've also had trouble getting the entire party to bash the same placeable at once. It seems that once you switch focus to another character, the previously controlled party member stops attacking it. Shift-selecting the entire party certainly allows you to get them all to attack it once, but the non-PC party members still tend to give up. That may suggest that AI doesn't work well against placeables.