Jump to content

[WIP] Furniture Interaction Framework - for NPCs and Player


Roggvir

Recommended Posts

Progress update...

 

Prevent other NPCs from using a "busy" furniture: SOLVED

Once an actor enters the furniture, BlockActivation() is called on it, and then BlockActivation(false) when actor gets released.
As far as normal non-scripted functionality goes, it prevents other NPCs from using this furniture.
So far i imagine only two cases where this wont prevent some awkwardness from happening:

  1. In some really really special cases, when there is some script on that furniture, making it possible to still run some code even if the activation is blocked this way.
    But i have yet to stumble upon such case, so it doesn't seem to be of any concern at all.
     
  2. If it is a static furniture, with an idle marker
    For example, for whatever reason, somebody decided to place a static chair and a separate iddle marker, which when used, makes it look like the NPC is sitting on the chair.
    Oviously, since the framework can utilize static furniture too, it could result in some actor sitting on the chair, with some random NPC sitting in his lap because he used the iddle marker.
    No way of preventing that easily, and i think these would be also pretty special cases, so probably not worth to be concerned about.

 

Fading of actors voices when nearby NPC talks: Pending

So far, no ideas whatsoever. Hopefully it is just a bug in my dialogs.

 

Collision problems: Pending

Had a short discussion with ZaZ and he had some interesting ideas i am going to try, and then depending on what i am gonna find, he might be able to provide some solution.

 

Link to comment

Fading of actors voices when nearby NPC talks: Pending

So far, no ideas whatsoever. Hopefully it is just a bug in my dialogs.

 

 

Could try asking mod author of the Crowds mod how they implemented the npc's voices without going over the pc/npc actors voices.  Maybe set a distance check for npc's not involved in the actual event?   Not sure how you would go about doing so.

 

 

And is your collision problem before / during/ ending with the furniture?

Link to comment

About the voice acting...

In case someone would find this approach interesting and maybe wanted to adopt it in their mod.

 

First, i tried using the Say command, but that proved to be too difficult without causing occasional crashes (see the notes section: http://www.creationkit.com/Say_-_ObjectReference).

So, i tried to find other ways and came up with the following idea which works beautifully.

 

I utilize the hardcoded in game system that makes NPCs say things when hurt (those grunts of pain when struck by an arrow, or hit with an axe, magic, etc.).

So, i went through all the original lines of dialogs, including the pain/grunt/breathing sounds and what not, and selected those that could fit may purpose in various situations (consensual/nonconsensual sex, punishment, etc.)

Just so you have an idea of how much work that alone is, there is 43.987 dialog lines in original game (all DLCs included).

Of course i wasn't listening to every single one of those, as most of them could be easily filtered out using various criteria like number of words, or those using any specific character names, etc., but i still had to read maybe at least 10 thousand lines to filter out more 'garbage' i couldn't filter automatically, and then listen to several thousands of sounds to decide which can be really useful.

At the end i had a list of approx 1500 dialog infos that i can use (some of them are for unique actors only, but majority has variants for almost all NPC type there is).

I didn't add any animal or creature sounds, except for dremoras and vampires of course, but i will add any other creature sounds later even though that's not my thing, but who would i be to judge what others may like ;)

 

The next step was to create several dialogs for each situation category, and split the sounds between them.

This is not yet final, and currently i have only the following categories:

  • fucked-consensual-Soft
    ...actor being fucked by another, consensually, softer variant
  • fucked-consensual-Hard
    ...actor being fucked by another, consensually, hard variant
  • fucked-nonconsensual
    ...actor being fucked by another, non-consensually
  • fucking-consensual-soft
    ...actor fucking another, consensually, softer variant
  • fucking-consensual-hard
    ...actor fucking another, consensually, hard variant
  • fucking-nonconsensual
    ...actor fucking another, non-consensually
  • torturing-soft
    ...actor torturing another, softer variant (a light BDSM play maybe)
  • torturing-hard
    ...actor torturing another, hard variant (really really extreme BDSM, or an outright torture)
  • tortured-soft
    ...actor boing tortured by another, softer variant (a light BDSM play maybe)
  • tortured-hard
    ...actor being tortured by another, hard variant (really really extreme BDSM, or an outright torture)
  • touched-liked-first
    ...actor being touched by another, for the first time (during current interaction), liking it
  • touched-liked-seq
    ...actor being touched by another, subsequent touches after the first (during current interaction), liking it
  • touched-disliked-first
    ...actor being touched by another, for the first time (during current interaction), NOT liking it
  • touched-disliked-seq
    ...actor being touched by another, subsequent touches after the first (during current interaction), NOT liking it

Each of the above is a separate quest dialog, with the appropriate infos put in the Combat/Hit topic category.

Yes, thats right, they became the new COMBAT SOUNDS - but only for NPCs being members of one of my special interaction factions (each dialog correspond to one of the factions, so by switching the NPCs between those factions, we can change the type of sounds they make or say).

 

An example of a typical interaction script looks like this:

// t refers to the 'thread' this interaction is being run on

// This will set the first stage of interaction, where actorB starts rubbing pussy of actorA locked in pillory.
// ActorB wont make any sounds, so no setAnimVoice for him, because that category is not yet implemented, but actorA will react with a startled/surprised response to actorB action.
// This startled response is set to happen only once (voice repeat timeout of 999 makes sure of that),
// because it looks awkward when the same person is surprised by the same thing more than once in a row 
t.setAnimation(i, actorA, "ZazAPPillTorPussRub1B", timeout=2)
t.setAnimation(i, actorB, "ZazAPPillTorPussRub1A")
t.setAnimVoice(i, actorA, RoggFctTouchedDislikedFirst, 999) // actorA's startled first-contact response (things like "What the..?", "Oh?! What are you doing?", "Hands to yourself!", "What?! No! Dont do that!", etc.)
// TODO: implement actorB intro voiceover (using things like "what do we have here?" and "Aren't you a sight for sore eyes", etc.)
i += 1

// ActorB continues rubbing pussy of actorA locked in pillory.
// We let him keep doing it for a random number of times, while actorA will switch from surprised first-contact response to another dialog
// making him to keep complaining, begging, threatening, or crying for help towards nearby bystanders.
c = Utility.RandomInt(1, 4)
while (c > 0)
   c -= 1
   t.setAnimation(i, actorA, "ZazAPPillTorPussRub1B", timeout=4)
   t.setAnimation(i, actorB, "ZazAPPillTorPussRub1A")
   t.setAnimVoice(i, actorA, RoggFctTouchedDislikedSeq, 2.0) // actorA's keeps complaining/begigng/crying/sighs/whatnot with min. 2.0 second interval (things like "Stop that!", "You're gonna pay for that!", "Please, no!", "Please, somebody help!", etc.)
   // TODO: actorB voiceover for this situation is not ready yet (probably just some sighs, breathing or other unarticulated sounds because there doesnt seem to be any voiceovers fitting this situation)
   i += 1
endWhile

// ActorB stops rubbing pussy of actorA and starts fucking actorA
t.setAnimation(i, actorA, "ZazAPPillSXHip01B", timeout=3.3) // actorB entering actorA while holding hips (play only once, duration=3.333)
t.setAnimation(i, actorB, "ZazAPPillSXHip01A")
t.setAnimVoice(i, actorA, RoggFctFuckingViolent, 0.3) // actorA lamments, begs, heavy short breaths or grunts, cries, or cries for help
t.setAnimVoice(i, actorB, RoggFctFuckingViolent, 0.3) // actorB grunts, heavy breathing, insults, threats, taunts, laughs, etc.
// TODO: implement slightly gentler voiceover for actorB to be used here
i += 1

...etc.

This is just a short example of how the voice factions are used in a script preparing all interaction stages (which are then played through after this preparation script is done).

Normally the stages are randomized much more, which is not really shown here (type of initial starting animations is normally randomized, or can depend on actor preferences - things like soft/hard sex, types of animations, etc. Also the length and number of each stage is usually randomized, so no interaction is exactly the same, even when player is involved).

 

 

Anyway...

By doing it this way, i can make almost every NPC in game make sounds in his normal in-game voice, which i find very nice especially if you'd like to play through the game while utilizing this or any other sexmod using this approach - although it may sound a bit cartoonish at times, and it definitely wont please everyone, i find it much less immersion breaking, than when you suddenly hear the NPCs making maybe better fitting sounds, but in completely different voices than how they normally talk.

But nothing prevents anyone, from using their own voiceovers that are utilizing completely custom sounds like the ones that comes with sexlab, etc.

Link to comment

Could try asking mod author of the Crowds mod how they implemented the npc's voices without going over the pc/npc actors voices.  Maybe set a distance check for npc's not involved in the actual event?   Not sure how you would go about doing so.

 

And is your collision problem before / during/ ending with the furniture?

 

I'll check out the Crowds mod, what it does and how, thanks for the tip.

So far i noticed there is an option to override audio output for any dialogue info, making it being heard from greater distance and such, so maybe that could help - but i'd like to avoid doing so for all of the 1500 infos i have (not just because it's a bit tedious, but more because i dont know how the game handles these overrides, and i am afraid it could introduce some delays before the sound is played, making it out of sync with some animations), so that would be the last resort option.

 

The collision problem happens at random times during ongoing interaction (ie. while actorB is fucking actorA in pillory, etc.)

Link to comment

 

I dont know if this matters or not or if you know about it or if it even helps :o. But since all the NPC's in Skyrim can lean on a wall or a pillar maybe you can use that as reference on how to make the animations ?.

 

(Personally I dont know what the hell I am writing so that's that lol...)

 

The leaning on a wall/pillar, or leaning over railings that you're talking about, is done automatically via NPC Idle package, which makes use of an "idle marker" - it's completely unrelated to the actual wall/pillar/railing, the NPC will do that as long as the marker is there even if the wall is not.

 

Anyway, i dont have any problems regarding making NPCs play any animations wherever and whenever i want, so i am not sure what you mean... but thanks for trying to help, i do appreciate it.

 

 

While they are idle markers for the purpose of NPC sandboxing they are still furniture, right?  (CounterBarLeanMarker, CounterLeanMarker, etc)  They are furniture with a "Is Marker" tag, are flagged as occupied when used, etc.  Couldn't they still be queried for location, position and whether they are occupied or not?  When scanning for useable furniture what does your script look for?

 

I only pester because I, too, am eager to see this succeed.   :cool:

Link to comment

While they are idle markers for the purpose of NPC sandboxing they are still furniture, right?  (CounterBarLeanMarker, CounterLeanMarker, etc)  They are furniture with a "Is Marker" tag, are flagged as occupied when used, etc.  Couldn't they still be queried for location, position and whether they are occupied or not?  When scanning for useable furniture what does your script look for?

 

I only pester because I, too, am eager to see this succeed.   :cool:

 

Yes, you are right, it should be possible to find them, get location info, and use them - i'll make a note to implement that :)

What i originally wanted, was to make the player choose the position - choose a specific wall, railing, etc., which cannot be done it seems.

 

Link to comment

 

While they are idle markers for the purpose of NPC sandboxing they are still furniture, right?  (CounterBarLeanMarker, CounterLeanMarker, etc)  They are furniture with a "Is Marker" tag, are flagged as occupied when used, etc.  Couldn't they still be queried for location, position and whether they are occupied or not?  When scanning for useable furniture what does your script look for?

 

I only pester because I, too, am eager to see this succeed.   :cool:

 

Yes, you are right, it should be possible to find them, get location info, and use them - i'll make a note to implement that :)

What i originally wanted, was to make the player choose the position - choose a specific wall, railing, etc., which cannot be done it seems.

 

 

 

Call me optimistic, but perhaps it can be.  What if you create a set of your own furniture for this feature?  While it will restrict the locations the players can use this feature, it would allow modders to implement it in their content.

Link to comment

 

 

While they are idle markers for the purpose of NPC sandboxing they are still furniture, right?  (CounterBarLeanMarker, CounterLeanMarker, etc)  They are furniture with a "Is Marker" tag, are flagged as occupied when used, etc.  Couldn't they still be queried for location, position and whether they are occupied or not?  When scanning for useable furniture what does your script look for?

 

I only pester because I, too, am eager to see this succeed.   :cool:

 

Yes, you are right, it should be possible to find them, get location info, and use them - i'll make a note to implement that :)

What i originally wanted, was to make the player choose the position - choose a specific wall, railing, etc., which cannot be done it seems.

 

Call me optimistic, but perhaps it can be.  What if you create a set of your own furniture for this feature?  While it will restrict the locations the players can use this feature, it would allow modders to implement it in their content.

 

I am confused now, maybe we dont understand each other?

Take a wall for example - right now i wasnt even able to detect a wall in the scene - to return a wall as object reference i could work with.

So, how would a custom wall help with that? or did i completely misunderstood?

Link to comment

 

I am confused now, maybe we dont understand each other?

Take a wall for example - right now i wasnt even able to detect a wall in the scene - to return a wall as object reference i could work with.

So, how would a custom wall help with that? or did i completely misunderstood?

 

 

Sorry about that.  I didn't mean a custom wall, I meant custom 'LeanMarkers furniture'.  Invisible furniture you can reference and place anywhere.

Link to comment

 

 

I am confused now, maybe we dont understand each other?

Take a wall for example - right now i wasnt even able to detect a wall in the scene - to return a wall as object reference i could work with.

So, how would a custom wall help with that? or did i completely misunderstood?

 

Sorry about that.  I didn't mean a custom wall, I meant custom 'LeanMarkers furniture'.  Invisible furniture you can reference and place anywhere.

 

Aha, sorry.

Well, i dont think there is any need for creating custom markers, because such markers already exists in CK.

Of course i presume i will be able to detect and use these markers (after all, they are a 'furniture' type object).

I will try soon enough after i deal with other more pressing issues.

 

Link to comment

Progress update...

 

New type of interaction - Follow another actor, when he gets in furniture, join in by starting the interaction.

This was needed for the "spanking on chair/bench" interaction, but is also usable with any other interactions having the same flow.

Player start the process from a dialog with NPC, then the NPC follows him around until the actor sits in a furniture allowing the chosen type of interaction, then the fun starts.

For NPC-to-NPC it works as usual... they both go to the furniture, one sits in, the other one joins after.

 

One problem - regarding the spanking anims - it works perfectly with any chair in the world, but when used on benches, the sitting actor is turned 180 degrees so he's facing the opposite direction than of the normal sitting animation, and thats a problem, especially with benches having a rear guard, or benches with wall behind them.

So, i will need to add some code to ensure the actor is turned in correct direction for specific furniture, which is a bit annyoing, but shouldn't be that hard.

Link to comment

Progress update...

 

Can't find a way to ensure correct actors heading while spanking on bench, i dont know what else to try anymore, it seems that without bench-specific animations there is no way (strange thing is, when i play those animations from console, while sitting on bench, the actor is facing the correct direction, i am completely puzzled by this, must be another of those "funny" tricks that Skyrim pulls on us).

Similar problem with bar stools - the animation doesnt fit and i am unable to fix that.

 

So, these spanking anims will be available for chairs only, sorry.

Link to comment

Progress update... (rather backwards this time, but progress nevertheless)

 

Completely reworked how actors travel to and handle their 'objective', and then reverted everything back.

The old system was ok, but had a small glitch - the infamous NPC moonwalk (that thing when you tell an NPC to go to spot X, but something else is already placed on spot X, and they try to "walk their way in").

I thought maybe i can kill two birds with one stone - this moonwalking, and adding more flexibility by glueing the in-furniture NPC to a marker instead of to the furniture (should allow me to move the marker around, being able to adjust NPC position freely).

Unfortunately, my effort did not end as a complete success (nor as a complete failure, so at least there is that).

 

The old method of making actors walk to a target, was half package, half script.

  1. First the actor was given a simple Travel package
    ...by inheriting it from the quest (i call those my interaction 'threads') alias the actor was assigned into, this Travel package did one thing only - use a Travel procedure with target set to the furniture alias of the package owning quest (thread), and with the Travel procedure set as "Success completes package".
     
  2. Second part was scripted
    ...once the Travel package finished, the actor could be still a few meters away from the furniture, so the OnPackageEnd event handler inside the actor's alias script employed a bit of micromanagement, using PathToReference() function to make the actor walk closer to the target.
    I think this was the part causing the moonwalk glitch (i am gonna fix that by early placing a correctly offset merker that i am gonna use as the destination target).
    If the PathToReference() succeeded, the actor was "locked in position" by calling actor.SetVehicle(marker) (actually, there is fwe more commands to prevent some glitches).
    After that the actor was made to "activate" the other actor in furniture, and from within that other actor's alias script, the OnActivate event handler performed some common interaction initialization steps and finally called interactionSpell.Cast(actorA, actorB) which started the actual interaction via that particular spell's magic effect script (also sets up the randomized/conditional animation stages).

It worked fine, but obviously it was missing a way to handle situations not involving any furniture (i know this is to be a "Furniture Interaction Framework", so why do i bother? well, why stop there?).

So i decided to make it even more flexible, by using dynamically placed marker as a destination/lock-in target even for the actor in furniture.

It should allow me to move the marker (and thus the actor with it) to adjust the actor's position - thus for example making it possible to use those spanking chair anims even with higher bar stools, benches (where the anim turns the actor 180 deg around), and not only for that as i presume various other anims combined with various other furniture will have similar problems.

 

 

Now we get to the marker woes...

So far, the 'furniture' marker i was using as a destination/lock-in for others than the in-furniture actor, was based on the vanilla "LayDownMarker" and setup like this:

  • model: Furniture\LayDownMarker.nif
  • keywords: FurnitureSpecial
    ...dont know why, i just noticed most markers have it, what does it do?
  • Is Marker: check
  • Ignored By Sandbox: check
  • Active Markers: Sit 0 (checked)
    ...this comes from the NIF i used
  • Marker Entry Points: Behind (checked)
    ...again, comes from the NIF, not sure if it's needed for my purposes, maybe i could/should uncheck it?
  • ALL OTHER SETTINGS: empty or unset

Now i wanted to keep using this marker of mine, because it worked ok so far.

But i also wanted to change the way how interactions are started - to add more flexibility, i thought it would be nice if instead of starting interactions by making actorX activate actorA (actorA was always reserved for the one in furniture), maybe i could make the actors activate their respective markers, resulting in every actor actually "sitting" on that marker (ofc without the actual sitting anim) which seems to help against some glitches.

Unfortunately, markers setup like this cannot be activated! ...issuing marker.Activate(actor) does nothing when using this marker :(

I dont understand why? The original vanilla marker i used as a template has no such problems. If anyone knows an answer to this question, please enlighten me.

 

Anyway... as i discovered when trying the vanilla invisible furniture markers, their activation always makes the actor play some assigned idle animation.

I suppose this may be somehow connected to why my marker cannot be activated, maybe i need to somehow link some idle anim to it - but if that is the reason, then i can't use such markers, because i can't have the actors playing any idle animations (at least not other than those being part of the intended interaction).

So, IF there is even a way how to make the markers activatable by somehow linking an idle anim to them, then i would need a ..well, animation that doesnt animate at all (if that makes any sense).

An example:

...using the vanilla SoldierWallIdle furniture marker works (even when i use my custom marker with added isIdleSoldierWall keyword), actors can activate such markers, but once they do, they first play that "turn around, look at wall, turn back, lean on wall, cross arms" idle anim - thats obviously unacceptable.

 

Another problem with these working markers is with collisions.

When the actors start colliding with each other due to the animations they both play, any actor setVehicled to a marker like this (the working one, with idle anim), starts to "travel around" like he's being pushed away.

Strangely, in case of an actor locked in ZaZ pillory (but also other normal furniture), and setVehicled to that pillory/furniture, does not get pushed around like that.

...actually, they do get pushed around, but only their invisible collision body, while their visible mesh stays on place - while the actors on the working markers get pushed around their visible mesh included.

Interestingly, an actor setVehicled to my non-working marker does NOT get pushed - not his visible mesh, nor his collision body!

I just want to scream "Bethesda! Whyyyyyyy?"

What a mess...

 

 

Conclusions:

  • Actors in furniture must be setVehicled to that furniture.
  • Other actors must be setVehicled to my custom non-activable marker.
  • Cannot use activable markers at all.
    So the interaction must be still started via activating another actor.

...Skyrim never stops to amaze me, but not in a good way.

Link to comment

 

...Skyrim never stops to amaze me, but not in a good way.

 

 

*sob* you reached the conclusion everyone has.

 

*pat* Don't worry about it, you will manage to break thought it .

 

I like reading your progress updates :P, somehow its fun and you can feel the anguish because of how you wrote it.

 

Good Luck Roggvir :)

Link to comment

Progress update...

 

Good news.

I didnt give up experimenting with the furniture markers, and found some things to note..

  • Managed to successfully SetVehicle() an actor to a furniture marker that they can sit in (it had visible mesh, but i hope i can remove it, or make it almost invisible by scaling down the mesh).
     
  • Such marker then can be used to move the actor around, but one must reset actor's vehicle to None and then back to the marker, otherwise actor's position won't get updated.
     
  • Actor's collision body still "wanders" around, but that's one glitch i can live with (more precisely: i dont have a choice)

So, this will allow me to use the spanking chair animations even on benches or high bar stools.

Other types of animation will also benefit from this, that i am sure of.

 

Now i am going to craft me some special furniture marker, that has no visible mesh, or has the mesh scaled so it makes it nearly invisible.

 

EDIT:

it seems like the "Ignore by sandbox" must not be checked, otherwise the NPCs wont be able to sit down in it via package procedure 'Sit'.

So, since i dont want random nearby NPCs to use that marker before my actor arrives, i'll have to find a way how to block it's actiation at the start, and unblock it when my actor is ready to sit.. that complicates things a bit.

 

EDIT 2:

The furniture marker MUST NOT be set as "Is Marker", if it is, the actor attached to it will move around.

The furniture marker MUST HAVE a collision mesh (maybe also visible mesh?), if not, the actor will move around (works same as when marker set as "Is Marker" which makes the game not load its collision and mesh)

So, to make it "invisible" i had to scale it down to 0.001% of the original size.

 

EDIT 3:

Previously i was wrong, the marker CAN BE set as "Ignore by sandbox", it still works

(previously i forgot to unset the "Is Marker" by mistake, and didnt notice, hence i though its not working because of "Ignore by sandbox").

Link to comment

Progress update...

 

Good news.

I'd hate to jinx it, but i think i am on the right track with the new completely marker based system.

I managed to fix even the "wandering" collision of actor in furniture - simply by calling actor.SetPosition(..marker pos..) and then actor.SetVehicle(marker) again during animation.

At first i didn't like to add any more code to be run while the actors are animated, to prevent potential synchronization issues, but since its just these two simple commands, and it works so great, i think it's totally worth it.

Strangely, i tried same thing before with the old system, but it didn't worked (though i am not sure, maybe i just messed up something back then).

Link to comment

Once a version is out you are gonna be very busy fixing things due to the huge amount of feedback you will be getting :)

 

I would Recommend to take a break (1 day or however many days you want) before you give us the file :P  or give us the file and ignore the mod for 5 days to rest then come back and start fixing :D

Link to comment

Progress update...

  • Lots of glitches and collision issues solved.
    Huge thanks to ZaZ, for creating some special NIFs that do not collide with actors even though their mesh and collision is loaded by the game (which is absolutely mandatory to prevent some glitches).
    Now i use those as my furniture markers, and its like magic - all positional/collision issues i have been struggling with since i started this mod, are completely gone.
    This alone is a huge leap forward - it saved me countless hours of trying to solve those issues any other way.
     
  • Actor scripts rewritten to be more event-based.
    They now use ModEvents instead of polling wherever possible, resulting in slightly more cleaner and lightweight scripts.
    Also, the actor script structure was changed into something resembling a state machine script, instead of the old messy entangled function calls.
    AI packages were also redone, but i may yet have to revisit them.

 

 

And now about the problems...

I think there is only one single issue i need help with:

  • A package with Sit procedure.

    What happens: If the Sit procedure is given a target that is NOT an enterable furniture, but a marker instead, or even another actor, the Sit procedure seems to make its branch stuck and package never completes.

    What is expected: I need that procedure to just fail in such case, letting any subsequent procedures run, instead of making the package processing stuck (which is what i THINK happens, as i never see any effect from any of those subsequent procedures).

    Solution: so far none
    - I tried various combinations of various package/procedure settings, pairing it with wait and other procedures in simultaneous branch, but nothing helped.

    - I could add some conditions to let the Sit procedure actually run only if the target is enterable furniture, but i cannot find any condition functions that would help.
    Even the promissing IsFurnitureEntryType either doesn't work, or i used it wrong (any help on its usage?).

    - I would even settle for a script to set some 'flag' accessible by the package via another alias, but i can't even find any script functions that would help me determine if the furniture is enterable.

    - I could add some keywords to those markers/furniture objects, and add those keywords as conditions for the Sit procedure, but then anyone making their own furniture plugin, would have to add such keywords to all of their furniture and any custom markers - and i am not sure i want to rely on that they DO, or force yet another restriction/rule on them.
    More importantly, i would have to add such keywords to every vanilla furniture the mod can use! That doesn't really seem like a good idea.

A new frustrating problem waiting around every corner, it seems...

Link to comment

Solved that 'Sit' procedure problem...

Since the type of marker to be used is known to the person who created that particular interaction module, i added an option to set a flag for any of the participating actors, which makes the package skip that 'Sit' procedure.

The override flags are defined in furniture settings, using 4 boolean properies, so that makes 512 additional properties that wouldn't have to be there if Beth...ahh, whats the point.

It's dirty as hell, and i hate doing such things, but i couldn't find any other way.

 

Now if i could forget that i drowned last 20 hours in futile attempts to find a proper solution, what a waste of time.

Anyway, now i need to make sure all interaction types are working correctly with the new system, then add some more interactions and Beta should be ready (no point delaying it because of several dozens interactions - they can be added over time), but i am sure some annoying issue will pop up soon enough :)

Link to comment

Progress update...

 

Spent last few days mostly on solving how to handle NPC outfits.

The problematic part is that player cannot remove/undress items that are part of the NPC's outfit.

After trying many things, and running into various kinds of issues and glitches, i think i finally found the right solution - Virtual Inventory.

 

This Virtual Inventory is quite simple.

I created a simple cell with nothing but a single floor piece, and placed in a new persistent NPC mannequin.

The mannequin is set to stay in that cell, and is running a simple script handling the "virtual inventory" and which also disables its AI.

Now if you use my dialog choice to access any NPC inventory, it calls ShowInventory() function of this mannequin script.

It adds all NPC's items (including the outfit items) into the mannequin's inventory, makes the mannequin equip same items, sets his name to however the NPC is called, and opens mannequin's inventory.

To the player, everything looks like he's accessing inventory of that particular NPC, except now he can also see the outfit items, because in mannequin's inventory they are not part of any outfit.

When you take any item, the OnItemRemoved event handler in the mannequin's script will remove the same item from the NPC (even if it is part of an outfit), and if you add any item, the OnItemAdded will add same item to the NPC.

The event handlers also call QueueNiNodeUpdate() on the NPC, so you can immediately see what the NPC is wearing while the inventory menu is still open.

 

One thing to note:

If you would remove all of the NPC's original outfit items, the game would reset that NPC's outfit and re-equip any original outfit items it can (if the required slots are free).

To prevent that, in the OnItemRemoved handler of the mannequin's script, before the item is also removed from the NPC, i check if it is the last outfit item the NPC does have equipped, and if yes, then i use SetOutfit() to set NPC's outfit to my special empty outfit.

Link to comment

Got a small improvement idea...

 

When NPCs undress, make them drop the equipment on the ground.

Not everything of course, only body armor and equipped weapons, the rest (gloves/boots/helmet/etc.) would just unequip as it does now.

I think it may look better - especially in case of NPCs equipped with shields or two-handed weapons (otherwise, where would they stick that huge hammer, or shield, or curved sword? hmm? :))

 

It may also provide kind of interesting/funny option when combined with random NPC interactions, or even scripted ones.

For example, if you remember those ruins where you get your first claw, with those two bandits standing around a fireplace in the hall where you enter.

You could wait in the shadows until they finish talking, and maybe then they might get into some interaction, dropping armor and weapons on the ground, so you can surprise them in the worst moment, take their weapons and... well, kill them like you always do, or maybe they could try run away (but probably not without adidtional changes to vanilla packages or scripts i am afraid, which i am not gonna do).

Anyway, i think it may be interesting, shouldn't be much work, and i already have a working test version that only needs some polishing,

but i am curious to know what you ppl think?

Link to comment

Got a small improvement idea...

 

When NPCs undress, make them drop the equipment on the ground.

Not everything of course, only body armor and equipped weapons, the rest (gloves/boots/helmet/etc.) would just unequip as it does now.

I think it may look better - especially in case of NPCs equipped with shields or two-handed weapons (otherwise, where would they stick that huge hammer, or shield, or curved sword? hmm? :))

 

Latest Version of Defeat does that, altought there is a MCM option that allows you to decide between unequip/strip(drop) both for player and the npc.

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