Jump to content

Spawnable Navcut, cut that navmesh realtime in game on the fly.


sLoPpYdOtBiGhOlE

Recommended Posts

Ever wondered how to get the Obstacle flag in CK to actually work with:
Activators
Containers

Lights
Movable Statics
Statics

I noticed the flag does not work when you spawn a form that is flagged as Obstacle in the game at runtime.
It's meant to Cut the navmesh where the object sits, but natively does not.

So i did some experimenting and found you can actually get the Obstacle flag to work on forms that you spawn in the game at runtime.
It requires you to set the nif model havok collision layers in the bhkRigidbody node to 49.

After doing this the Obstacle flag in CK works like it's meant to (there are a few other factors as well).
By setting the nif model havok collision layers in the bhkRigidbody node to 49 it will make the collision non collidable to you.
But NPCs will now walk around the object sitting on the navmesh.

In Nifskope 1.1.3 this would be OL_TAIL.
In Nifskope 2.0+ you would add 48 and 49 to the nif.xml in the Skyrim Collison Layer section (natively only lists up to 47 Null).

 

For this to work the collision needs to be:

1. bhkCollisionObject collision type using bhkRigidBody or hkRigidBodyT

The bhk shape can be any type from what I've tested so far eg: Convex, Compressed, but I haven't tested all yet.

Does Not work using bhkSPCollisionObject / bhkSimpleShapePhantom

 

2. Requires minimum height of 64 units (doesn't matter if the height is negative or positive or both).

Width and Length can be any size from what I've tested.

 

Easy way to keep the solid collision while still having the bhkRigidbody node set to 49:

Add a new child NiNode to the BSFadeNode of the nif model.
Copy the existing bhkcollision branch and paste it to the new NiNode (or if the collision doesn't meet the above criteria create one that does).
Don't forget to point the copy/new bhkCollisionBody to the New NiNode and Visa~Versa

Then edit the copy bhkRigidbody that is attached to the New NiNode to 49.

So in other words you'll now have 2 bhkCollision branches.
1 the original untouched collision.
1 on the New NiNode that has the collision layers set to 49.

This keeps the solid collision and also makes it so the Obstacle flag on the form in CK will work.
You can spawn a the form in game and it will navcut the navmesh it sits on.

It was something that really bugged me, not being able to dynamically spawn a Navcut box.
But after working this out I now know it is fully possible to spawn a scalable navcut collision box in game from a base form.
(Fully Scalable if you use a bhkRigidBodyT)

Spawn the cube in the game world with placeatme anywhere where there's navmesh that NPCs walk over and watch them walk around the cube.
Even though the cube can be walked through by you.
Your followers will run around in circles trying to get to you...lol

If you use a mover mod (I use my own iWant/TagAlong, you would probably use jaxonz) that allows you to select objects and scale them..
Then you can see what I mean about dynamically scaling the cube and seeing the navmesh cut being bigger or smaller by the way the NPCs path around it.

 

Here's an example after doing the above in acation: http://www.nexusmods.com/skyrim/mods/74236/?

 

This was something I really could not find any type of tutorial on how to accomplish.
So I thought I'd share my findings.

Now it's time for me to incorperate dynamic spawnable obstacle boxes to my mover/spawner mod...w00t.
Finally my bots will walk around my dynamically placed tables, beds chairs, walls.. etc (without me filling a utility Cell with premade persistent navcut Collision cubes) :smile:

Edited by sLoPpYdOtBiGhOlE
Link to comment
Share on other sites

I'm actually using a box around myself when I'm stationary in towns or in dialogue as an experiment.

 

At least NPCs no longer push me out of there when I'm standing there talking to someone.

(Which annoys the crapper out me when in dialogue and another npc just pushes you half mile up the road...lol)

Edited by sLoPpYdOtBiGhOlE
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

So is it confirmed that "all" statics with the object flag ticked do not work as they should and cut the navmesh? I'm just wondering if there are some that do work and some that don't. Ticking this flag would make things much easier for me and my navmeshing of my worldspace, but if it doesn't work I'll either have to navmesh around the statics or use L_NAVCUT boxes.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...