Jump to content
Sign in to follow this  
tcp

TCP Laser Rangefinder v04

Recommended Posts

TCP_RF Client Addon v07 20091211

Requires: CBA

Examples from NWD_Rangefinder by NonWonderDog, Digital Compass by ffs, Mando Missile by Mandoble, and gdtmod_binocular by Heinbloed

Laser Rangefinder is a remake of NWD_Rangefinder.

It works with or without NWD optics model (31st MEU reticle pack).

Features:

Range, Azimuth, and Elevation output

Indicators for Battery, Laser active/transmitting, Overheat, and Mutiple Laser Targets detected

Battery life and overheat conditions exist and are configurable

Instructions:

Check userconfig\TCP_RF\TCP_RF.hpp for preferences.

XMIT (Laser active) will indicate when the laser is on. MLT (Multiple Laser Targets) will indicate when any other lasers besides your own are detected.

BAT (Battery) will start green and become red at 2/3 life. It will start to fade as battery level decreases. It will start flashing when below 1/4 life.

Battery is "loaded" into display so that it doesn't take up space. You can carry spares if needed. You can force a battery change at any time with Ctrl+Alt+Shift R (by default).

HOT (Overheat) will light up when it reaches the preset overheat temperature. It will become brighter as it increases to critical (maxm) temperature.

It start flashing when its very near critical temperature. There is a chance of burnout when you go above critical temperature.

Use Alt-R (by default) to cycle between different Mil measurements as well as degrees.

Many thanks to the original addon makers as this is simply a recoding of their work, most of it borrowed.

For Mission Makers:

To enforce your own battery and overheat conditions, copy TCP_enfRF.sqf to your mission folder.

Put this at the end of init.sqf:

[] spawn {execVM "TCPenfRF.sqf";};

v07 Changelog

- Fixed incompatibility due to set instead of add display event handler

v06 Changelog

- Cycle between Mil measurements

- Ctrl+Alt+Shift+R forces battery changes, optionally w/o designator active

- More responsive, code rewritten

- State changes fixed, shuts off when in third person, or moving

- Display turns on with laser, and Laser turns off with display (enforces battery and overheat conditions)

v05 Changelog

- Mapped to customizable key

- Overheat and battery levels

v04 Changelog

- Fixed interface scaling regardless of resolution / interface size

- Added Azimut, Elevation, and indicator lights

- Action only visible when using Designator

v03 Changelog

- Converted to addon

- Copied NWD textures/dialogs

- Created player action (always visible)

v02 Changelog

- using positionCameratoWorld as recommended by Mandoble

- smoother, but still need to use Shift + Move (Walk Forward) if it shuts off.

v01 Changelog:

- borrowed animations from gdtmod_binocular by Heinbloed

- borrowed laser finding from mando missile by Mandoble

- animation detection not reliable but works

Requires:

CBA

Download:

http://www.mediafire.com/file/ewnzmzqdlny/@TCP_RFv07.7z

Screenshot:

Eh89Jl.jpg

Edited by tcp

Share this post


Link to post
Share on other sites

Excellent mate really like it, makes ops alot easier. Thanks for the effort

Share this post


Link to post
Share on other sites

Bloody great mod dude, Thanks a bunch!

I wish BIS got rid of the Space bar range finder....

:j::j::j::j:

Share this post


Link to post
Share on other sites

Thanks once again tcp.

A few suggestions:

  • If you use an UA, add a sleep of one sec or more. No idea what the standard frequency is, yet probably way too high here.
  • Please avoid using UA. It will break all other UA used on the infantry class. There is no inheritance and no way of extending an UA class unfortunately.
  • Instead use a key action to call it. Either use like reload or the custom keys: arma2profile: keyUser1[]={17};

Share this post


Link to post
Share on other sites

Thanks for the advice kju. I didn't know if the condition would accept a sleep. I'll work on making it a keyaction, which I didn't even know about when I was trying to figure out how to make it only appear for the laser designator.

Share this post


Link to post
Share on other sites

Actually you are correct of course. Sorry :)

Share this post


Link to post
Share on other sites

Well, in the condition I used call compile loadFile containing multiple if statements. Within the call I couldn't spawn or execVM, so I assumed trying to mess with it further would cause problems. However, I think you're right about the condition being very high or even every frame, because when RPT errors occurred, I had pages of errors after only a few seconds.

Do you, by chance, know if I can take over a reloadAction in the laserdesignator config since its not used or do I have to use extended eventhandlers. I don't actually know the normal method for adding key actions.

The following is from weapons config:

class RscTitles {
class binocular {
	idd = -1;
	movingEnable = 0;
	duration = 1000;
	name = "binocular";

	class objects {
		class binocular : RscObject {
			model = "\ca\Weapons\optika_dalekohled.p3d";
			idc = -1;
			position[] = {0, 0, 0.053};
			direction[] = {sin 0, sin 180 * cos 0, cos 180 * cos 0};
			up[] = {0, cos 180, -sin 180};
		};
	};
};
};

I think this is the dialog used when viewing through the binocular classes. Maybe I could manipulate this to add keys somehow.

Edited by tcp

Share this post


Link to post
Share on other sites

Add DEH to standard display:

GDTModHDRKeypressedcode = compile preprocessFile "\gdtmod_hdr\key.sqf";
_GDTModHDRKeypressed = (findDisplay 46) displayAddEventHandler ["KeyUp","_this call GDTModHDRKeypressedcode"];};

key.sqf

if ((_this select 1) == gdtmod_hdr_key) then
{
//do sth
};

// gdtmod_hdr_key to be the key ID of reload

http://community.bistudio.com/wiki/displaySetEventHandler

Share this post


Link to post
Share on other sites

Sweet! Definitely better than the default one! :P

Thanks

Edited by ffs

Share this post


Link to post
Share on other sites

The next version will have an overheat indicator and require intermittent cool down periods. You can ignore the indicator and eventually it will be locked into an extended cool down period. The display will be activated by custom "reload" key (default R when designator in use). Instead of using up a ammo slot for a battery, you can load batteries meaning they will be taken out of your inventory and handled by the script. It will load batteries when you use the designator if the old batteries are dead or not loaded yet. If you come across more batteries (that you don't want to carry) or respawn at base with some, you can also force a battery change (losing the remaining power on the old battery) using Alt-R (by default, usable even without designator selected).

Share this post


Link to post
Share on other sites

Yes again another "keeper" :)

Now all we need is the same for the the javelin

(skip to 55 mins).

Share this post


Link to post
Share on other sites

Maybe when Mando Missile is out of testing, it could be adapted for the javelin.

Share this post


Link to post
Share on other sites

Guys,

This is probably a very numbty question, but how do you get this to work:eek:

Share this post


Link to post
Share on other sites

v05 Changelog

- Mapped to customizable key

- Overheat and battery levels

Share this post


Link to post
Share on other sites

Nice one m8, definatly a must have. I just have two quick questions:-

1. The Userconfig folder, is this supposed to be in the MOD folder? Or is it correct to put in the main directory. JDT smoke config for example is in userconfig in the main directory.

2. Is there anyway to get rid of the delay with the digit overlay when switching back to your weapon? At the moment it is displayed for a good second after you switch (not a major thing i know, but it all helps).

Once again thought, great addition to the game.

Share this post


Link to post
Share on other sites

Yes, you have to have userconfig in the main directory, but most people know that or will figure it out when the game gives them an error. Although I probably could have packed it in a more user-friendly way.

Regarding the delay, the game AFAIK doesn't support loading scripts with the model optics making it hard for addons to be streamlined. There's no way to terminate the script as soon as you exit. It depends on the condition to be checked for continuously and to save on performance I only run loops every second. If it is taking longer than a second, it could mean that the script is already heavy and may be performing badly. However, I assume you see the same delay as me, which still ends before you actually have your weapon out. It's a little annoying, but you could always turn off the display manually when you know you're done, and pretend you are saving battery life by not forgetting to turn it off :)

Although any features requests like this are welcome, in the next version I will make it an option to decrease delays and leave it to the user to decide the performance/responsive trade-off.

Edited by tcp

Share this post


Link to post
Share on other sites

Feature requests:

* Auto discard of batteries when used. Or replaced with a Laser Battery (used) that is not a real battery at all, just has the graphics.

* QRF setting switches, with values published in a global variable once you hit ok. Could be used in combination with Copperhead artillery system.

* Possibility to change angular readout mode via the reload button or something.

* Inclusion with ACE2 :)

Share this post


Link to post
Share on other sites

The digits display managed to pop up several times when I was playing as a Chedaki AA soldier, also I got a message saying "YOU DON'T HAVE ANYMORE BATTERIES" when I pressed alt+r at the same time. No, I didn't have a rangefinder in my gearmenu.

Using the very latest CBA released today and ofcourse v05 of your rangefinder.

Great work otherwise, I still can't understand why BIS didn't atleast include a very simplified rangefinder system, instead the vanilla rangefinder is more like "Laser binoculars".

Share this post


Link to post
Share on other sites

Thanks for this improvement!

Would be nice if the red dot/digit will be only red if laser is active, only green when ready/standby, yellow when battery are low/malfunction = clear visual status (feedback) from the device.

Share this post


Link to post
Share on other sites

My mistake with the Alt-R, I didn't think about people reloading while free-looking.

Although, I can't understand why the display would show since it's set to run only when your current weapon is a laser designator.

Share this post


Link to post
Share on other sites

REQ's:

* FLIR (ofcource there is no FLIR on the real GLTDII)

* Magnification: 10x or 8x (default: 5.25x) fixed: ~5x ~8x (kudos to NWD, scope)

Edited by ffs
q

Share this post


Link to post
Share on other sites

heh I don't care about realism that much, I'll just make it optional, but maybe there needs to be a lightweight and heavy version if too much is added to the script.

I think I can handle most of the feature requests, but does anyone have ideas on making a fake laser batteries magazine? If you can point out an example that can help. NonWonderDog had a fake laser on his TankFCS, so I'll have to check out what that's all about.

Also, is anyone able to duplicate the interface popping up when the laser designator is not selected (when you press R)? I'm rewriting the script a little to make it more responsive to state changes, but it's nice to know.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×