Silgrad Tower from the Ashes

Full Version: Making Custom Speedtree Collision for Trees & Shrubs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a short guide on how to make custom collision for speedtree trees and shrubs for Oblivion. I have copy and pasted this reply of mine from this thread (with slight edits):

Speedtree texture and collision tips
.............................................................................................................

How to Add Custom Collision to Speedtree Trees, Shrubs, Etc -

About a week ago, I figured out how to add custom collision to speedtree objects that don't even usually have them - like the shrubs. I figured this out for Craftybits team at The Wormhole, so they can eventually make harvestable shrubs and get custom ingredients from them, to further their crafting mod.

I'm pretty sure my method will work for custom trees, too, and any custom collision shapes they may need.

The thing that will probably have one slamming their head on their desk in disbelief, is that the method to give these trees and shrubs is SOOOO simple and easy - and that you don't even need speedtree to implement it at all.

Basically, go to "meshes\trees\..." folder in Oblivion , and you'll see the collision nifs that certain trees use. The thing is, a lot of trees are somehow hardcoded, to use the existing collision nif of a tree already in that "meshes\trees..." folder. HOWEVER, I found that if you take, say, the existing "treecottonwoodsu.nif", and save a new copy in same folder that has been renamed to "shrubinkberrysu.nif" - all of a sudden, the shrubinkberrysu.spt has collision in the game, where previously it did not. You basically need to make a copy of an existing collision nif, then rename it to exactly what the .spt file name is for the same shrub/tree you're trying to add collision to, and keep that newly named nif in same folder as the vanilla tree collision nifs.

You can even change the shape of the collision and collision layer: I've deleted everything below the bhkRigidBody of the treecottonwoodsu.nif, and added a bhkSphereShape for some shrubs. BUt I then thought that I couldn't walk through the shrubs this way when in the game. So I kept the bhkSPhereShape, and changed the bhkRigidBody's "Layer" and "Layer Copy" fields to OL_NonCollidable like the harvestable flora in the game uses, and I then could walk through the shrubs like normal.

I have not yet tested the collisioned shrubs in the game, nor tried to interact with them. But in the CS render window, when I pressed F4 to turn collision geometry on, the shrubs had the sphere shaped collision on them all of a sudden - so I'm thinking it also works in the game.

Koniption

EDIT:

I just now found this in the wiki:
http://cs.elderscrolls.com/constwiki/index.php/Tree

EDIT#2: Found the date on the above link. Nevermind, seems I was a little late to the party! lol
Cheers, KP. That should be worth bearing in mind for future developments. =)