FreeSpace Releases > Scripting Releases

Subsystem Hotkey Script

<< < (2/2)

MadProf:
Well the zip file in the first post now has the retargeting issue fixed.

Now have two problems trying to get boxes drawn around the subsystems
1) This is the big one - I can't seem to figure out the correct world coordinates of the subsystem, have tried adding subsystem:Position and subsystem:GunPosition to the ship:Position without luck.  Maybe somebody else can point me in the correct direction for this
2) drawTargetingBrackets doesn't like subsystems - can be emulated to a point with the other drawing functions so only a minor one.

T-Man:
Mr MadProf i officially want your babies. :lol: Thanks a lot for putting this together; it's a feature i've been hoping for for ages.

m!m:
@MadProf
You need to adjust the position according to the ships orientation. This can be done using something like this:

--- Code: ---ship.Position + ship.Orientation:unrotateVector(subsystem.Position)
--- End code ---
This will result in the world position of the subsystem.

MadProf:
Thanks m!m, that was the step I was missing. :yes:

The zip file in the first post now also draws a small white box around the subsystems in the list that aren't the players current target, and aren't at 0%.
The size of the box is controlled via the halfsubsystemdirecboxsize variable near the top of SubsysHotKeysMain-sct.tbm file, alter the value to make it larger or smaller as you wish.

MadProf:
Arrgh! Updated the script as I found a silly bug in it. If a ship had multiple subsystems which display the same name in the HUD, it thought they where the same subsystem...

The zip in the first post contains the latest version.

Navigation

[0] Message Index

[*] Previous page

Go to full version