communications relay login

Getting Into a Bind - Auto/Priority Targeting

Started By:
KickKat, Wed 16 Mar, 2016 12:48 AM
Views:
4691
Replies:
0
    • Stepping Forward
      Uncommon (25 Points)

      Going from Clearance Level 3 to Clearance Level 4

      Unlocked Sat 29 Sep, 2018 1:28 PM

      1.91% have received this achievement

    • Tour of Duty
      Uncommon (25 Points)

      RSVP to ten events via the Events System

      Unlocked Fri 18 Sep, 2015 9:02 PM

      1.31% have received this achievement

    • Dean’s List
      Uncommon (25 Points)

      Pass all three Academy exams

      Unlocked Sun 20 Dec, 2015 9:04 AM

      3.98% have received this achievement

    • Starfleet's Finest
      Common (10 Points)

      Be a member of Starfleet Operations

      Unlocked Fri 28 Aug, 2015 4:01 AM

      28.08% have received this achievement

    • tlhIngan SuvwI'
      Common (10 Points)

      Be a member of the House of Kular

      Unlocked Fri 28 Aug, 2015 4:01 AM

      13.06% have received this achievement

    • The Mad House
      Common (10 Points)

      Be a member of the Holodeck

      Unlocked Sun 27 Mar, 2016 10:01 PM

      12.99% have received this achievement

    ACHV. Points
    395
    Reputation
    2
    Join Date
    Aug 28 2015
    Posts
    164
    0
    • Users who disliked
    • None
    0
    • Users who liked
    • None
    Reply With QuoteQuote
    #1
     –  Last edited by KickKat; Fri 09 Jul, 2021 10:20 PM.
    Introducing KickKat's STO Priority Targeting System

    The Purpose Of This Script:

    This is a script that allows one to assign a targeting priority to the player selected target types and offload the burden of locating and acquiring these specific targets to the computer, automating target selection to some extent.

    For example, a player could decide that they want to always target Elite Tactical Drones above all else and Heavy Tactical Drones if there is no Elite drone. If neither primary nor secondary target exists, the next target will be selected as determined by normal game target rotation settings ... i.e. "Tab Targeting".

    Known Issues / Concerns:

    1. This should work in space, but has only been tested on the ground

    2. On large maps, a target may be selected that is far outside of combat range causing your BOffs to run off after it. The problem is that targeting enemies by name does not honor the max targeting distance setting in the Controls section of the game options. The limit only affects "Next" and "Previous" targeting commands.

    Disabling Priority Targeting on problematic maps is the only guaranteed solution. Setting your captain as the focused target will cause the BOffs to come back if they have already started moving away. Maps that are made of multiple rooms or segregated areas do not have this problem. Open maps like the Dyson ground battle-zone or the Kobali home-world can be problematic. I am still investigating a workaround.

    3. If you edit the CommandAliases.txt file incorrectly, your game may crash upon loading. Either undo what you did in that file or rename/delete it to fix it. No permanent harm will be done. YOU SHOULD BE MAKING A BACKUP/COPY OF THE CommandAliases.txt AND KEY BIND FILES BEFORE EDITING THEM, (in Windows, select the file, then press Ctrl-C then Ctrl-V and press Enter or select "Yes". Backup copy made. Smile


    Usage Scenarios:

    Voth Battlezone

    Prioritize Voth Medics during the Big Dino Hunt.

    Borg TFOs

    Always target Elite and Heavy Tactical Drones first.

    Heralds

    Thralls .... Thralls are the reason I made this thing. I became very annoyed one day after being ganked by a Thrall for the 5th time on the same map. This was my answer. Identify, target them and have my BOffs focus fire on them before they could teleport. Since I started using this, I have never lost a 1 on 1 confrontation and my 2 on 1 is > 90%


    Code:
    // ** *************************************************************************
    // ** NOTES:
    // ** *************************************************************************
    // ** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // ** !!
    // ** !! MAKE A COPY OF YOUR CommandAliases.txt FILE BEFORE EDITING ANYTHING
    // ** !! CHANGES TAKE EFFECT IMMEDIATELY WHEN THE FILE IS SAVED
    // ** !!
    // ** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // **
    // ** /////////////////////////////////////////////////////////////////////////
    // ** // Any lines beginning with "//", like these, are comments.  
    // ** // They are meant for people and will be ignored by the game.
    // ** // I strongly suggest they be used to note wherever changes have been
    // ** // made, at the very least.
    // ** /////////////////////////////////////////////////////////////////////////
    // **
    // ** -- Commands may be executed by binding them to keys (X "CommandName"),
    // ** entering them in the chat text entry field (/CommandName), or typing
    // ** them directly into the console window (CommandName).
    // **
    // ** -- Command names can be any combination of alpha-numeric characters.
    // **
    // ** -- Command names must begin with a letter.
    // **
    // ** -- Commands are not case sensitive
    // **
    // ** -- If a command name is changed in one place, it must be changed in
    // ** ALL places.  Using the "Find and Replace" feature available in most
    // ** text editors is the best way to do this.
    // **
    // ** -- I use the "pt" prefix on all command names to signify that they are
    // ** associated with Priority Targeting. It also helps prevent name
    // ** with other aliases.
    // **
    // ** *************************************************************************
    //
    //
    // == =========================================================================
    // == = Assigning Targets =====================================================
    // == =========================================================================
    // --
    // -- -------------------------------------------------------------------------
    // -- Manually by Name
    // -- -------------------------------------------------------------------------
    // --
    // -- Set / change a Primary or Secondary target by typing in its name
    // --
    // -- - ptSetPrimary is the command that sets the Primary Target
    // --
    // -- - ptSetSecondary is the command that sets the Secondary Target
    // --
    // -- - The actual target name goes between the quotes, which are included
    //    
    //    /ptSetPrimary "Voth Medic"
    //    /ptSetSecondary "Voth Spec Ops"
    //    /ptSetPrimary "Voth Medic" $$ ptSetSecondary "Voth Spec Ops"
    //
    // -- Not sure why one would do this, but these can be bound to keys
    //
    //    X "ptSetPrimary "Voth Medic""
    //    /bind X "ptSetPrimary "Voth Medic""
    //
    // -- -------------------------------------------------------------------------
    // -- "Automatically" using Initialization Commands
    // -- -------------------------------------------------------------------------
    // --
    // -- Automatically set player-defined Primary and Secondary targets using a
    // -- custom one word command.
    // --
    // -- 1. Copy this line and add it to the Initialization Commands list at the
    // -- top of the code section
    //
    //    alias CommandName <& ptSetPrimary "" $$ ptSetSecondary "" &>
    //
    // -- 2. Insert the desired Primary and Secondary target names between the
    // -- quotes, ex:  "Ravager"
    // --
    // -- 3. Change    CommandName    to something that makes sense to you.
    // -- (Duplicate command names are allowed, but only the last one in the list
    // -- will be executed.)
    // --
    // -- 4. Execute the command from the command line or using a key bind, ex:
    //
    //    /ptBugHunt
    //    X "ptInitTacDrones"
    //    /bind X "ptInitVoth"
    //
    // -- -------------------------------------------------------------------------
    // -- Emergency Target Override
    // -- -------------------------------------------------------------------------
    // --
    // -- Activate Emergency Override using the current target:
    // --
    // -- - Primary and Secondary Priority targeting is disabled, and the current
    // -- target is set as the only Priority Target.
    // --
    // -- - This is an emergency measure used to focus on a single target
    // -- exclusively. Priority Targeting overrides normal target focusing or
    // -- pinning.  This effectively instantly reverses that behavior.
    // --
    // -- - Normal Priority Targeting can be re-enabled by either resetting the
    // -- Primary and/or Secondary targets, or by turning Priority Targeting back
    // -- on using the commands listed in the section below titled,
    // -- "Turn on Priority Targeting"
    //
    //    /ptOverride
    //
    //    X "ptOverride"
    //
    //    /bind X "ptOverride"
    //
    // -- -------------------------------------------------------------------------
    //
    //
    // == =========================================================================
    // == = Showing Assigned Targets ==============================================
    // == =========================================================================
    //
    // -- Shows the currently assigned Primary target, Secondary target, or both
    // -- in a speech bubble over the character's head
    // --
    // -- - ":None" is shown if there is no target set or Priority Targeting is off
    // --
    // -- - ":Override" is shown if an Emergency Override target has been set
    //
    //    /ptShowPrimary
    //    /ptShowSecondary
    //    /ptShowTargets
    //    
    //    X "ptShowPrimary"
    //    Y "ptShowPrimary $$ ptShowSecondary"
    //
    //    /bind X "ptShowTargets"
    //
    // -- ------------------------------------------------------------------------
    //
    //
    // == =========================================================================
    // == = Activating / Deactivating Priority Targeting ==========================
    // == =========================================================================
    // --
    // -- -------------------------------------------------------------------------
    // -- Turn off Priority Targeting
    // -- -------------------------------------------------------------------------
    // --
    // -- Disables Primary targeting, Secondary targeting, or both
    //
    //    /ptPrimaryOff
    //    /ptSecondaryOff
    //    /ptOff
    //    /ptPrimaryOff $$ ptSecondaryOff
    //
    //    X "ptPrimaryOff"
    //    Y "ptPrimaryOff $$ ptSecondaryOff"
    //
    //    /bind X "ptOff"
    //
    // -- -------------------------------------------------------------------------
    // -- Turn on Priority Targeting
    // -- -------------------------------------------------------------------------
    // --
    // -- Enables Primary targeting, Secondary targeting, or both
    //
    //    /ptPrimaryOn
    //    /ptSecondaryOn
    //    /ptOn
    //    /ptPrimaryOn $$ ptSecondaryOn
    //
    //    X "ptPrimaryOn"
    //    Y "ptPrimaryOn $$ ptSecondaryOn"
    //
    //    /bind X "ptOn"
    //
    // -- -------------------------------------------------------------------------
    //
    //
    // == =========================================================================
    // == = Engage (Scan for a Priority Target) ===================================
    // == =========================================================================
    // --
    // -- Actively search for a Priority Target and set Focus on it if found
    // --
    // -- - Can be set to its own key bind for manual activiation
    //
    //    Ctrl-Tab "ptSelectPriorityTarget"
    //
    // -- - It can also be included in a string of other commands
    // --
    // -- - Multiple targeting commands in the same chain are executed in order
    // -- from left to right, so the last one has the highest priority. The
    // -- Priority Target selection command should almost always be last in the
    // -- list unless there is a speciffic reason something should supercede it.
    //
    //    1 "Target_Enemy_Next $$ ptSelectPriorityTarget $$ +TrayExecByTrayWithBackup 0 0 0 1"
    //    2 "Target_Enemy_Next_Exposed $$  PetCommands_SetAllToOwnerAttackTarget $$ ptSelectPriorityTarget $$  +TrayExecByTrayWithBackup 0 1 0 0"
    //    X "ptSelectPriorityTarget && say "-=[ $target detected ]=-  Focus fire!""
    //
    // -- -------------------------------------------------------------------------
    
    
    // ** ***************************************************************************
    // **  Here there be code
    // ** ***************************************************************************
    
    // -- - Initialization Commands --------------------//
    alias ptInitVoth <& ptSetPrimary "Voth Medic" $$ ptSetSecondary "Voth Spec Ops" &>
    alias ptInitTacDrones <& ptSetPrimary "Elite Tactical Drone" $$ ptSetSecondary "Heavy Tactical Drone" &>
    alias ptEffThralls <& ptSetPrimary "Thrall" && ptSetSecondary "Brute" &>
    alias ptBugHunt <& ptSetPrimary "Pestilent" && ptSetSecondary "Ravager" &>
    // -- - End Initialization Commands --------------------- //
    
    // !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // !!
    // !!  Changes should not be made beyond this point without good reason.
    // !!
    // !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
    // -- Initialize targeting aliases -- //
    // -- Set primary and secondary to nothing to start with -- //
    alias ptTargetPrimary <& Focus ":None" &>
    alias ptTargetSecondary <& Focus ":None" &>
    
    // -- Define the commands to clear the target list -- //
    // -- These command names may be bound to keys or run from the command line
    alias ptClearPrimaryTarget <& ptSetPrimaryTarget ":None" &>
    alias ptClearSecondaryTarget <& ptSetSecondaryTarget ":None" &>
    // -- Make a couple of commands to echo the names of the assigned targets back to us -- //
    alias ptShowPrimaryTarget <& playersay " primary target: None" &>
    alias ptShowSecondaryTarget <& playersay " secondary target: None" &>
    alias ptShowTargets "ptShowPrimaryTarget $$ ptShowSecondaryTarget"
    // -- The commands to build the targeting string and its backup are done at the same time whenever a new primary -- //
    // -- or secondary are assigned -- //
    alias ptSetPrimary <& ptSetPrimaryTarget "{}" $$ ptSetPrimaryBackup "{}" &>
    alias ptSetSecondary <& ptSetSecondaryTarget "{}" $$ ptSetSecondaryBackup "{}" &>
    
    
    // -- Construct and then execute the targeting aliases -- //
    alias ptSetPrimaryTarget <& alias ptTargetPrimary "Focus "{}"" $$  ptSetShowPrimaryTarget "{}" $$ ptTargetPrimary &>
    alias ptSetSecondaryTarget <& alias ptTargetSecondary "Focus  "{}"" $$ ptSetShowSecondaryTarget "{}" $$ ptTargetSecondary &>
    alias ptSetShowPrimaryTarget <& alias ptShowPrimaryTarget  "playersay " primary target: {}"" $$ ptShowPrimaryTarget &>
    alias ptSetShowSecondaryTarget <& alias ptShowSecondaryTarget  "playersay " secondary target: {}"" $$ ptShowSecondaryTarget &>
    alias ptOverride <& Focus "" $$ ptSetShowPrimaryTarget  ":Override" $$ ptSetShowSecondaryTarget ":Override" $$ ptPrimaryOff $$  ptSecondaryOff &>
    
    
    // -- Priority Order -- //
    // -- It may seem odd, but each target selection overrides the previous,  so it is correct to select the primary target second. -- //
    // -- Remember there is no way to know when or if we find a match, so we have to look for them all to make sure the most -- //
    // -- important one comes out on top. -- //
    alias ptSelectPriorityTarget "ptTargetSecondary $$ ptTargetPrimary $$ FocusTargetSelect"
    
    
    // -- Maintenance -- //
    // -- A cople of shorthand aliases -- //
    alias ptPrimaryOn "ptRestorePrimaryTarget"
    alias ptSecondaryOn "ptRestoreSecondaryTarget"
    alias ptOn "ptRestorePrimaryTarget $$ ptRestoreSecondaryTarget"
    
    
    // -- This builds the commands to restore targets after an emergency override. -- //
    alias ptSetPrimaryBackup <& alias ptRestorePrimaryTarget "ptSetPrimaryTarget "{}"" &>
    alias ptSetSecondaryBackup <& alias ptRestoreSecondaryTarget "ptSetSecondaryTarget "{}"" &>
    
    
    // -- Clear Priority Targets -- //
    alias ptPrimaryOff "ptClearPrimaryTarget"
    alias ptSecondaryOff "ptClearSecondaryTarget"
    alias ptOff "ptClearPrimaryTarget && ptClearSecondaryTarget"
    Kickkat
    I will show it to you, this one thing covered in glory.
    [ Priority Targeting System + source code ][ More key bind examples and tutorials ]