niston Posted December 6, 2021 Share Posted December 6, 2021 I made a small animated NIF with a bunch of NiControllerSequences.It's a rotary type switch, with a bunch of positions. These all work fine in NIFskope. But: - In CK preview window, the animations are listed but do not play when selected - UNLESS also clicking on the "Focus camera" button, then the switch will update.- In game, the animations do not play - UNLESS a disable/enable is done after playing the animation. The switch will be in the correct position after the enable. Anyone know WTF is wrong? Link to comment Share on other sites More sharing options...
niston Posted December 6, 2021 Author Share Posted December 6, 2021 Solved it. Because player needs to be able to activate the switch, it's got collision.But I had the collision on the node that was supposed to rotate. And, apparently, the collision (havok) for a node will override the controller based transform of that same node, or something.After I moved the collision to a different node, it just works . Link to comment Share on other sites More sharing options...
South8028 Posted December 6, 2021 Share Posted December 6, 2021 (edited) discard the link to nif. I would like to see what it is.And what does havok have to do with it? Edited December 6, 2021 by South8028 Link to comment Share on other sites More sharing options...
niston Posted December 6, 2021 Author Share Posted December 6, 2021 It's a old school rotary switch, for use on this (unfinished) control panel: I think if a node has a physics system attached (collisionnode), the physics takes exclusive control of the node motion. Even tho the collision was created as static art in 3ds and does not move in this case.Makes kind of sense, when I think about it now. Only took me 12 hours to figure it out.... But the animation suddenly started working in CK after I cleared the havok flag in the BSX extra data.However, the switch need the collision on it, so it can be activated. Thus I moved the physics system to another node, set the havok flag again and presto - it just works. Link to comment Share on other sites More sharing options...
South8028 Posted December 6, 2021 Share Posted December 6, 2021 It's a old school rotary switch, for use on this (unfinished) control panel: Â I think if a node has a physics system attached (collisionnode), the physics takes exclusive control of the node motion.Makes kind of sense, when I think about it now. Only took me 12 hours to figure it out.... But the animation suddenly started working in CK after I cleared the havok flag in the BSX extra data. But I need the collision on it, so the switch can be activated. Thus I moved it to another node, set the havok flag again and presto - it just works.thanks, yes, I know these panels. But I don't think the collision is to blame. Most likely, the structure of parent links was broken, or the animation did not want to start due to the lack of a sequential chain of parental links and the lack of a common helper. The situation you described usually occurred to me due to the lack of a helper. Sometimes animations without a helper work, and sometimes they don't, and the states change when nif is called, but the sequences do not automatically play. I would make such panels as assemblies of separate panels, and separate switches for bs connect points. They could dock physically together and connect power separately for multiple consumers. Link to comment Share on other sites More sharing options...
niston Posted December 6, 2021 Author Share Posted December 6, 2021 Trust me - It was the collision. I created collision for static object (so it doesn't fall to ground) and I suppose that, because static object doesn't move, it is logical for a thing with this collision to stay exactly where it is. And it appears from my endeavor that neither NiTransformController nor NiMutliTargetTransformController can influence node with bhkNPCollisionObject -containing static physics system- attached. In any case, solution was exactly like I described above: Put collision on a different node. The animations for the switch was created entirely in nifskope. The only thing I used 3ds for was to create the collision for the knob. Oh and I made the symbol decal plane with it. Both of which I then spliced into my NIFs with nifskope again. I have no idea how to use 3dsmax to do animations and I have about as much desire to learn it as you have desire to learn scripting :tongue: The picture above is actually a mockup static object (assembled with -you guessed it- nifskope), which I use to place nodes for the switches, lights etc. And - to draw the decal texture in paint.net (the layer with the symbols etc). I also used it to determine what scale the switches and lights need to be, so I can fit them all onto the console panel. In game, I'm going to use a base plate with just the symbols decal but no other elements on it. I will use PlaceAtNode() to spawn in the switches lights etc OnLoad and I will delete them OnUnload, all from script. This way, the script can address each switch, lamp etc as a distinct object and the panel won't need 27384732894723 animation states to replicate all possible combinations of lights on/off and switch positions selected. Also I do not rely on the game open/close events, I play the animations exclusively from script using PlayGamebryoAnimation(). Oh, and in case you wonder what the panel is for: This and Here and Here. The symbols on the panel make sense now, yes? :D Link to comment Share on other sites More sharing options...
South8028 Posted December 6, 2021 Share Posted December 6, 2021 (edited) Trust me - It was the collision. I created collision for static object (so it doesn't fall to ground) and I suppose that, because static object doesn't move, it is logical for a thing with this collision to stay exactly where it is. And it appears from my endeavor that neither NiTransformController nor NiMutliTargetTransformController can influence node with bhkNPCollisionObject -containing static physics system- attached. In any case, solution was exactly like I described above: Put collision on a different node.àThe animations for the switch was created entirely in nifskope. The only thing I used 3ds for was to create the collision for the knob. Oh and I made the symbol decal plane with it. Both of which I then spliced into my NIF with nifskope again. I have no idea how to use 3dsmax to do animations and I have about as much desire to learn it as you have desire to learn scriptingà:tongue:àThe picture above is actually a mockup static object (assembled with -you guessed it- nifskope), which I use to place nodes for the switches, lights etc. And - to draw the decal texture in paint.net (the layer with the symbols etc). I also used it to determine what scale the switches and lights need to be, so I can fit them all onto the console panel. In game, I'm going to use a base plate with just the symbols decal but no other elements on it. I will use PlaceAtNode() to spawn in the switches lights etc OnLoad and I will delete them OnUnload, all from script. This way, the script can address each switch, lamp etc as a distinct object and the panel won't need 27384732894723 animation states to replicate all possible combinations of lights on/off and switch positions selected. Also I do not rely on the game open/close events, I play the animations exclusively from script using PlayGamebryoAnimation().àOh, and in case you wonder what the panel is for: Thisàand Here and Here. The symbols on the panel make sense now, yes? :DAm I against it? ) No, you are great, and I am very glad that you found a way to do without 3d max. This is interesting, but in this case I do not understand how what works for you and I will not be able to suggest anything. Yes, you are correct about scripts. ) Papyrus looks extremely boring to me. But, Iâm not totally against studying it. Quite the opposite, I really need it so that I can run my own unique sequences and animate furniture. I just don't know where to start. I have not found any tutorials designed for the complete beginner. Not one. All articles were written by people, implying that the person has at least some experience. )About collisions ... Collisions are really different. The game uses separate collisions for objects with physics (moved), animations (keyfraimed) and statics. If the parent mesh / actor has the required collision type, then all other meshes perform animation even if they do not have a collision. If there are separate animated nodes interacting with the player / npc, then they must accordingly also have a keyfraimed collision, and the collision itself must have the "anim static" type. Curiously, animations that I run without sequences, completely static with the "cycle" controller flags, may have a "static" collision type and not have a "qualite type" property selected at all. Edited December 6, 2021 by South8028 Link to comment Share on other sites More sharing options...
RoNin1971 Posted December 6, 2021 Share Posted December 6, 2021 Yeah, I found out the hard way myself that there are different types of collision. Although it did not affect the animation(s), the collision(s) did not move along with the rest of the node(s) in question. It even looks fine with CK (They move!) but in-game I hit a "wall" trying to pass through my doorways. As you can't see the collision with nifskope, it took me a while to figure it out (after looking at it with CK (then I noticed a difference in color red vs purple (if I remember correctly)) However... for my (big) lever I did use a (copied) 'static' (but moveable) collision, which rotates fine along with the rest of the node it is part of (and gets rotated). For the smaller ones I just used a big static 'box', which encompasses the entire switch, including the handle. So, in those cases there is no collision that moves, just one to enable the activation. Link to comment Share on other sites More sharing options...
South8028 Posted December 6, 2021 Share Posted December 6, 2021 (edited) Yeah, I found out the hard way myself that there are different types of collision. Although it did not affect the animation(s), the collision(s) did not move along with the rest of the node(s) in question. It even looks fine with CK (They move!) but in-game I hit a "wall" trying to pass through my doorways.ÃÂ As you can't see the collision with nifskope, it took me a while to figure it out (after looking at it with CK (then I noticed a difference in color red vs purple (if I remember correctly))ÃÂ However... for my (big) lever I did use a (copied) 'static' (but moveable) collision, which rotates fine along with the rest of the node it is part of (and gets rotated). For the smaller ones I just used a big static 'box', which encompasses the entire switch, including the handle. So, in those cases there is no collision that moves, just one to enable the activation.You gave me this idea ... I can send you nifs with collisions not passed through elrich. Then you can view all the properties of these collisions rig in nifskop, and have samples for cloning data in any meshes. This will allow you to create collisions in any version of max, or in blender with custom plugins. You will need to create a low poly mesh for the model / individual meshes you collision. Name this mesh "collision" to avoid confusion. Make it a child of the mesh that this mesh is a collision of. Save the nif, copy all the collision properties to this mesh from my masterfiles. Pass through elrich.In theory, this method can work. Edited December 6, 2021 by South8028 Link to comment Share on other sites More sharing options...
niston Posted December 6, 2021 Author Share Posted December 6, 2021 @South8028 Yeah, this should work. I mean I've actually edited the collision for the knob in nifskope, after exporting it from 3ds and before passing the NIF through Elric. @RoNin1971 A way around the problem of moving the collision is to create a child node on the one that is supposed to move by controller action, and then attach the bhkNPCollisionObject to that. Link to comment Share on other sites More sharing options...
Recommended Posts