Repository navigation
feat: smoke a water pipe with your own hands in VR - grab the mouthpiece, the hose follows, it bubbles at your mouth and you breathe out the smoke - #580
Open
BoroBongo wants to merge 16 commits into
Conversation
…ct's name, so more than a joint can share it (VRMouth) - no behaviour change - ExhaleSmoke(pfxName, ...) puffs any particle effect; TryExhaleSmoke picks the first one of a Humans.mds animation (the joint's t_JOINT_S0_2_Stand: LIGHTSMOKE) and warns, like before, when it has none Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ws out its smoke after a drag (IVrMouthSmokable) - nothing implements it yet - IVrMouthSmokable (next to VRMouth): something smoked without being used up names the Humans.mds animation of its smoke and hears when one of its parts touches or leaves the mouth - VRMouth: on enter such a part is no food; when it says it is smoked now, the smoke of that animation is puffed out after the drag delay (_smokeStartDelay), spread over 3 s; taken away before the drag ended, no smoke comes - trigger events only, nothing per frame Co-Authored-By: Claude Opus 5.5 <[email protected]>
…owards the hand, pulled too far it slips out and swings back; not while an NPC smokes it (VRWaterPipe) - VRWaterPipe (Adapters/Vob): added by VRMobInteraction.Start to a mob whose model ends BIP01 FLEX0..FLEX4 in BIP01 FLEXEND (checked once per built mob, mods' pipes too); a trigger on the mouthpiece (layer VobItemNoWorldCollision: hands and VRMouth see it, the world doesn't) is a handle of its own - while held, HoseIk (CCD over the 5 links, limited turns, no allocations) bends the hose to the hand in LateUpdate; further away than the hose's length + 0.15 m, the grab is let go; released, the links swing back in 0.3 s (to the pose of the pipe's own animation while MobAnimator moves them), then the component is disabled again - busy: mob state > 0 or an NPC at it (VobService.GetOtherMobUsers), checked on hover and grab, never polled - a hand closing at the mouthpiece that caught the pipe's own collider takes the mouthpiece a frame later (IVrRig.TryGrabIntoHand) - the pipe isn't used - ports: IVrBackend.AddHandle (XRI: VrInteractable + GothicGrabInteractable held without moving, kinematic, near and one hand only + bridge with the grab trigger), VrInteractable.CanGrab (asked by GothicGrabInteractable.IsSelectableBy for a new grab) - nothing saved; no prefab changed (components and collider added in code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… like for an NPC and you blow out smoke, nothing else happens (VRWaterPipe, MobAnimationService) - VRWaterPipe is an IVrMouthSmokable: the held mouthpiece at the mouth starts the hero's use (MobAnimationService.StartHeroUse: S0 -> S1 and its loop, PIPE_BUBBLES, FIRE_SMOKE at BIP01 FIRE); after the drag delay VRMouth blows out HUMANS S_SMOKE_S1's LIGHTSMOKE - away from the mouth, let go, slipped out or culled: StopHeroUse(mob) - a new overload that only stops the hero's use of this mob (not an anvil whose dialog opened meanwhile) - VRMouth: a part coming in again without having left (its exit was missed while culled) starts over - like the original: no item is used, no script runs, nothing is saved - Docs/mobs.md: the water pipe; ADR 2026-11-26-vr-water-pipe Co-Authored-By: Claude Opus 5.5 <[email protected]>
…port) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…uth - a bigger grab, the mouth meets it where the hand holds it Playtest: the 7 cm grab was nearly impossible to hit, and holding it to the mouth did nothing (no mouth trigger event) - the hose's end fell short of the hand, so its trigger never reached the mouth. Grab radius 15 cm; while held the trigger sits where the hand holds the mouthpiece; the hose IK takes 10 iterations per frame (was 4). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… mouth, and the smoke comes out with a breath when it's taken away Playtest: the smoke came out of the mouth too early, while still drawing. Now the pipe works in its loop (bubbles, smoke at the bowl) as long as the mouthpiece is at the mouth; taken away after at least 0.8 s, a breath out (Human_SnoreIn = Snore_BreathOut) and a cloud of LIGHTSMOKE in front of the face. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ing sound (SMOKE_JOINT), the snoring breath-out wasn't found Co-Authored-By: Claude Opus 5.5 <[email protected]>
… out Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oad - busy means a living NPC uses it now, not the mob state The mob state an NPC's use left comes back with a load (MobStatesSaveSection), but no NPC uses the pipe then and ReleaseMob never resets it, so the mouthpiece stayed refused for good (review d24f2a9, gothic bug 1). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Service.IsUsedByOtherNpc) - the VR water pipe asks it, no behaviour change One rule for the next mob the hero takes hold of, independent of the mob kind (MobState > 0 also means switched or open). Review d24f2a9, architecture finding 3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… smoking - the mouth forgets it without smoke instead of throwing on its destroyed collider The mouth's state is cleared before anything else, and a smoked part (or its pipe) that is destroyed or deactivated is let go without a breath out and without being told. Before, .name of the destroyed collider threw before the state was cleared, and every later smoke at the mouth threw again (review d24f2a9, gothic bug 2 and issue 3). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hout a hand) is let go a frame later, not inside the backend's grab event Releasing inside XRI's select event breaks the interaction in progress (architecture.md "Inside Gothic-VR" 4) - now deferred like the take-over already was (review d24f2a9, architecture finding 1). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… it, even while the hand stays at it - its busy check is renewed twice a second while a hand tries to grab The take-over and the refused grab's release remember the frame they were deferred in instead of a flag that culling could leave set (OnDisable doesn't come while the component is idle); OnDisable only stops the hero's use. Removed the dead _smokableExhale field and a stale constant comment in VRMouth (review d24f2a9, gothic issues 4 and 5). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd a smokable names its breath-out sound (IVrMouthSmokable.ExhaleSound) - no behaviour change VRMouth keeps the triggers and the eating; VRMouthSmoking holds the smoked part, its drag and the breath out (sound and smoke a second after a drag of at least 0.8 s). The water pipe's sound SMOKE_JOINT moved to VRWaterPipe (review d24f2a9, architecture finding 4). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
Review (architecture-reviewer + gothic-reviewer) on d24f2a9Gothic: approve with fixes. Architecture: fits with concerns. Fixed:
Kept: an NPC sitting down while the hero smokes (edge case). Follow-up: the handle from a prefab (see the PR text). Played in the editor by the author:
No exceptions. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The water pipes (G2 Khorinis, and pipes in mods with the same hose parts) can be smoked with your own hands in VR:
HoseIk). If you pull further than the hose is long (1.33 m), the mouthpiece slips out and swings back.MobAnimationServicehero use, from feat: mobs play their own animations, sounds and particles while they are used - the smithy rings, sparks and steams #578).SMOKE_JOINT) and see a cloud ofLIGHTSMOKEin front of your face.VobService.IsUsedByOtherNpc). Nothing else happens, like the original: the scripts give the hero nothing at a water pipe.Technical:
IVrBackend.AddHandlebuilds a grab handle on a sub-node; the XRI backend implements it (GothicGrabInteractable.SetUpAsHandle, a bridge with trigger colliders).VrInteractable.CanGrablets the game refuse a grab.VRWaterPipe(VR adapter, added byVRMobInteractionto mobs whose model ends a FLEX hose inBIP01 FLEXEND) andHoseIk.VRMouthSmoking(the mouth's smoking session, split out ofVRMouth) talks to the pipe throughIVrMouthSmokable. Eating and joints are unchanged.Stacked on #578 (mob animations).
Why
Playtest: the water pipes next to Abuyin in Khorinis did nothing in VR, while NPCs smoke them.
How to test manually
Save/load
Nothing is saved. The hero's use writes no mob state, and the pipe is free after a load.
Known gaps / follow-ups
AddComponentcalls inXriBackend.AddHandle. That way its setup is visible in the Inspector and testable in the Lab scene. Prefabs must be made through Unity MCP.Docs/adr/2026-11-26-vr-water-pipe.md🤖 Generated with Claude Code