Advanced Target Priorities

by heyqule

Streamline selecting target priorities for any player turret.

Utilities
8 days ago
2.0
3.13K
Combat
Owner:
heyqule
Source:
https://github.com/heyqule/advanced_t...
Homepage:
N/A
License:
GNU LGPLv3
Created:
a month ago
Latest Version:
1.0.2 (8 days ago)
Factorio version:
2.0
Downloaded by:
3.13K users

Advanced Target Priorities

This mod provide a streamline tool to pick units / asteroids for any turret's target priorities.

My Discord: https://discord.gg/BwWXygyEyQ

Features:
- Select units / asteroids in batch
- Save / Load presets
- Sort by unit health.

Feature Reel:
https://www.youtube.com/watch?v=G3ckO_kmd1Y

Native supported enemy mods

  • All enemy race manager units
  • Toxic_biters
  • Cold_biters
  • ArmouredBiters
  • Explosive_biters
  • Fulgoran enemies
  • Behemonth Enemies Mod
  • Sandworm from Planet Arrakis
  • Centipedes from Planet Tenebris

Translations: Checkbox options are not translatable because they are used for verifying prototypes.

TODO

  • Export/Import sharable string like blueprint.

Developer Integration

New dataset can be register through remote_api

--- Add a new remote API class if you don't have one
--- add this function to register your dataset
local RemoteAPI = {}
function RemoteAPI.advanced_target_priorities_register_section_data()
    local data =  {
        {
           --- Required 
           delimiter = '-',
           --- Required
           name = "new-biters",
           --- (Optional)
           prefix = "enemy",
           --- (Optional)
           suffix = nil,
           --- (Required) acccepts 4 type of options 'size', 'unit_type', 'tier','variant'
           options = {
               {'small','medium','big','behemoth'},
               {'biter','spitter'},
               {1,2,3,4,5}
           },
           --- (Required) controls order of text concatenation
           option_titles = {
               'size', 'unit_type','tier'
           },
           --- (Optional) allow delimiter override for each option, example 
           --- enemy--small-biter--1, default uses "--" as delimiter and you override the size one with "-"
           option_delimiters = {
               '-'
           },
           --- (Optional) define the number of columns for unit_type list.
           unit_type_columns = 2,
       }
    }

    return data
end
return RemoteAPI

--- In control.lua,
local RemoteApi = require("__your_mod__/remote_api")
remote.add_interface("your_mode", RemoteApi)

Inserting new value into existing section

--- Add a new remote API class if you don't have one
--- add this function to register your dataset
local RemoteAPI = {}
function RemoteAPI.advanced_target_priorities_insert_section_data()
    local data =  {
       {
           section = 'asteroids',
           option_title = 'unit_type',
           option = 'new_type'
       },
       {
           section = 'biters',
           option_title = 'size',
           option = 'titan'
       }
    }

    return data
end
return RemoteAPI


--- In control.lua,
local RemoteApi = require("__your_mod__/remote_api")
remote.add_interface("your_mode", RemoteApi)