Context-Sensitive Interaction

A curated forum for compatible and maintained mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
Post Reply
User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Context-Sensitive Interaction

Post by John Doom »

Automatically switches to the most appropriate interaction mode (like in Oblivion/Skyrim).

Image

DOWNLOAD: https://www.nexusmods.com/daggerfallunity/mods/285

Willnex
Posts: 4
Joined: Wed Apr 27, 2022 6:39 pm

Re: Context-Sensitive Interaction

Post by Willnex »

Context sensitive interaction/crouch Sneak mod
I have both these mods atm, and the context sensitive interaction isn't allowing me to employ Sneak tactics/pick locked doors etc. It doesn't seem to work well with the Penwick papers mod, either. Could this be a load order problem?

Lywzc
Posts: 107
Joined: Mon Sep 23, 2019 6:15 pm

Re: Context-Sensitive Interaction

Post by Lywzc »

This mod alone also prevents me from lockpicking which is so sad since other than that this mod is amazing.
I guess this mod defaults all doors to grabbing instead of stealing when you are crouching or sneaking.

General_101
Posts: 5
Joined: Sat Feb 04, 2023 6:45 pm

Re: Context-Sensitive Interaction

Post by General_101 »

I noticed that the mod wasn't playing along nicely with the world tooltips mod during my playthrough. Specific buildings will reuse the tooltips from other structures. An example is "The Fox and Chasm" in Ripmore would sometimes take the name "residence" depending on whether or not you looked at a different door beforehand or not. Also noticed the lockpicking thing myself during my playthrough. Would be nice if either crouching or sneaking unless there's some benefit for them being split that I'm not aware of.

REPO STEPS FOR NAME ISSUE:
1. Have the "World Tooltips" and "Context-Sensitive Interaction" mod installed and enabled.
2. Start up the game and find the city of ripmore and travel there. Before you travel there It is important that you do not look at any buildings beforehand.
3. Find "The Fox and Chasm" inn in the north west corner of the map.
4. Examine the door. You should notice that the tooltip is blank.
5. Go an examine the door to the house directly behind you. The name "residence" should appear as expected.
6. Reexamine the door to "The Fox and Chasm". The name should now be "residence" for some reason.

This does not just happen with names. The status of the building it inherited also comes into play. So if the last door you looked at was a bank during closing hours then the inn will also be inaccessible. Not entirely sure which mod is the culprit but I can only reproduce it consistently with these two mods together.

FEEDBACK:
Please make sneaking or crouching count towards enabling steal mode. Maybe could be a setting that comes up if the user has "Sneak and Crouch Combined" installed.

I made some edits to the mod to add this functionality and it seems to work well enough though I did notice that the mod requires to be precompiled for it to work. Didn't have to do this for a couple of other mods I messed with. Perhaps that should be looked into? I'm assuming there's a difference between the Unity compiler and the runtime compiler in Daggerfall Unity

Mods referenced in this post:
https://www.nexusmods.com/daggerfallunity/mods/158
https://www.nexusmods.com/daggerfallunity/mods/140

EDIT: Starting to think this might be some sort of bug with Daggerfall Unity? Seems to have something to do with the hasHit function specifically for the name thing. Either way I fixed it in my local copy. It's probably pretty inefficient but seems to be doing a good enough job for me.

I borrowed code from the world tooltips mod so credit there to the original author, If that's a problem let me know or delete this post.

Changes in the attached file include.
1. Setting up a workaround for the door issue mentioned above
2. Making crouching or sneaking near NPCs or doors enable steal mode. Looks good to me from my quick testing.

If you're interested in using these changes it's pretty simple to take the edited cs file I have attached and get the source from the original Nexus post. Compiling from there shouldn't be too difficult.

Edit2:
Updated the attachment to fix a bug with interaction with doors and realistic wagons. Looks good to me as is now.

Edit3:
I lied. Updated it so that it doesn't run every frame and also changed a thing with billboards so that it's grab instead of look. Had trouble interacting with loot in a dungeon. The way it's set up now also does mean you can set the mode yourself until the code sees something new like you going from combat to sneak/crouch or a new object. It acts weird with buildings for some reason but if you click once then it updates. If anyone knows what that's about hmu.

Edit4:
Couldn't pick some doors in a dungeon. Turned out they were action types so set that up with the lockpicking stuff too. Also added a thing for swimming. Made it so that it works like levitation does and you just swim in the direction you're facing. Just makes it much more intuitive in my opinion. You should still sink if you're carrying too many items and it shouldn't affect anything if you're using levitation. Only issue is that if you press the float up/down keys while swimming in a similar direction then you go slightly faster than you normally would. Can't really do anything about this since it's a default thing. You could unbind the keys or practice self control I suppose. Unless someone has any ideas for that. Surprised it's not a feature in Daggerfall Unity tbh.

If you're not a fan of that then feel free to comment out the SetMovement on line 92.
Attachments
ContextSensitiveInteraction.7z
(2.91 KiB) Downloaded 136 times

Lywzc
Posts: 107
Joined: Mon Sep 23, 2019 6:15 pm

Re: Context-Sensitive Interaction

Post by Lywzc »

General_101 wrote: Sun Feb 05, 2023 6:16 pm
Thanks for the change. However I noticed a bug with your edition. If you save while crouching/sneaking and load the save, the action will become grab instead of steal.

General_101
Posts: 5
Joined: Sat Feb 04, 2023 6:45 pm

Re: Context-Sensitive Interaction

Post by General_101 »

Lywzc wrote: Thu Apr 06, 2023 11:20 am
General_101 wrote: Sun Feb 05, 2023 6:16 pm
Thanks for the change. However I noticed a bug with your edition. If you save while crouching/sneaking and load the save, the action will become grab instead of steal.
I suppose I could try saving and restoring it. I'll take a look at some point. Also noticed swimming in water and getting out while have a slowdown for some reason. Will look at that too

General_101
Posts: 5
Joined: Sat Feb 04, 2023 6:45 pm

Re: Context-Sensitive Interaction

Post by General_101 »

Since Daggerfall got a 1.0 release and this thread and mod seemed to have zero activity I've decided to just publish a Github repository with the code edits and an already compiled dfmod. Again, if this is an issue please let me know.

https://github.com/General-101/Daggerfa ... nteraction

Post Reply