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
Conversation
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>
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.
Summary
This PR implements several new features, fixes, and cleanup changes developed against the
developbranch.New Features
Axis-drag moving tool system
axisPointaction: locks the player camera while the mouse is held, capturing vertical mouse delta as an axis valueaxisMovingToolactor: drives a cylindered moving tool directly from the captured axis (replaces the old IC_AXIS_DRIVE action, which was dead code)leverAnimationactor: plays a blend animation in sync with the axis value for a physical lever visualWINCH_IN / WINCH_OUT functions
InteractiveFunctioninfrastructureLIGHT_TOGGLE function
requireHoldingattribute for clickPoints<clickPoint>can now specifyrequireHolding="true"to require the player to hold the interact key rather than tap itFixes
InteractiveActorMovingTool:update()was zeroingtool.moveon every frame on the server (becausehasInput=false), cancelling the move value the client had already sent. Addedif not hasInput then return endguard.LIGHT_TOGGLEinitial state: real light nodes were visible on first vehicle spawn because IC never callednegFuncon load. Fixed by applying the off-state explicitly inloadFunc.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:
actionIC_radioOn,actionIC_radioOffsettingsIC_state_option01actionIC_radioOn,actionIC_radioOffactionIC_radioOn,actionIC_radioOffDocumentation
Added
XML_REFERENCE.md— a comprehensive reference document covering all IC XML configuration elements, attributes, and examples. Covers:<interactiveControl>vehicle spec root<controller>types with their attributes<clickPoint>attributes including the newrequireHolding<actor>types:animation,function,objectChange,movingTool,axisMovingTool,leverAnimation,dashboardInteractiveFunctionnamesaxisPointaction configuration