Tactical Construction


Tactical Construction provides a per-player toggle that - when enabled - prioritizes the local player's roboport for construction requests (as opposed to allowing construction requests to be satisfied by any logistics network that overlaps inside the player's mobile roboport). CAUTION: This mod applies force changes to any game loaded with the mod active; these changes are not reverted if you disable the mod w/o first instructing it to undo the changes to your file(s). Read the mod description.

Content
1 year, 5 months ago
0.18 - 1.1
310
Logistic network

Changelog

Version: 1.1.0
Date: 2022-10-23
  Minor Features:
    - Make use of the new luaForce.color/luaForce.custom_color APIs to prevent base colors from changing whenever the prioritize button of the first player on that force is toggled.
      - In order to accomplish this, I had to reset the toggle state for all players when another mod moves a player between forces. Please let me know if this causes problems.
  Bugfixes:
    - Garbage collect mod's data for player in on_player_removed() event. (Removing a player entirely from a save is atypical.)
  Changes:
    - Redesign alt force garbage collection logic a bit.
Version: 1.0.0
Date: 2021-01-27
  Info:
    - No code changes from version 0.4.0; just marking this mod as out of beta now :-)
Version: 0.4.0
Date: 2021-01-17
  Minor Features:
    - Prevent users from accidentally performing research while they are on the alternative game force (for prioritize local construction).
  Info:
    - I am considering re-releasing this version as version 1.0.0 of this mod (eventually). Please report any problems!
Version: 0.3.0
Date: 2021-01-03
  Major Features:
    - Support a toggle button (hidden by default; use mod settings to unhide it) that can globally clean up the mod's alternate forces that it creates on the file. You can use this button to cleanse your file before you disable the mod entirely :-)
  Changes:
    - Delete the now-unnecessary version-detection logic that was being used to determine whether the luaSurface.find_entities_filtered() API supported to_be_deconstructed=true. Yay Factorio 1.1!
Version: 0.2.6
Date: 2020-12-14
  Bugfixes:
    - Fix mod_gui crash when first enabling the mod on an existing save or upgrading the mod (i.e. migration scripts run).
Version: 0.2.5
Date: 2020-12-13
  Changes:
    - Target Factorio 1.1 from now on.
    - Remove reference to force.auto_character_trash_slots (no longer present in 1.1).
Version: 0.2.4
Date: 2020-05-05
  Bugfixes:
    - Fix research replication logic between primary -> alternative forces in game to NOT corrupt the primary force's current research level for space science technologies.
      - Sorry about this bug. Programming is hard :-(
Version: 0.2.3
Date: 2020-04-29
  Bugfixes:
    - Preventive medicine: Remove use of consuming='script-only' option from keyboard shortcut prototype.
      - (Factorio devs recently announced this option will break in an upcoming update.)
Version: 0.2.2
Date: 2020-04-28
  Bugfixes:
    - Sync force logistics request attributes to alternate game force upon every button toggle.
      - This fixes a crash that could occur upon toggling the button if the alternate force didn't have the same attributes set as the player's primary force.
Version: 0.2.1
Date: 2020-04-25
  Major Features:
    - Support for prioritizing player roboport for deconstructions.
      - Thanks to the Factorio developers for adding the required filter parameter to surface.find_entities_filtered()!
      - Works on 0.18.21 or newer. Older versions of 0.18.x should still work but without the new behavior (I added version detection logic).
Version: 0.2.0
Date: 2020-04-18
  Changes:
    - Rework toggle button to be on shortcut bar.
      - Note: You will have to unhide it using small '...' button on right side of shortcut area.
    - Add keyboard shortcut support.
      - Default is ALT-F.
      - Configurable via Settings -> Controls.
  Bugfixes:
    - Prevent crash when toggling the feature on/off when player is dead.
    - Upon death, player reverts to primary/default force.
Version: 0.1.4
Date: 2020-04-18
  Bugfixes:
    - Fix crash when a scenario or other mod script is altering the player force upon map creation (before mod init).
Version: 0.1.3
Date: 2020-03-28
  Info:
    - No real functional changes with this version; simply revising the mod description to indicate the mod is what I would call in 'beta' stage.
      - I and my friends did some pretty extensive testing in various multiplayer games.
      - Even on our 'huge base' file, the 'alternative force' management logic in the mod has not screwed up anything in our base.
      - Even if something does get glitched out and gets 'stuck' on the 'alternative force' as long as everyone has toggled off the button, the mod does now have logic (as of v0.1.0) to ensure anything 'stuck' on the alternative force is reverted.
  Changes:
    - Update mod description (info.json and readme).
    - Add usage instructions to readme.
Version: 0.1.2
Date: 2020-03-28
  Bugfixes:
    - Fix mod to actually initialize correctly in a multiplayer game with multiple players already in it.
Version: 0.1.1
Date: 2020-03-27
  Bugfixes:
    - Fix player resetting logic to move the player back to their primary force upon reset.
    - Fix player initialization logic to call update_gui() to update the full gui state (rather than just creating the gui if necessary, but not refreshing it).
  Changes:
    - Add (rather janky) thumbnail image.
Version: 0.1.0
Date: 2020-03-27
  Changes:
    - Major refactor of roles and responsibilities between different script files.
    - Refactor event handling/response logic to make the different interactions more understandable.
    - Redesign alternative force creation logic to ensure crash doesn't happen if a player has changed forces since joining the game.
    - Register and listen to events.on_player_changed_force and try to react if player has moved forces outside of this mod.
    - Implement much more reliable 'garbage collection' logic:
      - Runs every ~2 min. I've rather painstakenly tried to optimize this, but please report if you notice consistent lag every 2 mins.
      - Clean up the alternative forces if there are no longer any connected players that might use them.
      - Reset any disconnected player's 'toggle' state and associated gui.
  Gui:
    - Give the 'enabled' version of the feature's toggle button a yellow background to make it more intuitive that it's 'enabled'.
  Bugfixes:
    - Fix script error immediately encountered in 'true' single player game (issue #4).
    - Fix players 'bleeding' robots because the script tries to restore anything outside the construction radius back to the original force (robots and player characters now excluded :-) ).
    - Don't revert all entities from alternative_force -> base_force if another player is currently living on the alternative force.
Version: 0.0.4
Date: 2020-03-22
  Bugfixes:
    - Back up and restore player logistic request slot counts before/after switching forces.
      - Fixes logistic request slots for the player resetting to 'zero' items upon toggling the feature.
Version: 0.0.3
Date: 2020-03-22
  Changes:
    - Add cautionary warning text to mod description in info.json so people can see it in the Factorio game mod UI.
  Bugfixes:
    - Fix script error upon technology research completion.
Version: 0.0.2
Date: 2020-03-21
  Fixes:
    - Fix mod description to have correct mod name and fix related typo.
Version: 0.0.1
Date: 2020-03-21
  Info:
    - Initial mod release.