Skip to content

Add axis-drag moving tools, WINCH_IN/OUT, LIGHT_TOGGLE, requireHolding for clickPoints, and locale fixes#25

Open
206airmail wants to merge 5 commits into
TobiasF92:developfrom
206airmail:feature/axis-drag-winch-light-toggle
Open

Add axis-drag moving tools, WINCH_IN/OUT, LIGHT_TOGGLE, requireHolding for clickPoints, and locale fixes#25
206airmail wants to merge 5 commits into
TobiasF92:developfrom
206airmail:feature/axis-drag-winch-light-toggle

Conversation

@206airmail
Copy link
Copy Markdown

@206airmail 206airmail commented May 21, 2026

Summary

This PR implements several new features, fixes, and cleanup changes developed against the develop branch.

New Features

Axis-drag moving tool system

  • New axisPoint action: locks the player camera while the mouse is held, capturing vertical mouse delta as an axis value
  • New axisMovingTool actor: drives a cylindered moving tool directly from the captured axis (replaces the old IC_AXIS_DRIVE action, which was dead code)
  • New leverAnimation actor: plays a blend animation in sync with the axis value for a physical lever visual

WINCH_IN / WINCH_OUT functions

  • Hold-to-activate functions for winch control
  • Uses the existing InteractiveFunction infrastructure

LIGHT_TOGGLE function

  • IC-exclusive per-light toggle independent of the vehicle lighting system
  • Controls both real light nodes and static mesh emissive shader parameters
  • Applies off-state on initial load so lights match IC default state (stateValue=0) on first spawn

requireHolding attribute for clickPoints

  • Any <clickPoint> can now specify requireHolding="true" to require the player to hold the interact key rather than tap it
  • Applies to all IC controllers, not just winches
  • Useful for any action where accidental activation would be undesirable

Fixes

  • Fixed dedicated server bug: InteractiveActorMovingTool:update() was zeroing tool.move on every frame on the server (because hasInput=false), cancelling the move value the client had already sent. Added if not hasInput then return end guard.
  • Fixed LIGHT_TOGGLE initial state: real light nodes were visible on first vehicle spawn because IC never called negFunc on load. Fixed by applying the off-state explicitly in loadFunc.
  • Re-enabled InteractiveActorDashboard (was commented out of the source list in main.lua).

Locale Fixes

Corrected untranslated strings that were left as English in non-English locales:

  • BR: actionIC_radioOn, actionIC_radioOff
  • FR: settingsIC_state_option01
  • IT: actionIC_radioOn, actionIC_radioOff
  • PL: actionIC_radioOn, actionIC_radioOff

Documentation

Added XML_REFERENCE.md — a comprehensive reference document covering all IC XML configuration elements, attributes, and examples. Covers:

  • <interactiveControl> vehicle spec root
  • All <controller> types with their attributes
  • All <clickPoint> attributes including the new requireHolding
  • All <actor> types: animation, function, objectChange, movingTool, axisMovingTool, leverAnimation, dashboard
  • All supported InteractiveFunction names
  • The new axisPoint action configuration
  • Examples for the new axis-drag and winch workflows

206airmail and others added 5 commits May 20, 2026 23:26
Introduces three new components for mouse-drag control of cylindered
moving tools from outside the vehicle:

- InteractiveAxisPoint: new action type (axisPoint in XML). Holds the
  IC button and redirects mouse movement to drive a moving tool instead
  of rotating the camera. Supports Y (up/down) and X (left/right) axes
  via dragAxis attribute and a sensitivity multiplier.

- InteractiveActorMovingTool: new actor type (axisMovingTool in XML).
  Targets a Cylindered moving tool by movingToolIndex or node. Applies
  mouse input each frame using the same formula as the in-vehicle mouse
  drag path (invertAxis, armSensitivity, mouseSpeedFactor). Guards with
  hasInput so dedicated servers do not zero out tool.move.

- InteractiveActorLeverAnimation: new actor type (leverAnimation in XML).
  Drives an animation to visually represent drag direction in real time,
  returning to a configurable neutralTime when idle.

Supporting changes:
- InteractiveController: axis hold state, setAxisDriveSpeed,
  getAxisDragAxis, getAxisSensitivity, anyActionIsAxis, canStartHold,
  distance-based active controller selection.
- InteractiveClickPoint: fix scale corruption bug (was self.size = scale,
  should be scale = self.size), add requiresEngine support, mouseDistSq
  tracking, getMouseDistSq(), canExecute() engine check.
- InteractiveControl: distance-based controller selection in
  updateInteractiveController, fix dead or isOutdoor branch.
- main.lua: PlayerInputComponent.onInputLookUpDown and
  onInputLookLeftRight overrides to capture mouse axis during hold,
  suppress camera rotation. Add new source files. Re-enable
  InteractiveActorDashboard.
WINCH_IN / WINCH_OUT:
  Hold-to-activate functions for the Winch specialization. XML:
    <function name="WINCH_IN"><winch ropeIndices="1" /></function>
  ropeIndices accepts a space-separated list of 1-based rope indices,
  allowing multiple ropes to be controlled simultaneously.
  updateFunc calls setWinchControlInput every frame while isHoldActive
  to keep the winch moving (vanilla winch stops after ~500ms without
  continuous input). requiresHolding = true so the clickPoint
  requireHolding flag is implicit.

LIGHT_TOGGLE:
  IC-exclusive individual light control. Nodes must not be defined in
  <vehicle.lights> or <staticLightCompounds>; IC owns them completely
  and the game's light system never touches them.
  - realLight nodes: LIGHT_SOURCE nodes controlled via setVisibility.
  - staticLightMesh nodes: emissive meshes using the staticLight shader
    variation, controlled via lightIds0-3 shader parameters (all 16 UV
    slots set to intensity so any UV mapping activates correctly).
  loadFunc applies the off state immediately so i3d-visible nodes match
  IC's default stateValue of 0 on first spawn.
  State persists through F-key cycling, vehicle entry, and all other
  game light events because the nodes are outside the game's light system.
…to 1.3.0.0

- BR: actionIC_radioOn/Off were English; now Portuguese
- DE: input_IC_CLICK was English; now German (Klickpunkt)
- FR: settingsIC_state_option01 was "Switchable"; now "Commutable"
- IT: actionIC_radioOn/Off were English; now Italian
- PL: actionIC_radioOn/Off were English; now Polish
- modDesc version bumped to 1.3.0.0 with changelog entry
Documents all interactiveControl XML elements and attributes including
axisPoint, axisMovingTool, leverAnimation, requireHolding, LIGHT_TOGGLE,
WINCH_IN/OUT, and all existing actors/functions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cylinderedInputDirtyFlag skips tools where axisActionIndex is nil, which
is always the case for IC moving tools (they have no input-bound axis).
Replace the dirty-flag approach with ICMovingToolInputEvent, a new event
that sends (vehicle, toolIndex, moveValue) directly client→server so
Cylindered:onUpdate() can apply the move value normally.

Also remove the hasInput guard from InteractiveActorMovingTool:update()
— outdoor IC interactions run with hasInput=false (no seated driver), so
the guard was preventing axis drag from working outside the cab.

Add hasPendingStop so a stop event is sent even when the drag button is
released mid-frame on a dedicated server client (where tool.move is never
set locally).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant