Jump to content

[LE] How to connect 3 versions of an object over dozens of instances


Recommended Posts

For a mod Iâm working on, I need to have 3 objects in the same place with only one active at one time.

 

However I plan on having dozens of instances of these connected objects and Iâm not sure how Iâd do this without having to manually place and connect every single object.

 

Is there a faster/more efficient way of doing this?

Link to comment
Share on other sites

Both, each âversionâ has a slightly different model and a totally different script attached to it. Theyâll need to reference each other in order to activate the other, then deactivate itself

 

This is easy to do for one instance, but it would be very difficult to scale when Iâll be making at least a dozen of these

 

Essentially, Iâll be replacing vanilla fireplace logs with a new set with three states (unlit, lit, lit_coloured)

Link to comment
Share on other sites

Well here is my take on it

 

First of all i think you should use papyrus states instead of three different scripts

 

and then

 

You can combine the 3 mesh states into the same .nif actually.

I know of 2 ways to achieve this with Nifskope (3 ways if you are ok with using only 2 states)

 

First method do this by putting each sub-mesh up into an animation sequence using a set of NiVisControllers and NiBoolInterpolators

Then you call PlayGamebryoAnimation() from your script when you change the state.

 

Alternative to this if you are not comfortable with the animations you can fake the visibility by using NetImmerse.SetNodeScale() with a value of 0 and 1 on your object. For this you Create 3 new NiNodes, give them the names of your states and make each sub-mesh a child node of one of those three.

Then when you want to change the mesh state you call SetNodeScale(self,"nameOfNodeToHide",0.0) and SetNodeScale(self,"nameOfNodeToUnhide",1.0)

This method requires SKSE

 

The third option is to use the mechanic the game uses for harvestable plants but this only allows for 2states on/off

 

By doing this you end up with a single object that can transform into whatever and you don't need to track multiple ones etc.

Edited by testiger2
Link to comment
Share on other sites

Thanks for the reply, Iâm definitely interested in these methods. Unfortunately Nifscope has been my biggest heel thus far. But if I can figure this out, having one object will be much easier to manage than three.

 

Thanks again for the reply, I really appreciate it!

 

 

Well here is my take on it

Â

First of all i think you should use papyrus states instead of three different scripts

Â

and then

Â

You can combine the 3 mesh states into the same .nif actually.

I know of 2 ways to achieve this with Nifskope (3 ways if you are ok with using only 2 states)

Â

First method do this by putting each sub-mesh up into an animation sequence using a set of NiVisControllers and NiBoolInterpolators

Then you call PlayGamebryoAnimation() from your script when you change the state.

Â

Alternative to this if you are not comfortable with the animations you can fake the visibility by using NetImmerse.SetNodeScale() with a value of 0 and 1 on your object. For this you Create 3 new NiNodes, give them the names of your states and make each sub-mesh a child node of one of those three.

Then when you want to change the mesh state you call SetNodeScale(self,"nameOfNodeToHide",0.0) and SetNodeScale(self,"nameOfNodeToUnhide",1.0)

This method requires SKSE

Â

The third option is to use the mechanic the game uses for harvestable plants but this only allows for 2states on/off

Â

By doing this you end up with a single object that can transform into whatever and you don't need to track multiple ones etc.

Link to comment
Share on other sites

@ testiger2


One question.

"First method do this by putting each sub-mesh up into an animation sequence using a set of NiVisControllers and NiBoolInterpolators

Then you call PlayGamebryoAnimation() from your script when you change the state."


Can this logic or something similar, using NifSkope, to make a change on textures of a mesh (animated texture change), to be more precise on an actor's mesh.


I'm re-texturing an actor's mesh from a 'Modders Resources' to be use as the primary protagonist on a add-on quest of my latest mod.


What i want to do is to make a change of the actor's texture when it enters combat, from passive mode to aggressive mode.

I currently have in mind to use the "NetImmerse.SetNodeTextureSet()", in combination with some visual "Cheating" to cover the disable/enable of the actor, so that the texture change happens in real time.


* I'm still working on the re-texture part, everything else is just still in my head.

If you have any other idea on how to do this, i would happily hear it !.


* Sorry ItsYourPalAldfaasdfa for steping in like this with my issue.


Have a pleasant week.

Link to comment
Share on other sites

@ OP

If you are new to nifskope setting up the animation sequence(s) can be a little tricky but there are a few tutorials out there on how to do it. I don't have any links on hand right now but you should be able to find it by googling some of the Block names like NiControllerManager, NiTransformColloer or some of those. You could also look at the meshes for the magic spells (shockhandeffects.nif for example) that give you an idea on how the nif would be set up.

 

The Netimmerse method is definetly easer, basically copy-paste.

 

 

@maxarturo

You can animate the textures in a .nif to some degree, you could make a tileable texture and then animate the UV coordinates (flame atronach mesh does this for example). If you were to use only 2 frames you could achieve a texture change effect

 

As for NetImmerse.SetNodeTextureSet() - This would also work, but i don't know if this function changes the textures only for that ObjectReference or for all instances of the mesh. I have not used this function before but i know that the Node-Transform-functions only affect the specific ObjectReference so this might also be the case for SetNodeTextureSet(). Could be that you also need to call QueueNiNodeUpdate() for the effect to appear right away.

 

I don't think you need any of those methods though. Since you are using an Actor the mesh is essentially an armor that you can equip. Naked body meshes are also armors to the game they are just flagged as unplayable so you don't have them in the inventory.

 

So what i would do is to create a copy of the Actors armor, then give it the new texture set in the CK and then simply use Actor.EquipItem at any point through papyrus. How you track the combat state change is up to you there are dozens of ways for it. Maybe layer in a magic effect with some shader effects for the transition an thats it.

Link to comment
Share on other sites

The "NetImmerse.SetNodeTextureSet()" affects the object in which the script is living, the drawback with this SKSE function is that the mesh after the texture change, it still retains the texture that's in memory, the mesh needs to disable/enable, or unload/load, or detach/attach, the last only works for interior cells, for exterior cells the mesh needs to completly disapear from the player's view (stop been in range of cell's rendering radius).


I did experiment a lot with this SKSE function around a year ago and i couldn't find a workaround for this issue, but i don't remember if i did try everything, like using the "QueueNiNodeUpdate()" as you suggested.


The actor i'm using is 1 mesh creature (it's a creature), i did try to use this logic of equipping a different version of the same mesh as an armor for a different idea i had a few month ago, but it didn't work.


Are you saying that this can be done !, if so then there is a big chance that i did a big potato back then...


Thanks for your reply.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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