View Single Post
Thread: Targeting Coach
Targeting Coach
Overview
Script tracks speeds of all parts on the target's body, and paints a rating on the specified number of highest priority targets, based on speed and the individual part's damage multipliers, showing the best spots to aim for solid hits.

When damage multipliers aren't considered, ratings range from 0% to 100%, with 100% showing the slowest moving target on a body, and 0% showing the fastest. Values inbetween are rated on a scale relative to the slowest and fastest moving parts.

When damage multipliers are considered, the speed rating is multiplied by the damage multiplier for each respective body part. The head and neck have the highest multiplier (1), for example, so those targets are weighed most heavily. All other ratings are reduced on account of the part's damage multiplier.

Issues - Read me
The original version (targetingCoach.lua) uses the new_game event hook, which isn't supported in multiplayer in 2.6. For multiplayer support in 2.6, use targetingCoachHack.lua, which doesn't run as clean, but will work.

For either version to work, the draw3d event hook must also be enabled. The attached file, startup.lua, has the required changes. Simply replace startup.lua in your data/script folder.

Configuration Options

target - Which player to display targets for (0 for red, 1 for blue/Uke, 2 for both)

frameForecast - When targets are consolidated, option is available to show a forecasted position, based on average velocity over the number of targets, with gravity factored in. Specify as a Lua table of integers.

i.e.
{10, 25, 50, 70, 100}
This table will show forecasted positions at 10, 25, 50, 70 and 100 frames after the current frame.

Because average velocities are used, and because rotation is not considered, position forecast is unreliable for small sets of targets, but fairly reliable when all possible targets are used.

gravity - You may specify the acceleration due to gravity in the z axis (negative values are downward), which is used in the consolidated target forecast. Specify gravity in meters per second squared. Classic toribash defaults to -1.


Options Which may be Changed at Runtime

Controls Summary:
o
: toggle factor damage
+ : increases the target count by one
shift and + : increases the target count to max (41)
- : decreases the target count by one
shift and - : decreases the target count to min (1)
0 : resets the target count to default
m : toggle consolidation of targets


Options:

factorDamage - Toggled in-game by the 'o' key.
Option toggles the target prioritization model. Toggles between factoring only speed, with the slowest targets being the highest priority, and factoring damage multipliers in addition to speed (so head and groin, etc. are weighed more heavily)

consolidateTargets - Toggled in-game by the 'm' key.
Option toggles between labeling individual targets with their rating and taking an average position and labeling it with an 'X', in addition to showing the consolidated target position forecast.

numTargets - Adjustable via +, -, 0. See above.
Option sets the number of targets shown. The number of targets also affects the consolidated target, by changing how many points the average is based on.
Attached Files
targetingCoach.lua (9.5 KB, 932 views)
targetingCoachHack.lua (9.9 KB, 358 views)
startup.lua (1.4 KB, 337 views)
Last edited by Dafe; Jul 30, 2007 at 04:48 AM.