Adding Havok to Static Objects

Post » Sat Jan 29, 2011 9:41 am

I would like to take some of Oblivon's static objects (like candles on a plate) and add them to a vendor. I found a http://www.lkmac.com/xiamara/HavokCopyTut_p1.htm and flipped the flags to 14 like he suggests, but I still can't interact with the object in game. It's still static. I think that I need to change the bhkCollisionObject, but even doing that didn't make it dynamic. Basically I copied the bhkCollisionObject branch from another mod in which a similar object was moveable. Clearing I'm not changing everything I need to.

Can someone tell me what flags or settings I need to modify to add havok to a static object, like candles on a plate?
User avatar
Abel Vazquez
 
Posts: 3334
Joined: Tue Aug 14, 2007 12:25 am

Post » Sat Jan 29, 2011 12:52 pm

I would like to take some of Oblivon's static objects (like candles on a plate) and add them to a vendor. I found a http://www.lkmac.com/xiamara/HavokCopyTut_p1.htm and flipped the flags to 14 like he suggests, but I still can't interact with the object in game. It's still static. I think that I need to change the bhkCollisionObject, but even doing that didn't make it dynamic. Basically I copied the bhkCollisionObject branch from another mod in which a similar object was moveable. Clearing I'm not changing everything I need to.

Can someone tell me what flags or settings I need to modify to add havok to a static object, like candles on a plate?


If you're using a vanilla Oblivion havoked nif to make a static nif moveable, it's much cleaner and easier to just copy and paste only the mesh parts from the static nif, to the havoked Oblivion nif, then delete the original havoked nif's mesh parts (or you can delete the original havoked nif's mesh parts first, then copy/paste the static nif's mesh parts afterwards - logistically, this is a better to do it).

From what you wrote, it seems instead of doing what I mentioned above, you tried to copy/paste the collision data instead of the mesh parts, from the havoked to the static nif. But the way you did it causes slightly more work than necessary because of this:

The collision data is not the only thing you need, nor are just setting the Flag value to 14 in all NiNodes and NiTriStrips/NiTriShapes gonna help. The havoked nif's NiStringExtraData is necessary in havoked objects. Also, the BSX flag value needs to have a value of 27 for nifs that are havoked, animated in some way, and have flamenodes (most candle nifs need this) ; 19 for non-animated havoked objects that have Flamenodes, and a value of 3 for havoked objects that do not have Flamenodes nor animation . If you click on the flag icon on the BSX data block, a window should pop up that has checkable boxes you can click on to make the nif be able to do certain things it otherwise wouldn't. A flag value of 3 is gotten by checking the "Enable Havok", and the "Enable Collision" boxes - one enables any sort of collision to be used in the game (even statics need this), and the other enables havok or the ability of the nif to be moveable and grabbable (if the correct settings in the bhkrigidbody are used, already). The descriptions of the BSX checkboxes in the pop-up window, are pretty self-explanatory if you know about the different things that Oblivion nifs can do.

So by just copy/pasting the static mesh parts to the havoked nif, you save yourself some headaches, since the reverse process involves having to also copy/paste the NiStringExtraData, setting the NiNode 0 to a flag of 14, and having to set your BSX flag to 3 manually (if it is a plain havoked nif, and doesn't have flamenodes or animations/etc), besides having to copy/paste the collision block data (bhkCollisionObject and everything attached to it). Also, the bhkCollisionObject, needs a "two-way" hook up to the NiNode 0. The NiNode 0 needs to specify the Nifskope block # of the bhkCollisionObject, in the NiNode 0's "Block Details" of Nifksope. And the bhkCollisionObject, needs to have the block # of the NiNode it is directly under, to the right of the "Target" field in "Block Details". So if you only hook it up from one end, it won't work right in the game.

Misc Important Info:
Lastly, if the havoked candle is going to have a flamenode, there will be a slight problem if the player can buy them and carry them around with grab key. The farther the player travels from the point where they picked up the light, two things will happen: 1) first the candle will stop casting light on surrounding objects, 2) then the candle will start visibly fading until it disappears totally. The casting of light and fading can be fixed, if the player puts the candle in inventory and then drops the candle from inventory again to "reset" the candle. It will then cast light and be perfectly visible again, that is, until it is carried by the grab key too far again. But the candle will still be perfectly good for players to decorate their houses, since all they'd really want to do, is drop the candle from inventory to place on a table in same cell/room. It'd be too cumbersome for them to "Z' grab the candle to carry it everywhere, anyway. For carryable lights, you'd want to set the candle up for the player to actually equip, like torches are. This way, the candle's light won't fade at all, and it can be visibly carried any distance.

I hope this explanation didn't seem too long to read. But I thought it best you know the "why" of the situation.

Koniption
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am

Post » Sat Jan 29, 2011 2:36 pm

I would like to take some of Oblivon's static objects (like candles on a plate) and add them to a vendor. I found a http://www.lkmac.com/xiamara/HavokCopyTut_p1.htm and flipped the flags to 14 like he suggests, but I still can't interact with the object in game. It's still static. I think that I need to change the bhkCollisionObject, but even doing that didn't make it dynamic. Basically I copied the bhkCollisionObject branch from another mod in which a similar object was moveable. Clearing I'm not changing everything I need to.

Can someone tell me what flags or settings I need to modify to add havok to a static object, like candles on a plate?



Um I don't really know about the method Koniption was describing, but whenever I make clutter out of static objects I just import into Blender (free 3d modelling program) with the nif plug-in Then activate->Scripts window ->mesh->hull.
Then select everything and export to meshes/"MyMod"/clutter as a nif file and you're done =]

Of course you'll need to copy over textures from the unpacked bsa aswell but you can set those up easilly enough using nifskope.

I assumed a small amount of prior knowledge with this explanation and I was going to include a link to a tutorial but I can't find the one I used. Anyway just try searching for blender/oblivion tutorials. Good luck =]
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Fri Jan 28, 2011 11:45 pm

Um I don't really know about the method Koniption was describing, but whenever I make clutter out of static objects I just import into Blender (free 3d modelling program) with the nif plug-in Then activate->Scripts window ->mesh->hull.
Then select everything and export to meshes/"MyMod"/clutter as a nif file and you're done =]

Of course you'll need to copy over textures from the unpacked bsa aswell but you can set those up easilly enough using nifskope.

I assumed a small amount of prior knowledge with this explanation and I was going to include a link to a tutorial but I can't find the one I used. Anyway just try searching for blender/oblivion tutorials. Good luck =]


Yeah, but andalaybay might not have experience with a modeling program at all. Copy/paste from nif to nif still works fine, in a lot of instances.

Koniption
User avatar
Myles
 
Posts: 3341
Joined: Sun Oct 21, 2007 12:52 pm

Post » Sat Jan 29, 2011 11:34 am

Thanks to both of you! Koniption is correct in that I have absolutely zero modelling experience, although thejanitor's suggestion sounds simple enough that I may try it at some point :) Koniption was also correct in that I was trying to do things the hard way, as usual. Mind you copying the collision info looked easier - there's only one node to copy afterall :) But yes, I ran into trouble trying to get things hooked up properly.

Anyway I think I managed to copy the mesh info over. I got some infinite recursive link construct errors, but it looks like I can ignore those according to one of the tutorials in the CS wiki. Now I still have to change the flags to 14, correct? Also, do I have to do that manually? If I click the flag icon and change the collision detection to continue, it sets the flag to 30, I believe it was. Anyway it certainly didn't set it to 14.

Ironically I got the part working where I added the item to my inventory for carrying. It's just that when I dropped it, it wouldn't move.
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Sat Jan 29, 2011 1:37 am

IT WORKED!! :celebration:

Thanks again guys.
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am

Post » Sat Jan 29, 2011 1:07 pm

The collision data is not the only thing you need, nor are just setting the Flag value to 14 in all NiNodes and NiTriStrips/NiTriShapes gonna help. The havoked nif's NiStringExtraData is necessary in havoked objects.

always wondered.... necessary for what exactly?

I don't use them.
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Sat Jan 29, 2011 2:17 pm

always wondered.... necessary for what exactly?

I don't use them.


Good question!

Tbh, I don't know why Oblivion has nifs set to a flag of 14 in the NiNodes and mesh parts. I just mention tweaking the flag to 14, because that is the way Bethesda did it. I change the flags to 14 to play it safe. It *might* be some sort of optimization flag that tells the game to instantly "continue" past this NiNode/NiTriStrip/NiTriShape when it searches the nif data for collision info or other info. I kind of relate this theory of mine to how the "Begin Gamemode" block works in scripting:

If you don't use a "return" function in a "Begin Gamemode" block at certain points, or use "if" statements with conditions set, the game will continually scan through the whole Gamemode block over and over. But the scanning can be cut short and game performance increased by using a "return" block and/or "if" condition block, right below the "Begin Gamemode", if that "if" condition is not met -

Begin Gamemode
if player.GetInWorldSpace Blackmarsh != 1
return
else
"play Blackmarsh music only" (rough idea)
endif
end

So if the player is still in vanilla Oblivion worldspace, the script would stop at "return", and not process anything after that. But in Blackmarsh, the script will go past "return" and do the rest of what the script says.

Likewise, maybe the "continue" flag keeps the engine from doing unnecessary scan work in nifs, so that the nif renders or is otherwise processed faster.

Koniption
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Sat Jan 29, 2011 3:01 pm

The other weird thing is that you have to set those flags by typing in the value. If you just select continue from the drop-down, it will set the flag to 30, not 14.
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm

Post » Sat Jan 29, 2011 12:14 am

Well, I don't know... I have the latest version of Nifskope and selecting "Continue" and then pressing Accept button sets value to 14 properly. There's no any need of typing it in value field on my side.
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Sat Jan 29, 2011 1:09 pm

Likewise, maybe the "continue" flag keeps the engine from doing unnecessary scan work in nifs, so that the nif renders or is otherwise processed faster.

Koniption

Perhaps yes. Dunno about the continue flag though.... I used to always set it to continue. but cut it from my workflow as it didn't seem to do anything for me.

anyway that NiExtraDataNode is stuck in there from the beth exporter script. I know from using the CIV4. that whole UPB sgo keep=1.. its from the export optimization script. SGO stands for scene graph optimization. basically it does a load of stuff like dropping bones not animated in kfs, merging nodes, removing extradata not needed etc. and generally optimizing the exported nif. I don't think it actually does anything for the game, as the optimization has already happened, and that node is just in there because that script was on at export. I don't seen how it is would be useful to the scene graph in game. thats my theory, but I could be wrong!
User avatar
Quick draw II
 
Posts: 3301
Joined: Thu Nov 08, 2007 4:11 pm

Post » Sat Jan 29, 2011 5:20 am

I think it depends on other settings because if I do it right after copying the static mesh in, it will set it to 30, but if I do it after I have manually changed it to 14, it will set it to 14 (I flip it to something else like triangles, click accept, then go back and pick continue, then accept). I've noticed Nifskope can be a little quirky, so it might be a refresh issue or something. I'm also running the latest version.
User avatar
Charlotte X
 
Posts: 3318
Joined: Thu Dec 07, 2006 2:53 am

Post » Sat Jan 29, 2011 3:20 am

I can only add that Blender doesn't generate that NiStringExtraData at all on export and it works fine anyway.
User avatar
Leanne Molloy
 
Posts: 3342
Joined: Sat Sep 02, 2006 1:09 am

Post » Sat Jan 29, 2011 8:46 am

I read somewhere (don't remember where now), that it was used for optimizing meshes. If you do a search, you'll get lots of links to articles that seem to think it's required for havoked objects... Really don't know. Too bad we can't get some documentation from somewhere...
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Post » Sat Jan 29, 2011 2:47 pm

I read somewhere (don't remember where now), that it was used for optimizing meshes.

yeah you just read that 3 posts up. :lol:
I have an script that exports it. and bethesda does as well, i bet its exactly the same one. its the scene graph optimization export script.

If you do a search, you'll get lots of links to articles that seem to think it's required for havoked objects... Really don't know.

Well they are probably wrong. It has nothing at all to do with the havok engine or physics.

Too bad we can't get some documentation from somewhere...

There is plenty of gamebryo information out there about how to use if you are interested. None is beth specific except what you will find on this forum, and random tid bits by the devs if you reaaalllly look hard.
User avatar
Ernesto Salinas
 
Posts: 3399
Joined: Sat Nov 03, 2007 2:19 pm

Post » Sat Jan 29, 2011 6:21 am

yeah you just read that 3 posts up. :lol:


Hahaha! I think I read it somewhere else as well :) Looking up the gamebryo stuff might be a different approach. Might check it out when I can't sleep at night ;)
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm


Return to IV - Oblivion