Jump to content

Adding havoc to a static object


Recommended Posts

Hi all,

 

I'm trying to make a box that I can move around with Z or FengShui, with the model from clutter/office/MetalBox01.

 

I make a misc item, and set the model to MetalBox01.nif, add it to my player's inventory and drop it.

 

Only to watch it float serenely in the air.

 

There are no settings that I can find in the GECK that makes this item different from for example the lunchbox item, that has havoc and is draggable with Z.

 

If you have any tips on what is going on that would be greatly appreciated!

 

Thanks,

The Nonsense Factory

Link to comment
Share on other sites

Have you tried copying the lunchbox geck entry, and simply replacing the .nif?

Then you would have the attributes of the lunchbox but with the look of the box

Link to comment
Share on other sites

DizzasterJuice explains it here. You would need to enable the havok data of the object to allow it to move.

 

Doing what a1stickleback says would work, but would leave you with an object that has horribly wrong collision and things could get stuck in it. Also, since the collision/havok data is used to determine the activation point, you would have to look deep inside to the middle of the box to be able to use it or anything.

Link to comment
Share on other sites

TheNonsenseFactory - Hello!

 

"There are no settings that I can find in the GECK that makes this item different from for example the lunchbox item, that has havoc and is draggable with Z. "

 

Whether an item is static of moveable is set inside of the model/.nif itself.

 

Most models can be changed between the two relatively easily by using Nifskope, provided you know what you are doing. ;)

 

The actual settings to change are pretty simple, it's making the object then behave realistically that often takes the time.

 

Of course you realise it can't be an item that's added to your inventory AND a container, at least not conventionally. The activate would place it in inventory rather than opening it.

 

If you did need it to be a container you could do that through a bit of clever scripting.

 

Anyway, I made a Havoked Metal box using metalbox01.nif for you. I've tested it but obviously not intensively, I think I've got it working quite nicely.

 

It can be downloaded here:

 

http://www.mediafire.com/?igfhutfsyqwm0yf

 

EDIT: I just noticed I missed out the shadow effect around the handles so here's a version with them restored:

 

http://www.mediafire.com/?u5fl4ll427g8vlv

 

I assumed you where keeping it the default size so I gave it a bit of heft. :)

 

Just place the model in your mod's mesh folder, create a Misc Item as normal & point it to the new model.

 

You'll have a metal box that can be moved about & be picked up.

 

Hope this helps!

 

Prensa

Edited by prensa
Link to comment
Share on other sites

Thank you Gribbleshnibit8 and Prensa!

 

Gribbleshnibit8: that thread explained a lot and I also posted a question there for even more info.

 

Prensa: I am at work now but I will test your box as soon as I get home. Awesome of you to take the time to do this!

 

I would like to learn more about the process, so that I can do it myself. What are the steps to change a non-draggable item into being a draggable item?

 

You say that the setting is pretty simple, and by that I assume that you mean the AllowTransform mentioned in the thread that Gribbleshnibit8 linked?

 

That sounds like it would be not too hard. However, you say that it is difficult to make the item behave realistically, and I really would like to know more about the process.

 

Thank again,

The Nonsense Factory

Link to comment
Share on other sites

The box works exactly as I want! I can do the scripting to handle the actual placement of a real container. Great success! :D

 

I am very curious how you did this. I opened the bhkRigidBody field in nifscope and got an instant headache. Dozens of parameters, half of which are "unknown". My favourite is "Unknown TimeFactor or GravityFactor". I can't even find the AllowTransform mentioned in the other thread. There are a bunch of parameters obviously related to motion, but I have no idea how it all fits together.

 

If you have a link to a good tutorial (hell, even a bad tutorial is better than what I am going through right now), or can do a quick "adding havoc for dummies" that would be excellent.

 

Best regards,

The Nonsense Factory

Link to comment
Share on other sites

TheNonsenseFactory - Hello!

 

"Awesome of you to take the time to do this!"

 

Happy to help! :)

 

"I am very curious how you did this. I opened the bhkRigidBody field in nifscope and got an instant headache. Dozens of parameters, half of which are "unknown"."

 

Nifskope can be intimidating at first. :)

 

It's a great tool once you get to know it though. I've no head for Blender but I've been able to manipulate models & even make new items form vanilla shapes with Nifskope.

 

I certainly never thought I'd be able to make the things I've done when I first started with Nifskope.

 

"I would like to learn more about the process, so that I can do it myself. What are the steps to change a non-draggable item into being a draggable item? "

 

Obviously make a backup of the mesh you are working on first, it's easy to mess up a mesh in Nifskope!

 

1 - Open metalbox01.nif in Nifskope. Note that the Collision box (wireframe) is Red (Static).

 

2 - Go to the left hand "Block List" window & Expand the Blocks by clicking on the arrow next to BSFadeNode.

 

3 - Left click on the BSXFlags Block, the details will be listed below in the "Block Details" window. Change the 2 (the standard setting for statics) next to the Flag to 66 (the standard setting for moveable objects).

 

4 - Expand bhkCollisionObject & locate bhkRigidBody, left click on that to bring up it's details below. In those details find "Layer" & double left click on OL_STATIC, with the pull down change it to OL_Clutter.

 

5 - Find Layer Copy & repeat the above step of changing OL_STATIC to OL_Clutter.

 

6 - Still in the Block Details, move down to Motion System & change MO_SYS_FIXED to MO_SYS_BOX.

 

7 - Move down to Solver Deactivation & change SOLVER_DEACTIVATION_OFF to SOLVER_DEACTIVATION_LOW.

 

8 - Move down to Quality type & change MO_QUAL_Fixed to MO_QUAL_DEBRIS.

 

Note that the Collision box has changed color from Red (Static) to Blue (Havoked).

 

9 - Locate "Mass" & set it to the weight you want, this will affect how heavy the object acts in game. This is more about how you want the object to behave than what it would really weigh. Find other objects simillar to yours to get an idea of what it should be. Testing in game is always the best way to check this is right, you can always tweak it.

 

I used 45 wihich is quite heavy but it gave the box a bit of heft, it did not seem right to me that it should fly about when hit.

 

10 - Still within bhkRigidBody's details, locate "Inertia" & expand it.

 

Inertia controls how the object is weighted, best to use the settings of a simillar object & do some testing in game. I used the settings o f the 5mm ammo box as a guide.

 

You need to set the values of m11, m22 & m33.

 

m11 - 29.9877

m22 - 15.3926

m33 - 35.0038

 

DON'T forget to save the new .nif as Nifskope will not remind you when you go to exit & it is entirely possible to close & lose every change you made. :)

 

That's it! The metal box is now moveable.

 

Now you'll notice that the box I shipped to you is a little different to how the one you end up with after following those instructions.

 

It's often easier to copy the mesh from a static & paste it into an existing moveable item, that's what I did in this case.

 

I used one of my books that was based on bookgeneric04.nif & pasted the box mesh from metalbox01.nif into that.

 

I used the book mesh because it's a moveable clutter item with no extra bits to get in the way.

 

I made a new convex shape collision mesh too.

 

Many of the other settings I changed to match other simillar vanilla items.

 

Generally tweaking to get the box reacting in the way I felt suited it.

 

It depends on what you've converted, sometimes it works perfect just doing those steps & other times it needs tweaking.

 

But it's a decent grounding in the basics of converting for you. :)

 

A great resource for information on Nifskope can be found here:

 

http://cs.elderscrolls.com/index.php/NifSkope_Comprehensive_Guide

 

That's very good with a basic beginners guide plus more detailed information on the myriad of settings.

 

Don't know if you spotted but I posted a second metal box download near the first as I forgot to copy over the handle shadows on the first one I made.

 

Hope this helps!

 

Prensa

Link to comment
Share on other sites

Thank you very much Prensa! I wish I could give you another Kudos :thumbsup:

 

I have a lot of more questions (of course, that's how knowledge works, the more you know the more you realise you don't know) but I will restrict myself to two questions until I have spent some time actually trying this.

 

The first is, did you have to compensate in some way for the book being much smaller than the metal box? Or did the havoc "size" come naturally with the data present in the metalbox branch?

 

And second, you spoke of making your own collision mesh (might be related to question one), is this something that needs to be done, or was it a tweak to maximize realism?

 

Best regards,

The Nonsense Factory

Link to comment
Share on other sites

TheNonsenseFactory - Hello!

 

"The box works exactly as I want! I can do the scripting to handle the actual placement of a real container. Great success! "

 

Glad to hear that! :)

 

"The first is, did you have to compensate in some way for the book being much smaller than the metal box? Or did the havoc "size" come naturally with the data present in the metalbox branch?"

 

Moving the box mesh to the Book .nif as I did (rather than the example method) meant I had to adjust the collision mesh to fit. Otherwise you'd have a metal box with a book shaped collision. :)

 

I also had to up the Mass setting too.

 

The books use a simple box shape collison (a reason why they are handy to move things to) which is simple to work with & fine for simple shaped items.

 

I learned a lot about .nif's from playing with the books (I wanted a few new boks to decorate the new cells I was working on).

 

Rescaling them & matching the collision mesh, reteturing them & adjusting the UV maps. It's the books that really got me into understanding .nif's, though there's so many settings I'm still learning!

 

If you take bookgeneric04.nif & open that up in Nifskope.

 

Let's say you want to make it a fat dictionary instead (not covering retexturing here :) ), right click on the book in the Render window & select - Transform - Scale Vertices, up comes a window with the X,Y & Z scales.

 

Let's make it .5 fatter so change the Z from 1 to 1.5 & click Scale. The book is now fatter but note the collision mesh is the same thin size.

 

That's easy to fix by left clicking on the collision mesh wireframe, it's details will be displayed at the bottom.

 

Look for "Dimensions" & you will see X,Y & Z with numbers after each. These control the size of the collision box.

 

As you've enlarged the Z dimension of the model you need to scale the Z dimension of the collison, double click on the number next to Z which is 2070. You increased the book's Z by half (.5) so it's easy to work out how much bigger to set the collision (.2070 + half of it, .1035 which is .3105).

 

Setting the Z to .3105 & you will see the collision expand to match the book.

 

Note the "Minimum Size" number under XYZ, this is always set to the smallest number of XYZ in this case that's .3105 so set it to that.

 

You can adjust the X & Y exactly the same.

 

You don't always resize by simple amounts like that but it's not a problem you can fiddle with the sizes until they fit.

 

You can even change what the model is made of (how it reacts & the noises it makes on impacts ) by changing the setting of Material just above those XYZ's. The book is set to HAV_MAT_CLOTH but if you change that to HAV_MAT_METAL the book will clang when dropped & display metal impacts when shot.

 

After rescaling an item always go down to the NiTriStripsDataBlock, find "Radius", right click on the number there & select - Mesh - Update Center Radius. That's important otherwise an item that was originally small that you've increased in size will disappear in game when seen from the corner of your view. That's because the Radius is where the game gets the size of the mesh, regardless of the models real size, if it thinks it's small due to an incorrect Radius it will cull it from view.

 

Of course this is not needed if you're simply changing the settings in the original as that step by step in my post above shows.

 

I copy & pasted into another because I've had good results in the past by using an existing moveable .nif.

 

"And second, you spoke of making your own collision mesh (might be related to question one), is this something that needs to be done, or was it a tweak to maximize realism?"

 

Well with the step by step that I posted you are using the existing metal box mesh, just changing it to moveable, so for that there's no need to make a new collision mesh.

 

If you use the copy & paste method then as stated above you need to resize the books smaller collision to fit the metal box.

 

Collision meshes come in various forms, the books use a simple shape (box) there are also capsule shapes & spheres depending on what you need.

 

Those simple collison shapes are the least resource intensive so are a good first choice, their limitation is they may not suit complex shapes.

 

There are also more complex collision meshes that can be very complex & are form fitting.

 

These are more accurate but more resource intensive & need to be created in a 3D model program like Blender.

 

The metal box had the more complex form, not entirely sure why as it's only a box.

 

I wanted a simpler collision shape so that's one of the reason's I did a copy & paste.

 

The collision I used is a sort of in between the simple shapes & complex called Convex Shapes.

 

Nifskope has the ability to make form fitting collision meshes from scratch, open up metalbox01.nif in Nifskope.

 

Left click on the metal box in the render window & select - Havok - Create Convex Shape, a window will open with a value & explaining what that value does. Clicking OK creates a form fitting collision mesh. Changing the number reduces the complexity of the mesh but reducing it's accuracy, you often need to experiment to get the balance correct.

 

I normally make Convex Shapes in one Nifskope instance of the model & copy/paste the result into another as they don't normally get placed properly when created.

 

That's s a bit more advanced, I hope this isn't too confusing or putting you off!

 

Start small, adjusting sizes & pick up bits as you go, that information site I linked to is great to dip into. You don't need to understand everything about .nif's to be able to modify them, best not to try & learn it all at once. :)

 

Prensa

Link to comment
Share on other sites

  • Recently Browsing   0 members

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