Jump to content

[WIP] Furniture Interaction Framework - for NPCs and Player


Roggvir

Recommended Posts

Yeah, my plan was to make it optional too.

Currently having some occasional problems with NPCs pathing to those dropped items when they go pick them up after.

I am gonna give it a day, and if i dont fix it in that time, i'll just make it so if picking up the item fails, it will be moved back into their inventory.

Thats a bit disapointing, but i'll get back to it some other day after release or finishing really important things.

 

Link to comment

Progress update...

 

The undressing, unequipping, dropping items, and picking them up is done.

Now i am retesting all interactions to make sure the changes i made over the last two weeks didnt break something.

So far so good, just some minor tweaks are needed for position offsets for interactions i implemented long time ago and didnt keep them up to date.

 

 

And i am experiencing some hilarious moments during this testing.

 

Nazeem seems to be the foremost expert on unexpected funny moments, his best circuss trick so far:

...as soon as he finished whipping someone in pillory, i see him casualy walking over to another poor victim in other pillory, which caught my attention because he shouldn't thirst for another action due to automatcially applied spell excluding him from any random interactions for next 10 minutes.

I immediately thought it must be some bug, but then i see how he picks up something lying on the ground - they were shackles form ZaZ Animation Pack dropped by the victim in that pillory (they drop these things to prevent the effect interfering with their pillory animations).

And as we know Nazeem, he likes shiny stuff, so of course he immediately puts those shackles on!

I bursted into laugh looking as he's walking away, his hands cuffed behind his back :-D

(and it was the vanilla game that made him to pick it up, not me. I guess those shackles have some high enough value to become NPC magnet it seems)

 

Then we have these guards...

The whole Whiterun is crawling with them, so what better place to test random NPC interactions than the marketplace in Whiterun, with all these shopkeepers and shoppers and of course guards.

At the beginning i made it so the NPCs were dropping only body armor and equipped weapon, but then i added also shields, helmets, and gauntlets (it depends on interaction of course, but most are set to make NPC drop all of these).

So, it didnt took long until i had 4 guards having fun with some NPCs in those 4 testing pillories i placed at the marketplace, and the ground was litered with all kinds of equipment - not only from the guards, but also from the victims in pillories.

It was nearly impossible to walk across the marketplace without kicking some things out of the way, and the other NPCs seemed to enjoy doing exactly that, so when any of the guards finished whatever they were doing, they started wandering naked all over the marketplace, searching for their "lost" equipment, and sometimes as sooon as they got to it, some passing-by NPC kicked it away and the guard had to walk again.

Not so funny as Nazeem, but still puts smile on my face.

 

I think this item dropping is so far the best feature of my mod ;-)

Link to comment

LOL! I just had a great fun with Brenuin...

as soon as he finished and wanted to pick up his rags, i grabbed them (not picked up, just grabbed) and started walking around with him following me and everyone around saying "put that down".

It was like a carrot on a stick.


This is getting better and better, now i have some guard walking around in Brenuin's rags, and Brenuin is of course naked - no clue how that happened, wasnt looking :-)

Link to comment

Just a small correction

- those shackles, it wasnt the game that made Nazeem pick them up, it was me after all.

Found (and already fixed) a bug, where a script running alongside the pickup package was already finished for actor1, and thus got reused for actor2, but actor 1 didn't yet re-evaluate his package stack and was still running the pickup package which was now already getting data (what to pickup) meant for actor 2.

So thats also how that guard ended up wearing Brenuin's rags.

 

...still puzzled by the shackles though, because those were dropped by NPC who was still in pillory, and thus couldnt be running the pickup package nor script. So, how did those made it into a pickup list of some other NPC is still mystery to me.

 

 

And a new problem...

If i leave marketplace where NPCs are interacting, enter Bannered Mare, turn around and return to Marketplace, the game crashes when loading the exterior.

But at least it is crashing reliably, repro seems to be 100%, so it shouldn't be hard to narrow down the cause and fix it.

Link to comment

I'm glad you're still working on this, sounds like there is progress as well! Can't wait to see the 1st public release.

 

Good to hear some of you aren't loosing faith.

I am indeed still working on it. Only sometimes, when i get too frustrated by all the obstacles CK and Papyrus throw in my way, i get a short break, but i always come back - until its finished.

 

Regarding the progress, yes, a huge progress i am not afraid to say.

Apart from the new CTD i introduced lately, and some minor cosmetic changes that may need to happen at some point, the mod is almost ready for Beta.

 

Let me recap whats done, whats not, and what may need to be done at some point:

 

DONE:

  • Furniture Library

    Provides a library of supported furniture and interactions available to every furniture registered in this library.

    Allows other mods to register their new furniture and its interactions, making the new furniture and interactions available to all NPCs and player.

     

  • Methods of initiating interactions

     

    - Player dialogue.

    Player talks to NPC to choose available interaction (depending on a furniture the NPC may be in, or depending on types of furniture found nearby).

    Currently player has access to every choice, filtered only by the furniture around or the furniture the NPC is in, but that is for testing only - normally these dialog choices should depend on various additional conditions (relationship, sex, preferences, whatever - all TBD).

     

    - Scripted.

    Using simple global functions, script assigns chosen NPCs into roles and commences the interaction to start. The appropriate "thread" will take care of making the NPCs walk, get in furniture and/or pose, and perform.

    Of course the player can be also selected and assigned a role by the script.

    This is ideal for using in scenes, quests, or for making random stuff happen.

     

  • Several interaction flows

    - Player orders NPC into a furniture, then talks to the NPC to choose and initiate interaction.

    - Player talks to an NPC in furniture (regardless of who put him there), to choose and initiate interaction.

    - Player talks to NPC to choose and initiate interaction, making NPC follow player until player chooses furniture suitable for the desired interaction by trying to sit in it, a script will take over and seates the player in proper pose, then the NPC joins and the interaction starts.

    - Same as the previous, except the roles are reversed, with NPC being the one in control and player made to follow.

    - All of the above, but with NPCs only, without player involvement.

     

  • Accessing NPC's inventory

    When NPC is locked in furniture or pose, player can access its inventory via dialog.

    A Virtual Inventory (i described it in some earlier post) is used, allowing to undress anything including outfit items, and make the NPC to wear anything, regardless of the outfit it has set.

     

  • Automatic Undressing

    Depending on settings provided by every interaction definition and player options, the NPCs will undress anything that is forbidden by the interaction settings and doesnt match exceptions defined in player options.

    Undressed items are dropped on the ground, and picked up and re-equiped after interaction ends (only if that actor is free - not locked in some kind of furniture, or not flagged by a script to prevent it).

    The way how the settings work is not final yet and will have to be redesigned in the future, but for now it is good enough.

     

  • Implemented Interactions

    This is a very short list, so far i implemented mostly just the interactions matching different "interaction flows" i had to implement and test, but implementing additional interactions is very easy now - thats one of the main points of this framework after all, so many more should be added soon enough.

     

    - (ZAP) Spanking on chairs, bar stools, and benches

    - (ZAP) Pillory - fucking, spanking, broom torture, candle torture, spanking, caning

    - (ZAP) Send to furniture - for all ZaZ furniture objects, no interactions yet

     

  • Voices

    I am reusing vanilla sounds (grunts, taunts, pleads, cries, breathing sounds, etc.) to give the interacting actors a voice that is matching they normal in-game voice.

    I think it works quite well, but for those that wont like it and would prefer other sounds, it will be completely optional - it also supports custom voice plugins, so you can put together your favourite sounds and use those if you want.

    The voice category to be used by any given actor is specified (optionally) as part of every animation stage settings in every interaction script, making it quite flexible, as it can be set depending on various conditions (not only interaction type, but also preferences of particular actor, etc., so same interaction can use different voice categories for actors who like it, and different for actors who do not like it, etc.).

 

 

TODO:

  • Automatic Undressing - redesign settings

    Add more flexibility to allow setting undress conditions AND exceptions as specific forms, masks, and keywords.

    Add some optional SexLab support, if possible - if we can use some of its settings here?

     

  • More Interactions

    Add the rest of interactions that can be implemented using animations from ZAP.

    Then add separate optional plugins with interactions using default SexLab animations, and other similar mods, or animation packs.

     

  • Optional SexLab support

    Not sure what this means yet, but i would like to support as many of its features as possible, probably at least use some of its settings so players dont need to set similar settings in both mods if they already use SexLab.

     

  • Voices - add more categories

    So far i did put together only voices fitting a rather violent or non-consensual interactions, and i still need categories for proper consensual sex (soft/hard), some sensual touching, some soft torture (for those candle interactions, etc.), more hardcore torture, and some categories for pre/post-interaction lines, and climax sounds (those will be probably hard to find in vanilla :-D).

     

  • Voices - make some instalator

    Due to the fact that i reuse vanilla game voices (all DLCs included), i can't just simply redistribute a plugin with these sounds included - if not for copyright reasons, then at least because of the size, which alone is currently about 100 MB, and since everyone should already have those sounds anyway, i see it as stupid to waste anyones traffic on downloading them again.

    I expect the sie to get around 60MB after i remove some garbage, but then it will grow again as i add more categories or more sounds into already existing categories (and unfortunately duplicate those files, because there is no other way due to CK limitations).

    So, i need to put together some installation program, or script, that you can run and it will unpack the required sound files from your vanilla BSA and put them where my plugin needs them (again, due to how CK works with voices, i can't just point my new dialog records to already existing files, at least i didn't found a way how to do that - i have to yet see if Tes5Editing the plugin may be able to achieve that, but i dont think so).

     

...not sure i didnt forget something, the list looks rather short considering the amount of time i spend on this mod already. If i remember something, i'll add it later.

I should also probably move this into the first post under "current status of development"...

Link to comment

Something fishy is going on during the undressing process, when they are dropping the equipment.

If i enter Bannered Mare while somebody outside just started dropping items, the game freezes.

I hope i can find some solution, i'd really like to keep the item dropping.

 

 

Progress update...

 

Looks like i fixed that CTD, or at least minimized the chance of it happening.

It seems it was caused by the DropObject() - looks like dropping objects while the cell is unloaded is not a good idea, so i added condition that prevents the NPC from dropping the object in such case, and only unequips it.

 

...and i am SICK OF HULDA!

Everytime you enter Bannered Mare, she says something like "Come on in, we have warm food, warm drinks, warm beds" - i think i must have heard it at least 200 times while testing the fix by constantly entering and exiting the inn.

I am now officially allergic to her voice, and probably will have to make a plugin that removes her ability to speak.

Link to comment

Progress update...

 

"Background simulation" for interaction threads

When player leaves a cell where some interaction is in progress, the thread will switch into a "detached" mode, and keeps progressing the interaction without really doing anything.

The thread still receives OnUpdate events that normally makes it send animation events to actors, etc., but in this state all it does is just incrementing the animation stage index.

This allows these interactions to progress with really minimal use of resources, and when player returns into that cell in time before the interaction ended, it will get switched back into normal mode, animating the actors as expected.

Probably worth noting: It works seamless and smooth, there are no animation transition glitches or anything like that - you enter a cell, and first thing you see is everyone in correct position and correctly animated, no offset problems, no broken poses, etc.

 

Link to comment

Progress update...

 

 

Major cleaning in progress.

 

Made a brand new interior cell for testing, filled with all kinds of furniture and scripts to test everything, and easily tweak actor positions for any kinds of interactions.

Tidying the code a bit and restructuring the plugins into more logical "packages" (proper release will contain probably only two - master ESM and voice plugin, but for now i am using few additional plugins for testing various stuff), bascially i am separating all the optional and test stuff from the main part.

I underestimated it a bit, thinking i'd be done with it by now, but it will probably take one more day, but it needs to be done.

 

I also started using a new compilation pipeline, utilizing GCC for preprocessing scripts.

And i set it up so with one shortcut key i can compile given script as development version full of trace messages and test code, and with another shortcut key i can build a release version stripped of all that garbage, and with additional modifier key i can recompile all scripts in the project.

It is simply beautifull, the only downsides are that Notepad++ is still Notepad and not Visual Studio, and Papyrus is still Papyrus :)

Seriously, if you are doing a lot of scripting, and not using any macro preprocessor, you should really consider an "upgrade".

In retrospect i can't believe how i managed so long without it.

 

I also fixed some bugs, and improved few things, but nothing major worth of mentioning (probably, as i alredy forgot what it was :)

Link to comment

hmmm... i m just want ask if the mod is ready or not? please

ty ^^

 

Hello, the mod is not ready yet.

I am now retesting everything after the big cleanup, and then i am gonna first give it to another modder who's working on something that could use this mod - after he tries it, then depending on his feedback i might decide to make some changes before releasing first alpha, or release it right away.

 

In any case, i think the Alpha should be released in next few days - maybe tomorrow, maybe a bit later, but within few days from now.

Link to comment

Progress update...

 

MCM menu partially done

Now it is possible to release whole threads, or just individual actors via the MCM menu.

Still missing the ability to stop/start the framework and clear/refresh the furniture library,

and i think thats what i will do next.

 

Minor issues with picking up dropped equipment

While in unloaded cell, the NPC sometimes fails to pickup some item, which shouldn't be happening because the items should be moved back into actor's inventory instantly if in unloaded cell.

Looks like a problem with script logic, maybe some race condition - i suspect it happens when the cell gets unloaded while the pickup package just started processing the item, but can't finish.

A minor redesign of this process seems to be in order.

 

 

That seems to be all, after the above is finished, i am gonna jump back to the interactions, to add few more as was the original plan.

Link to comment

I could use some help, seriously - any smart scripters out there, please take a look at this...

 

 

The Equipment Pickup Procedure (current implementation)
A process making NPCs pickup the equipment they physically dropped when starting interactions.

  • Several Pickup quests
    NPC gets assigned into a quest alias called actorAlias on first unused Pickup quest found.
    A Pickup package and referenceAlias script actorScript are attached to the actorAlias.
    Another quest alias called itemAlias is to hold objectReference of the item to pick up, set from the actorScript to be used by Pickup package as the target for its Acquire procedure.
     
  • The Pickup package

      Sequence (Repeat when complete [X])
       |
       |---Procedure: Find
       |      TargetSelector: itemAlias
       |      ObjectList: 'FindObjectList'
       |
       |---Procedure: Acquire (Success Completes Package [X])
       |      Target: 'FindObjectList'
       |
       |---Procedure: Travel (Success Completes Package [X])
              Destination: near self, radius 1000


    Procedure Find takes whatever is in the itemAlias tries to find it in given radius and location, and stores the resulting reference in the 'FindObjectList', or fails if the itemAlias is empty or if it cannot find given item.
    Procedure Acquire uses the 'FindObjectList' to get the item to pick up, if the Find procedure couldn't locate the item and the list is thus empty, Acquire shouldn't be run (at least according to wiki, that is why we do not use itemAlias directly, but pass it through Find).
    If Acquire is run, and succeeded acquiring the item, the package is completed.
    If Acquire wasn't run, the Travel procedure is run instead - not because we need to travel, but we need something to complete the package.
     
  • The actorScript
    This is the referenceAlias script attached to the actorAlias of a Pickup quest.
    When we assign NPC into the actorAlias, we also set this script's item queue (array of dropped items - objectReferences).
    The script's state is switched into a "RUNNING" state, and first item in the item queue is assigned into the itemAlias.
    We RegisterForSingleUpdate(1), and we wait until one of the following happens:

    OnItemAdded event handler is fired when NPC picked up something.
    We check if the objectReference passed into the event handler equals to what we assigned into the itemAlias - if yes, we equip the item (or not, depends..) and call AssignNextItem() to assign next item in queue.

    OnUpdate event is fired.
    We check if the currently assigned item still exists in the world, and if not, we call AssignNextItem() to assign next item in queue.
    In any case, we again RegisterForSingleUpdate(1), to repeat this, as long as this script runs.
    Unfortunately, we must do this, because the item could have been picked up by someone else (player, or another NPC), or it could disappear or got moved out of reach (who knows why, maybe some 3rd party script took it or otherwise interfered) - whatever the case, if anything like that happens just after the Find added the objectReference into its 'FindObjectList' (which i think it does even if the item was already picked up by someone else - i think it finds the item in that person's inventory) or the Acquire procedure is already running, it would get stuck and the package would never complete, because the procedure is too dumb to just fail if it cannot acquire the item (when it doesn't exists anymore, is out of reach, or is in someone else's inventory while AllowStealing for acquire is False - which it is)
     
  • AssignNextItem()
    This function simply takes next item from the item queue and assigns it into the itemAlias. If there aren't any more items in queue, it switches the script state to the default blank state, firing the OnEndState() event handler where the item queue and script aliases get cleared, causing the Pickup package to stop.

 

Now, i dont like this, because it seems too complicated for what it does, so i would like to make it less complicated.

Maybe i misunderstood some things about the package procedures i am using, and so i am doing things thay may not be neccessary.

But most importantly, it is flawed, rarely causing the NPCs to get stuck when they were operating in a detached cell - once player returns, he can sometimes see such NPC to just idling, standing still.

Usually it helps to just bump into such NPC, to "wake him up", then he resumes the pickup process, picks up his sword or whatever, the pickup process finishes and the NPC then goes about his business.

Sometimes it takes a very looooong time until such NPC "wakes up", and even the bumping doesnt help.

I dont know what is causing this, but it must have something to do with the poor design of this pickup process, so i welcome any ideas on how to properly redesign it, to make it 100% reliable.

Link to comment

Oh, my! Would this mod result in characters no longer hovering halfway next to the bed during sex? I have no issue with all the neckseams, stripe shadows or mismatched skin textures, but the wacky animation offsets have irked me from the start! Would love to see a good offset mod come to light!

Link to comment

Oh, my! Would this mod result in characters no longer hovering halfway next to the bed during sex? I have no issue with all the neckseams, stripe shadows or mismatched skin textures, but the wacky animation offsets have irked me from the start! Would love to see a good offset mod come to light!

I didn't tried any bed related animations yet, but since it works perfectly for other furniture like chairs, benches, bar stools, and pillories, i think beds shouldn't be a problem either.

 

...i could use a short break from the "pickup problem" i am working on, so if you give me some example of such bed related animation, i can quickly test how it works with it.

Link to comment

 

Oh, my! Would this mod result in characters no longer hovering halfway next to the bed during sex? I have no issue with all the neckseams, stripe shadows or mismatched skin textures, but the wacky animation offsets have irked me from the start! Would love to see a good offset mod come to light!

I didn't tried any bed related animations yet, but since it works perfectly for other furniture like chairs, benches, bar stools, and pillories, i think beds shouldn't be a problem either.

 

...i could use a short break from the "pickup problem" i am working on, so if you give me some example of such bed related animation, i can quickly test how it works with it.

 

 

Almost every bed-animation messes up, at least on my end. If only the feet stick through the headboard, it's a minor problem on my end. Often, the feet are the only part that are actually on the bed during an animation, while the rest hovers next to the bed, in front of the bed, behind the bed, everywere except on the bed. I often pick "don't use bed" when asked and just have sex on the floor instead, just so I don't have to see those default offsets..

Link to comment

 

 

Oh, my! Would this mod result in characters no longer hovering halfway next to the bed during sex? I have no issue with all the neckseams, stripe shadows or mismatched skin textures, but the wacky animation offsets have irked me from the start! Would love to see a good offset mod come to light!

I didn't tried any bed related animations yet, but since it works perfectly for other furniture like chairs, benches, bar stools, and pillories, i think beds shouldn't be a problem either.

 

...i could use a short break from the "pickup problem" i am working on, so if you give me some example of such bed related animation, i can quickly test how it works with it.

 

Almost every bed-animation messes up, at least on my end. If only the feet stick through the headboard, it's a minor problem on my end. Often, the feet are the only part that are actually on the bed during an animation, while the rest hovers next to the bed, in front of the bed, behind the bed, everywere except on the bed. I often pick "don't use bed" when asked and just have sex on the floor instead, just so I don't have to see those default offsets..

Give me few dozen minutes, i am going to implement some bed interactions right now, to see how those works - i expect no problems, but better check because with Skyrim one never knows :)

 

Link to comment

Done testing the beds, and as i thought - no problems.

 

I tested it with Arrok Doggy Style animation, and both actors stay exactly where i put them (i didnt set the offsets correctly yet, so they were both "inside" the bed, but that proves even more their imunity to collision problems).

So, yep, works.

Link to comment

Done testing the beds, and as i thought - no problems.

 

I tested it with Arrok Doggy Style animation, and both actors stay exactly where i put them (i didnt set the offsets correctly yet, so they were both "inside" the bed, but that proves even more their imunity to collision problems).

So, yep, works.

Good to know, keep up the great work!

 

I noticed some issues with bedrolls myself, namely that participants will hover as if there was a bed beneath them when selecting to use the nearby bed. Do you think your tempering will also fix that?

Link to comment

Too bad most animations do not have all the stages i need:

 

Stage 1

Actor1 gets in position and waits

 

Stage 2

Actor2 joins Actor1, with either both actors playing appropriate anims, or Actor1 still in waiting pose and Actor2 plays the entering/whatever anim

 

Stage 3

Various "action" animations for both actors (those we already have).

 

Stage 4

Actors get up/leave in appropriate logical order.

ie. one actor stays in position playing some idle, while the other is playing get up anim, steps away, and then the first actor also gets up.

Or both may get up together, using appropriate anims, whatever fits the situation.

 

Saddly, most anims comes in sets for the Stage 3 only.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • 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