Click to Move

by houcky

Allows players to middle click to move their character to a destination.

Utilities
5 days ago
2.0 - 2.1
1.73K
Owner:
houcky
Source:
https://github.com/henriquempimenta/c...
Homepage:
https://github.com/henriquempimenta/c...
License:
MIT
Created:
11 months ago
Latest Version:
0.1.13 (5 days ago)
Factorio version:
2.0 - 2.1
Downloaded by:
1.73K users

Click2Move for Factorio

A quality-of-life mod that enables point-and-click movement for your character and vehicles. Inspired by ARPG and RTS games, simply click where you want to go, and the pathfinder will take you there.

Features

  • Point-and-Click Movement: Use a mouse click to set a destination for your character or the vehicle you are driving.
  • Path Queuing: Hold Shift while clicking to queue up multiple destinations.
  • Numbered Destinations: Queued destinations are numbered on the map so the route order is visible at a glance.
  • Vehicle Support: Control cars, tanks, and occupied spidertrons as well as your character.
  • Vehicle Braking: Vehicles retain control at destinations until their speed and scripted drift settle before advancing the queue. If braking leaves a vehicle outside the arrival radius, it approaches farther inside and stops again.
  • Visual Path: See the calculated path drawn on the ground, so you know exactly where you're headed.
  • Destination Marker: A crosshair marks your final destination.
  • Movement GUI: A small panel appears in the top-left showing your current destination and the number of queued goals. It also includes a "Cancel" button to immediately stop all automatic movement.
  • Shortcut Mode: Toggle Click2Move on or off from the shortcut bar.
  • Stuck Detection: If your character or vehicle gets stuck, the mod will automatically attempt to find a new path to your destination.
  • Configurable: Customize the mod's behavior through a variety of settings in the "Mod settings" menu.

How to Use

  • Move: Press Mouse Button 3 (the middle mouse button by default) on the terrain to move to that location.
  • Queue Moves: Hold Shift and press Mouse Button 3 to add a destination to your movement queue.
  • Cancel Movement:
    • Click the "Cancel" button in the top-left GUI.
    • Use the "Cancel Click2Move" custom input if you bind one in Factorio's controls.
    • Move your character manually with the keyboard (WASD).
    • Use the vehicle movement keys to take over driving in normal view. Panning in remote view does not cancel movement.
    • Set a new destination without holding Shift (this will clear the old queue).
  • Toggle Mode: Press Control + Shift + M or use the shortcut bar button to enable or disable Click2Move. Disabling it cancels the current movement and ignores future movement clicks until re-enabled.

Movement continues while map or remote view is open, so you can inspect the route and pan the camera. Use the cancel command or GUI to stop it from those views.

The default keybind can be changed in Factorio's control settings. Look for "Click to Move".

Known Issues

  • Flickering with Mech Armor: When moving horizontally with mech armor, the character sprite may flicker.
  • Vehicle Steering: Steering can overshoot or oscillate, particularly around tight turns or with vehicles that have strong inertia.
  • Spidertron Remote View: Ordering selected spidertrons from remote view is not supported yet. Remote-view clicks still control the player character or current vehicle.

Mod Settings

You can adjust these settings in Settings -> Mod settings.

Setting Name Type Scope Default Description
Debug mode Bool Per-Player false Enables printing of debug messages to the console for your player.
Debug categories Bool Per-Player true Filter debug output for pathfinding, queue, stuck recovery, and vehicle control.
Character margin Float Per-Player 0.45 The safety margin added to the character's bounding box for pathfinding. Larger values avoid tighter gaps.
Update interval Int Global 1 The number of game ticks between movement updates. Lower is smoother but uses more UPS.
Character proximity threshold Float Per-Player 1.5 How close (in tiles) the character must be to a waypoint to consider it "reached".
Vehicle proximity threshold Float Per-Player 6.0 How close (in tiles) a vehicle must be to the final goal to consider it "reached".
Stuck threshold Int Per-Player 30 No-progress limit in game ticks. Ordinary paths wait twice this value; straight-line movement waits this value.
Vehicle path margin Float Per-Player 2.0 The safety margin added to the vehicle's bounding box for pathfinding.
Vehicle Prefer Straight Paths Bool Per-Player false Asks Factorio's pathfinder to prefer straighter vehicle paths. Can be slower to compute.

Note: Settings can be changed on the fly. The global update interval re-registers the movement scheduler when changed. Vehicles finishing a move keep applying their brakes every tick regardless of this interval.

Stuck recovery lasts 30 game ticks for a character slide and 60 game ticks for a vehicle reverse. These durations and the no-progress limit are independent of the update interval; a larger interval can delay detection until the next scheduled update.

Installation

  1. Install Click to Move from Factorio's in-game Mods menu, or download it from the Factorio Mod Portal.
  2. If downloading manually, place the .zip file into your Factorio mods directory.
    • Windows: C:\Users\<YourUsername>\AppData\Roaming\Factorio\mods
    • Linux: ~/.factorio/mods
    • macOS: ~/Library/Application Support/factorio/mods
  3. Launch Factorio and enable the mod from the "Mods" menu if it's not already enabled.

Development and releases

Run python3 tools/check.py from the mod directory to check Lua syntax, run every tests/*.lua regression script, and verify packaging. Python 3.10 or newer and Lua with luac are required; CI uses Lua 5.2. Install jq to include mocked publish-workflow tests.

Build a local release archive with python3 tools/package.py. It includes only the files listed in package-manifest.json, checks local Lua dependencies and assets, and verifies the finished ZIP. Add new runtime files to the manifest when introducing them. Downloaded mods, tests, editor files, and tooling are excluded.

Optional engine checks require a Factorio 2.1 executable and an unpacked Hovercrafts 2.1.4 directory:

python3 tests/engine/run.py --factorio /path/to/bin/x64/factorio --hovercraft /path/to/Hovercrafts_2.1.4

The runner uses temporary mod, configuration, and save directories. It tests native entities, Hovercraft physics, rendering, storage, save/load, and configuration migration through the production movement handlers. Initial motion is seeded, scheduler registration is instrumented, and player/UI calls are mocked because the headless saves have no connected players. Interactive controls, obstacle steering, and live multiplayer still require in-game validation.

Before tagging a release, update info.json and the curated native changelog.txt. The publishing workflow runs the checks and requires the tag version to match info.json; it does not regenerate release notes or rewrite the version. Pushing a matching vX.Y.Z tag publishes to the mod portal using the Portal environment's API key.

Author: Me