Jump to content

Furniture Alignment Correction for NPC´s (No esp)


Recommended Posts

I just wonder how I can distribute the patch... 

 

I did a short test on 3 different fuck machines and the only thing that doesn't work correctly are NPCs with Nio Boots. They are place a bit to high, but in the right angle. I will see what further testing will bring.

 

 

Spoiler

image.jpeg

 

In my tests at least the angel was always right. I don't know if there is something that can be done about the Nioverwrite Boots. But even with this limitation this tiny little script does a good job. 

 

For people who wants to test it: Here is the modified zaz esm' with patch V4 Furniture_Alignment_Helper_V4_ZAZ8+.7z

Edited by Pfiffy
Link to comment
9 hours ago, Pfiffy said:

I just wonder how I can distribute the patch... 

 

I did a short test on 3 different fuck machines and the only thing that doesn't work correctly are NPCs with Nio Boots. They are place a bit to high, but in the right angle. I will see what further testing will bring.

 

 

  Reveal hidden contents

 

In my tests at least the angel was always right. I don't know if there is something that can be done about the Nioverwrite Boots. But even with this limitation this tiny little script does a good job. 

 

For people who wants to test it: Here is the modified zaz esm' with patch V4 Furniture_Alignment_Helper_V4_ZAZ8+.7z

From my actual view this machines all are made really - really bad....in the past I simply had no better skills-lol

Link to comment

And if you have the furnitures integrated well inside of the area, a correct navmesh and nobody in the near disturbing the npc, you get a perfect alignment-okay-I manipulated FNIS a little....but this is only forcing the speed and choosing correct variables inside of the animation-graph for now....the download for that FNIS version if wanted is inside my ZAP-thread.

ANYWAY is that also NOT solving the problem, yet-but it is helping to deny the hasher interruption of the first with the second animation-stage because it is more faster running. Specially if you have scripts inside of the furniture !!!

TESV 2023-02-04 12-10-16-22.jpg

TESV 2023-02-04 12-08-41-23.jpg

Link to comment
On 2/4/2023 at 2:36 AM, Pfiffy said:

the only thing that doesn't work correctly are NPCs with Nio Boots. They are place a bit to high

While there are scripted solutions for this (sexlab for example has something here), I really don't think this should be included as a general purpose script for all furnitures.
Main issue here is the following:

While you can easily detect a character entering a furniture, look for heels and apply an override to correct it, you would also have to remove that override again when the character leaves. And because leaving a furniture doesn't send an Event, you´d have to built in some active monitoring for every NPC in a furniture, which would require a large Quest/Alias overhead working in the background.
While something like that can make sense in something like the zaz helper addon which already has monitoring for its locked NPC´s, It´s just to much to have as a default in Regular Zap.
 

Link to comment
1 hour ago, Pamatronic said:

While there are scripted solutions for this (sexlab for example has something here), I really don't think this should be included as a general purpose script for all furnitures.
Main issue here is the following:

While you can easily detect a character entering a furniture, look for heels and apply an override to correct it, you would also have to remove that override again when the character leaves. And because leaving a furniture doesn't send an Event, you´d have to built in some active monitoring for every NPC in a furniture, which would require a large Quest/Alias overhead working in the background.
While something like that can make sense in something like the zaz helper addon which already has monitoring for its locked NPC´s, It´s just to much to have as a default in Regular Zap.
 

I'm ok with that. I just found one furniture so far where the values might need some tweaking: The imperial strict wall shakels place the NPC's too close to the wall.

Edit: It also looks like the upper part is placed a bit to high in the nif. 

Edited by Pfiffy
Link to comment
40 minutes ago, Pfiffy said:

I'm ok with that. I just found one furniture so far where the values might need some tweaking: The imperial strict wall shakels place the NPC's too close to the wall. 

As soon you quit all the heel´s furniture-service-mods, you can use furnitures of zap by using the asset-script (which should be added to all placed furnitures of a next party-mod) and use a dummy-feet-replacer: in that case your characters unequip their shoes or heels inside of the furniture. Another furniture type is made FOR heels (works perfectly well for the zap´s heels) fine-this pack is offering this heels stuf not only for fun !!). This can be used as is AS LONG YOU DO NOT MANIPULATE THE HEELS-HEIGHTH - mod with some furniture-correction stuff. THIS works also for the vanilla furnitures as well. In skyrim this is easy if used correctly.

This I mentioned long, long time ago. You can also arrange the overall cloth including hairs inside of a furnture as well...for all characters. If set up right, the gamer and npcs automatically do this job all alone without further script-line.

Edited by t.ara
Link to comment
44 minutes ago, t.ara said:

As soon you quit all the heel´s furniture-service-mods, you can use furnitures of zap by using the asset-script (which should be added to all placed furnitures of a next party-mod) and use a dummy-feet-replacer: in that case your characters unequip their shoes or heels inside of the furniture. Another furniture type is made FOR heels (works perfectly well for the zap´s heels) fine-this pack is offering this heels stuf not only for fun !!). This can be used as is AS LONG YOU DO NOT MANIPULATE THE HEELS-HEIGHTH - mod with some furniture-correction stuff. THIS works also for the vanilla furnitures as well. In skyrim this is easy if used correctly.

This I mentioned long, long time ago. You can also arrange the overall cloth including hairs inside of a furnture as well...for all characters. If set up right, the gamer and npcs automatically do this job all alone without further script-line.

For me it is not that much of a problem. I just need the furniture for Slaves and they don't wear any Heels because they don't det them from me. But I don't like the Idea of placing all Furniture twice and then have to choose if I use the one for heels or the one for no heels to get into the right position....

An option like in Sexlab seems more handy to me for both: modders and players. But we don't have it and I'm not asking for it. I just want to get the most out of the things I already have. 

 

Link to comment

best way: shoes off inside of furnitures...! That´s the normal solution.

But don´t panil!...Modern games have a same problem and it is not solvable in a reakistic way-heels simply are HIGHER-and in the real life, some sort of furnitures will also not work in heels without some few changes.

Edited by t.ara
Link to comment
On 2/6/2023 at 10:10 AM, Pamatronic said:

>Have you considered using spinetranslateto instead of translateto as it forces the final position at the end?

Doesn't make much of a difference. Thanks for the suggestion tho.

 

I meant maybe it could replace the `brute-force' method; if you keep interrupting the translate as done in the update then indeed it will not make a difference.

 

Some comments/questions on the script:

I think the first condition (in onactivate) should be an AND not an OR.

 

The Z offset seems to be missing.

Have you tested the rotation of the offset; do you account for the fact that the game Z angle is different from the usual geometric angle; I can't tell  (see https://www.creationkit.com/index.php?title=SetAngle_-_ObjectReference).
You don't address x,y rotation of the furniture (if placed somewhere the ground is not completely level, those might be used as well).
The script below uses what I think it should be but I've not tested and my geometry sucks.
(I've used the rotation order as given in  https://www.creationkit.com/index.php?title=GetAngleZ_-_ObjectReference).

 

Spoiler


Scriptname pFAH extends ObjectReference


;; Furniture settings - get them from the NIF: (can differ per position - not sure how to detect the position used...).
float property ofx = 0.0 auto    
float property ofy = 0.0 auto
float property ofz = 0.0 auto
float property heading = 0.0 auto

Event OnActivate(ObjectReference akActionRef)
     if ((akActionRef as actor).getSitState()!=4) && akActionRef != game.getPlayer()  ; Not trying to get up and not the player (so NPC).
        Utility.Wait( 0.1 )        ; Mini wait so other stuff can happen in between if needed?

        ;; Local offset to global offset: rotate the offset point in 3D following the furniture's rotation:
        ;; First the yaw (z rotation):
        float a = getAngleZ()     ; Get furniture game-Z-angle (geo-Z-angle = 90 - game-Z-angle)
        float c = Math.sin( a )    ; compute cos of geo-Z-angle (i.e. sin of game-Z-angle)
        float s = Math.cos( a )    ; compute sin of geo-Z-angle (i.e. cos of game-Z-angle)
        float gx = ofx * c - ofy * s ;    x' = x cos a - y sin a;
        float gy = ofx * s + ofy * c ;     y' = x sin a + y cos a
        float gz = ofz                 ;    z' = z
        ;; Next the tilt (y rotation):
        a = getAngleY()     ; Get furniture Y-angle (assuming no oddities here... at least CK (getAngleY) does not mention any)
        c = Math.cos( a )        ; compute cos of Y-angle
        s = Math.sin( a )        ; compute sin of Y-angle
        gx =  gx * c + gz * s     ;    x' = x * cos a + z * sin a
        ;gy =  gy                 ;    y' = y
        gz =  gz * c - gx * c    ;     z' = z * cos a - x * sin a
        ;; finally the pitch (X-rotation)
        a = getAngleX()     ; Get furniture X-angle (assuming no oddities here... at least CK (getAngleX) does not mention any)
        c = Math.cos( a )        ; compute cos of X-angle
        s = Math.sin( a )        ; compute sin of X-angle
        ;gx =  gx                 ;    x' = x
        gy =  gy * c - gz * s     ;    y' = y * cos a - z * sin a
        gz =  gy * s + gz * c    ;     z' = y * sin a + z * cos a

        ;; Now translate actionref to this furniture applying global offset:
        akActionRef.SplineTranslateTo( X + gx , Y + gy, Z + gz, getAngleX(), getAngleY(), getAngleZ() + heading, 1.0, 50.0 )
    endif
endEvent

 

 

 

 

Link to comment
20 minutes ago, MTB said:

I meant maybe it could replace the `brute-force' method; if you keep interrupting the translate as done in the update then indeed it will not make a difference.

From what I´ve seen, the faulty fnis translate continues even after scripted translates have already finished. which means if splinetranslate or regular translate finish fast enough, the actor will still be pushed away by the remainder of the fnis translate.

 

23 minutes ago, MTB said:

I think the first condition (in onactivate) should be an AND not an OR.

It wouldn't work for the player if you used an AND.
If the player is activating a furniture while moving, or is ai-controlled, he will suffer from misalignment just as any NPC, so you need that OR.
 

 

26 minutes ago, MTB said:

The Z offset seems to be missing.

Isn't used by the game engine. So even if a furnitures nif would specify a Z offset for its furniture marker, it would be ignored by the game.

 

 

40 minutes ago, MTB said:

Have you tested the rotation of the offset; do you account for the fact that the game Z angle is different from the usual geometric angle

Not sure what you mean by that. Papyrus functions use Degrees for angles. The formular used here is the same as in all my other devices and works just fine.

 

42 minutes ago, MTB said:

You don't address x,y rotation of the furniture

Actors cannot be rotated along their X or Y axis. Which means if the furniture isn't standing upright, the animation will always be misaligned. And thats true for vanilla furnitures as well. So there's no point in trying to account for that.
Which fortunately leaves us only with the Z angle to worry about and makes the whole ordeal a lot easier.

Link to comment
On 2/10/2023 at 6:52 PM, Pamatronic said:

From what I´ve seen, the faulty fnis translate continues even after scripted translates have already finished. which means if splinetranslate or regular translate finish fast enough, the actor will still be pushed away by the remainder of the fnis translate.

 

It wouldn't work for the player if you used an AND.
If the player is activating a furniture while moving, or is ai-controlled, he will suffer from misalignment just as any NPC, so you need that OR.
 

 

Isn't used by the game engine. So even if a furnitures nif would specify a Z offset for its furniture marker, it would be ignored by the game.

 

 

Not sure what you mean by that. Papyrus functions use Degrees for angles. The formular used here is the same as in all my other devices and works just fine.

 

Actors cannot be rotated along their X or Y axis. Which means if the furniture isn't standing upright, the animation will always be misaligned. And thats true for vanilla furnitures as well. So there's no point in trying to account for that.
Which fortunately leaves us only with the Z angle to worry about and makes the whole ordeal a lot easier.

 

Thanks for your extensive answer!  Answers most of my doubts.

Still had a few doubts/thoughts left (but feel free to ignore them ;)).

- wrt AND vs OR:  Ah. I figured your only trying to target NPCs.  But should the condition that they're not trying to get up not also apply to the player (so then the != Player check is not needed at all) ?
> Z offset not used by the game

But couldn't your correction script take it into account; translating on z works fine right and if the furniture specifies it, it likely actually needs it (brought it up as I saw some in the first nif I checked - a ZAZ 8 bondage bed).

>Actors cannot be rotated along their X or Y axis.

Ah was not aware of that (it does work if they're attached to a rotated node eg on horse back)...then the computation is likely not useful . So the angleX and angleY might as well be specified as 0.0 instead of getting them from the device?

 

In my experience, if the z angle of the player is off which occasionally happens, (repeated) translate does not correct it - do you have the same experience and if so a better solution than using setangle? (which takes them out of the device so need to put them back in again...) .

 

Link to comment
  • 2 months later...
On 2/4/2023 at 2:36 AM, Pfiffy said:

I just wonder how I can distribute the patch... 

 

I did a short test on 3 different fuck machines and the only thing that doesn't work correctly are NPCs with Nio Boots. They are place a bit to high, but in the right angle. I will see what further testing will bring.

 

 

  Hide contents

image.jpeg

 

In my tests at least the angel was always right. I don't know if there is something that can be done about the Nioverwrite Boots. But even with this limitation this tiny little script does a good job. 

 

For people who wants to test it: Here is the modified zaz esm' with patch V4 Furniture_Alignment_Helper_V4_ZAZ8+.7z

Hi. I have to install your patch on top of Furniture Alignment Helper or is standalone?

Link to comment
  • 1 month later...
On 2/4/2023 at 1:41 PM, t.ara said:

And if you have the furnitures integrated well inside of the area, a correct navmesh and nobody in the near disturbing the npc, you get a perfect alignment-okay-I manipulated FNIS a little....but this is only forcing the speed and choosing correct variables inside of the animation-graph for now....the download for that FNIS version if wanted is inside my ZAP-thread.

 

Where is that patched FNIS version ? I cannot find it in your ZAP-thread (you mean

 , don't you?). I want to try it out, because I get annoying misalignements in "Slaverun". I am using Pfiffy's latest SE version of your mod (with alignment correction for furnitures).

 

Sorry, I just found out, that I had used the wrong "ZaZ-Animations-Packs for SE". I had downloaded "ZaZ Animation Pack+ CBBE HDT V.8.0+SE2023.7z" because I am using the 3BA body, but Pffify forgot to update this archive, it still contains the old "ZaZAnimationPack.esm" from 2019. Replaced the esm with the one from "ZaZ Animation Pack+ UUNP HDT V.8.0+SE2023.7z", and now alignment works perfectly! Great work from Pamatronic and Pfiffy !!! 

 

 

Edited by nopse0
Link to comment
  • 4 weeks later...
  • 3 months later...
On 2/3/2023 at 6:36 PM, Pfiffy said:

I just wonder how I can distribute the patch... 

 

I did a short test on 3 different fuck machines and the only thing that doesn't work correctly are NPCs with Nio Boots. They are place a bit to high, but in the right angle. I will see what further testing will bring.

 

 

  Reveal hidden contents

image.jpeg

 

In my tests at least the angel was always right. I don't know if there is something that can be done about the Nioverwrite Boots. But even with this limitation this tiny little script does a good job. 

 

For people who wants to test it: Here is the modified zaz esm' with patch V4 Furniture_Alignment_Helper_V4_ZAZ8+.7z

 

 

There's this mod called heel fix that supposed to fix the height when npc entering furniture. I can confirm this mod clears NPC's heel height when they enter bed so they don't float on the bed.

https://www.nexusmods.com/skyrimspecialedition/mods/64442?tab=posts&BH=0

 

 

I wonder if this can be done to the zaz furnitures.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use