Jump to content

Swapping Static meshes in game


Recommended Posts

Ok... so I am vexed. What I have is a museum with displays galore. You bring a unique relic to the museum and find the display for it, click on the display, it moves the item to a hidden chest somewhere and enables a static reference of that weapon model. Alternately a sorter activator can go through the lists and take every displayable item from you and enable the displays. The mesh the display itself uses is a custom, de-havoked version of the item model. The reason for this is because Skyrim's engine sucks at actually obeying the havok management script, and 'don't havok settle' is about useless when you have over 240 items suspended in mid air that otherwise would have havok built into the NIF, and setting up a model as a static form doesn't actually mitigate havok. So I made true static meshes instead.

 

Issue is that I am trying to set up an MCM menu to manage WHAT appearance you want your unique weapons to have. So if you use Unique Uniques, Unique shapes for unique weapons, or any other model alteration mod, they all fight with one another unless you make a patch in xEdit yourself. So this MCM menu would change the models out on the items depending on which check box you choose (giving the option for the mods you have installed). No problem, this will work and I can implement it. The problem is that SKSE does not have a change mesh option for static objects as far as I can tell, so I cannot change the models for the display items. The object reference is very heavily linked into the display system and several scripts so there is no way to simply plop in a new reference, or pre-place it and condition it to enable instead and then remove the others, so I am left trying to figure out if there is some way to swap the model of a static reference somehow.

 

Any ideas?

Link to comment
Share on other sites

Ok... so I am vexed. What I have is a museum with displays galore. You bring a unique relic to the museum and find the display for it, click on the display, it moves the item to a hidden chest somewhere and enables a static reference of that weapon model. Alternately a sorter activator can go through the lists and take every displayable item from you and enable the displays. The mesh the display itself uses is a custom, de-havoked version of the item model. The reason for this is because Skyrim's engine sucks at actually obeying the havok management script, and 'don't havok settle' is about useless when you have over 240 items suspended in mid air that otherwise would have havok built into the NIF, and setting up a model as a static form doesn't actually mitigate havok. So I made true static meshes instead.

 

Issue is that I am trying to set up an MCM menu to manage WHAT appearance you want your unique weapons to have. So if you use Unique Uniques, Unique shapes for unique weapons, or any other model alteration mod, they all fight with one another unless you make a patch in xEdit yourself. So this MCM menu would change the models out on the items depending on which check box you choose (giving the option for the mods you have installed). No problem, this will work and I can implement it. The problem is that SKSE does not have a change mesh option for static objects as far as I can tell, so I cannot change the models for the display items. The object reference is very heavily linked into the display system and several scripts so there is no way to simply plop in a new reference, or pre-place it and condition it to enable instead and then remove the others, so I am left trying to figure out if there is some way to swap the model of a static reference somehow.

 

Any ideas?

Equipping overhaul overcomes this, I think, in some manner. Have you checked out that mod for an example? You might have to get a .pas or skyproccer to add the statics, then use it from there?

 

EDIT: thinking out loud here...

Edited by MotoSxorpio
Link to comment
Share on other sites

I'm not familiar in the least with using the extensions that the proccer uses, and I assume this would mean having to setup a patch ahead of time rather than in game? like I said I have no clue lol

yeah, pretty much have users run a patcher so you can have a formid list or whatnot for your scripts.

Link to comment
Share on other sites

oh I actually use a GetFormFromFile() method for determining which model modification mods they have loaded and since the actual items are vanilla based, the form list isn't really a concern, it's really just about the functions involved in figuring out how to actually change out the static mesh, not about changing the weapon or armor itself, that part I can handle aside from the static

Link to comment
Share on other sites

I don't think there is a native way with papyrus or skse to do what your after.

Apart from writing your SKSE plugin to do the job and that I really wouldn't know where to start, well the plugin yes I know how to start, but the calls involved to accomplish it, no idea.

 

Ways around havoc, but not foolproof though are drop the item from the inventory, and after the 3D is loaded SetMotionType(4) (Motion_Keyframed) and TranslateTo or MoveToNode where you want the item.

Makes it so the item will sit solid and wont budge when knocked or bumped.

 

I did similar, but I created a node tree in nifscope. which had aaround 200 nodes (nothing else but nodes, no shaders or collision or any other crap).

Then in my script i had an array of node strings that matched and array of base items (thanks to skse and greater then 128 array size).

basically get the base ID of the Item I'm about to drop, do a find on the form array, if >-1 , drop the item set motion type, move to node using the find return from the form array on the node array of strings.

Worked pretty well.

The slowest part is waiting for the 3D to load of the item before setting motiontype.

Link to comment
Share on other sites

There's a function for Armors and Weapons, which means it PROBABLY won't work on ObjRefs but you should definitely try.

 

http://www.creationkit.com/SetModelPath_-_Armor

http://www.creationkit.com/SetModelPath_-_Weapon

 

Also, this probably won't work but it might have a function you're looking for, somewhere:

 

http://www.nexusmods.com/skyrim/mods/37481/?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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