Jump to content
Gunter Severloh

ETS - Enemy Tagging System

Recommended Posts

41 minutes ago, hortzy said:

I wanted to add a nice level of customization so it could used in multiple game types

Mission successful my friend!

 

42 minutes ago, hortzy said:

One thing I do plan on updating is the 'Show behind cover' feature.

Currently its working ok.. it detects if objects are in the way, but its not recognizing terrain features. So a hill will not effect the status of an icon.

Once I get that fixed.. I will be pretty happy with how this turned out 🙂 

 

I can help you with that! Give me an hour until I get home.

  • Thanks 1

Share this post


Link to post
Share on other sites
4 minutes ago, LSValmont said:

I can help you with that! Give me an hour until I get home.

 

Thanks, I will send you a friend request on steam if that's cool

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, hortzy said:

 

Thanks, I will send you a friend request on steam if that's cool

 

Sure thing! My pleasure

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, hortzy said:

One thing I do plan on updating is the 'Show behind cover' feature.

Currently its working ok.. it detects if objects are in the way, but its not recognizing terrain features. So a hill will not effect the status of an icon.

Once I get that fixed.. I will be pretty happy with how this turned out 🙂 

 

I use checkVisibility for my name tags and terrain and even grass hides it (I believe).

_isVisible = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos _x];
if (_isVisible > 0) then {// Code to show the tags};

Here is my full script:

 

Spoiler

 


// run from initPlayerLocal.sqf

//Add 3d Compass && NameTag
vCompass = {
	addMissionEventHandler [ "EachFrame", {

		if (alive player && "ItemCompass" in (assignedItems player)) then {

		 _infrontDistance = 1; 
		 _compassRadius = 0.25; 
		  
		 _cameraPos = AGLToASL positionCameraToWorld [ 0, -0.5, 0 ]; 
		 _compassCenter = _cameraPos vectorAdd ( getCameraViewDirection player vectorMultiply _infrontDistance ); 
		   
		 {
		  _x params[ "_text", "_dir", "_size", "_color" ]; 
		   
		  AGLToASL( _compassCenter getPos[ _compassRadius, _dir ] ) params[ "_offsetX", "_offsetY" ]; 
		   
		  _offsetPos = ASLToAGL[ _offsetX, _offsetY, _compassCenter select 2 ]; 
			 
		  drawIcon3D[ 
		   "", 
		   _color, 
		   _offsetPos, 
		   1, 
		   1,
		   0, 
		   _text, 
		   0, 
		   _size, 
		   "PuristaMedium", 
		   "center", 
		   false 
		  ]; 
		  
		  if (_x select 3 isEqualTo [1,1,1,1]) then {
			drawLine3D[ ASLToAGL _compassCenter, _offsetPos, [ 1, 1, 1, 0.2 ] ];
		  };
		  
		 } forEach [ 
		  [ "N", 0, 0.07, [1,1,1,1] ],
		  [ "ne", 45, 0.05, [1,1,1,0.5] ],
		  [ "E", 90, 0.07, [1,1,1,1] ],
		  [ "se", 135, 0.05, [1,1,1,0.5] ],  
		  [ "S", 180, 0.07, [1,1,1,1] ],
		  [ "sw", 225, 0.05, [1,1,1,0.5] ],
		  [ "W", 270, 0.07, [1,1,1,1] ], 
		  [ "nw", 315, 0.05, [1,1,1,0.5] ]
		 ];
		 
		};
		
    {
	_isVisible = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos _x];
        if (side _x isEqualTo side group player && {alive _x} && (_isVisible > 0) && (_x distance player < 500)) then {
            _dist = (player distance _x) / 15;
            _color = getArray (configFile/'CfgInGameUI'/'SideColors'/'colorFriendly');
			//_color = [1,1,1,1];
            if (cursorTarget != _x) then {
                _color set [3, 1 - (_dist/2)]
            };
            drawIcon3D [
                '',
                _color,
                [
                    visiblePosition _x select 0,
                    visiblePosition _x select 1,
                    (visiblePosition _x select 2) +
                    ((_x modelToWorldVisual (
                        _x selectionPosition 'head'
                    )) select 2) + 0.28 + _dist / 4.5
                ],
                0,
                0,
                0,
                name _x,
                2,
                0.033,
                'PuristaMedium'
            ];
        };
    } count playableUnits - [player];
	 
	}];
};

[player] call vCompass;

 

It adds a dynamic onscreen compass on the bottom of the player (if they have a compass) and also adds name tags on friends when close or aiming at them.

 

Works well and it is fast!

 

Perhaps this could solve your problem or aim you towards the right direction.

  • Like 3

Share this post


Link to post
Share on other sites

@LSValmont

Nice! I really appreciate it man, Didn't even know that scripting command existed 😂

And here i was trying to manually calculate those conditions. derp

 

Your script there is pretty cool, I really like that onscreen compass.

 

Done a little testing with _isVisible = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos _target];

Works great! but I did notice a small issue. Vehicles seem to throw random values at times, and also return a value of 0 on occasions. (Even while fully in sight)

 

Workaround.

_isVisible = [_target, "VIEW"] checkVisibility [eyePos player, eyePos _target];

 

Pass the _target into the ignored object parameter, and the value will return a more reliable number for both units and vehicles.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, hortzy said:

@LSValmont

Nice! I really appreciate it man, Didn't even know that scripting command existed 😂

And here i was trying to manually calculate those conditions. derp

 

Your script there is pretty cool, I really like that onscreen compass.

 

Done a little testing with _isVisible = [objNull, "VIEW"] checkVisibility [eyePos player, eyePos _target];

Works great! but I did notice a small issue. Vehicles seem to throw random values at times, and also return a value of 0 on occasions. (Even while fully in sight)

 

Workaround.

_isVisible = [_target, "VIEW"] checkVisibility [eyePos player, eyePos _target];

 

Pass the _target into the ignored object parameter, and the value will return a more reliable number for both units and vehicles.

 

Glad it helped such a noble endeavor as yours!

 

And thank you on the heads up! I was using checkVisibility only on playableUnits so never tried it on vehicles but now if I ever want to add a tag to a vehicle I will just use your tweaked version!

 

Yeah I was about to tell you that with checkVisibility you might not require many other checks/conditions as it seems quite complete already.

 

If you ever run into a wall or a dead end just trow your issue here and we will jump in to help 😉 

  • Thanks 1

Share this post


Link to post
Share on other sites

Update: 18 Apr @ 4:02am

  • -Require optics now supports UAV's and Vehicles/Planes
  • -Removed 'Required Weapons' feature. (Everything is covered by Require Optics now).
  • -Fixed tags not appearing for pilots. (Note: You must be in a group to see each others tags)
  • -Targets visible by player owned UAV's will remain tagged for the duration of the icon.
  • - Show behind cover now works as intended.

Terrain features (hills), objects, foliage all effect the status of icons.
Condition was replaced by engine command 'checkVisibility'

Thanks to @LSValmont for his help/advice!

 

I think I am ready to pretty much call this a final release.

Aside from any bugs that may pop up, Or game updates that cause conflicts. I don't really see much more that needs to be done.

I would like to thank everyone for their support in making this mod! 🙂

This is my first time really diving in and experiencing the bohemia forums, and I am extremely grateful for all of your support!

So again.. Thank you everyone!

 

Here is the new condition code mentioned above.

If it helps anyone out, I am happy to share it.

/*
	Author: Hortzy
	Function: HZ_fnc_ET_targetOnScreen
	Version: 1.0
	Date: 4/18/2020
	
	Description:
	Checks if target is behind cover/visible on screen. (Providing _showBehindCover is set to false)
	Works underwater.
	Supports vehicles.
	Also checks if any uavs owned by the player can see the target.

	Parameters:
	_unit = _this;

	Returns:
	true if target is visible, false if target is hidden. 
*/
private _unit = _this;
private _showBehindCover = false;
private _return = false;
if (!isNil "HZ_ETS_Settings") then {_showBehindCover = HZ_ETS_Settings select 2;};
private _player = player;
private _uav = getConnectedUAV player;
if (vehicle player != player) then 
{
	_player = vehicle player;
};
if (!isNull _uav) then 
{
	private _uavControl = UAVControl _uav;
	if (player in _uavControl) then {_player = _uav;};
};
if (vehicle _unit != _unit) then {_unit = vehicle _unit;};
private _cansee = [player,"VIEW",_unit] checkVisibility [eyePos player, eyePos _unit];
private _cansee_variable = [_player,"VIEW",_unit] checkVisibility [eyePos _player, eyePos _unit];

if (_showBehindCover) then {_return = true;};
if (!_showBehindCover && ((_cansee > 0) OR (_cansee_variable > 0)))  then {_return = true;};

_return

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 4/18/2020 at 4:47 AM, hortzy said:

Update: 18 Apr @ 4:02am

  • -Require optics now supports UAV's and Vehicles/Planes
  • -Removed 'Required Weapons' feature. (Everything is covered by Require Optics now).
  • -Fixed tags not appearing for pilots. (Note: You must be in a group to see each others tags)
  • -Targets visible by player owned UAV's will remain tagged for the duration of the icon.
  • - Show behind cover now works as intended.

Terrain features (hills), objects, foliage all effect the status of icons.
Condition was replaced by engine command 'checkVisibility'

Thanks to @LSValmont for his help/advice!

 

I think I am ready to pretty much call this a final release.

Aside from any bugs that may pop up, Or game updates that cause conflicts. I don't really see much more that needs to be done.

I would like to thank everyone for their support in making this mod! 🙂

This is my first time really diving in and experiencing the bohemia forums, and I am extremely grateful for all of your support!

So again.. Thank you everyone!

 

Here is the new condition code mentioned above.

If it helps anyone out, I am happy to share it.

 

Very neat and clean code, thank you @hortzy and also for the mention.

 

I might have found a small bug that could be easily fixed.

 

If you tag a enemy unit while you are incapacitated/captive then the tag will be a friendly tag (green) instead of (red).

 

That happens because when you are captive your side becomes civilian.

 

The solution is simple, instead of using:

side player;

use:

side group player;

The side of your group is always on the original side (does not change to civilian when you are captive).

 

With that small fix the mod is pretty much done (and amazing!)

  • Like 1

Share this post


Link to post
Share on other sites

@LSValmont

I will also keep that in mind for future scripts, very useful information!

Should probably see that update pushed out at some point today.

Thanks again!

:yay:

 

One quick edit.

I might have not explained this when the features got introduced.

 

_unit setVariable ["ETS_TEXT","SomeText",true]; //Sets text below a units icon. (optional)

_unit setVariable ["ETS_FONT","TahomaB",true]; //Sets the font of the text. (optional)

 

Those variables can be set on ANY unit within the game, they are not bound to the HVT variable.

So, you can essentially use this system for player icons with names.

Or use it to create dynamic text on units within a mission. (eg. "Escort","Protect") are just a couple examples.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, hortzy said:

One quick edit.

I might have not explained this when the features got introduced.

 

_unit setVariable ["ETS_TEXT","SomeText",true]; //Sets text below a units icon. (optional)

_unit setVariable ["ETS_FONT","TahomaB",true]; //Sets the font of the text. (optional)

 

Those variables can be set on ANY unit within the game, they are not bound to the HVT variable.

So, you can essentially use this system for player icons with names.

Or use it to create dynamic text on units within a mission. (eg. "Escort","Protect") are just a couple examples.

 

Hey, that is extremely useful for mission making!

Specially coop missions!

Great feature, thank you for the heads up!

 

By the way, just to give you some inspiration if you find the time for future development, I have always found quite amazing the identification system that the MERCS mission uses:

 

After identifying a unit with a vision enhancing tool and if you are wearing A3's tactical glasses you get additional information on the enemy as a small UI on the right showing you the Ai's:

1) Name

2) Rank

3) Group

4) Weapon

5) Health status

6) Distance

 

It is extremely cool!

  • Like 2

Share this post


Link to post
Share on other sites

ETS could greatly improve singleplayer if AI team mates could tag the enemy too. Because the AI is naturally not good at communicating and pointing out enemy locations ETS could make up for that.

  • Like 1

Share this post


Link to post
Share on other sites

An interesting thought kibyde, i think for that to work Hortzy would have to look into how the AI identify, target and callout targets and or enemy.

1 hour ago, kibyde said:

Because the AI is naturally not good at communicating and pointing out enemy locations ETS could make up for that.

Thats counterintuitive to what ETS is, as you do know ETS has nothing to do with AI, but in general as you said being that AI is naturally not good at

communicating and pointing out enemy locations then ETS would fail on their lack.

     Whatever ETS did make up for would only be the targets that the AI did see, then missing some if that were the actual case.

 

ETS can only make up for the lack if there is one from the AI standpoint if Hortzy increased the capacity for AI to spot targets, so their spotting distance,

and how long it takes them to identify targets would have to be increased, which in general regardless of using ETS would substantially make combat against them harder,

unless of course you had those abilities increased only for the side your on and or group your in, from there Hortzy would need to code it so that the AI aspect of ETS

is only being used on the side of the player.    

 

So for example:     if side (faction)= player's side then ETS AI spotting enhanced,

but only for the sake of spotting, because if and when the AI start easily start spotting targets then their skill must remain as the player has them

set under difficulty or by script through the mission, or it becomes unbalanced and one sided.

 

      However AI do communicate, they will identify every target regardless of the side see my AIFacts & Myths Compilation linked in my sig, and go to the

AI Detection: Communications part and read whats there.   Dont forget the AI Detection: Visibility too, they both play in the same part.

It will show you AI do communicate and very well, its just they have to actually see a target which is based on their ability/level to spot the target.

        As we all know that everything in Arma3 is customizable, whatever lack the AI is doing is not really a lack but rather the level at which they are set at, lacking to communicate is like saying the

AI cannot improve or fail to learn to get better or be better at that ability to spot and communicate, its not set in stone, their not living organisms like us humans we

have to program them, and that you can do through mods, script and using the difficulty settings.

 

Nontheless good idea overall, lets see what Hortzy thinks when he gets on. Cheers!

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, kibyde said:

ETS could greatly improve singleplayer if AI team mates could tag the enemy too. Because the AI is naturally not good at communicating and pointing out enemy locations ETS could make up for that.

 

There is already an engine option to enable that.

 

Right now is only working when an Ai is the team leader of your squad but I believe with a script command (https://community.bistudio.com/wiki/doTarget) you can enable it for all Ai, so there is no need for a mod to do that.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, kibyde said:

ETS could greatly improve singleplayer if AI team mates could tag the enemy too. Because the AI is naturally not good at communicating and pointing out enemy locations ETS could make up for that.

@kibyde

Thanks for the suggestion, That is a feature we did think about implementing..

However, Its kind of beside the point of what ETS is supposed to be.

We designed ETS so that it could be a lightweight yet modular system for multiple game styles.

 

Adding this feature, would require me to add in a couple more conditions and checks to enable AI to tag enemies.

And for performance reasons, I think this feature would have to be strictly limited to single player.

 

We will keep this in mind, and run some tests.

But cannot confirm if that feature will be implemented.

  • Like 1

Share this post


Link to post
Share on other sites

@LSValmont

Pretty cool video.

I like the idea, But i'm not quite sure how i would implement something like that.

I mean, ya i can script that in, but to do it, and do it tastefully without ruining a players experience with a bunch of onscreen dialog's might be an issue.

 

Overall a really cool feature tho.

Thanks for sharing, I will for sure keep that in mind for future development!

  • Like 1

Share this post


Link to post
Share on other sites

Update: 20 Apr @ 9:40pm

-Added ability to choose between groups or side for Tag visibility.
-Updated Module and Settings Dialog.
-Fixed Enemies showing as Friendly when a player was in an Incapacitated State.

 

Again a thanks to @LSValmont for reporting the issue and providing a solution!

 

Note:

The ability to choose between groups and sides, should tremendously help in cases when players aren't grouped up together. Or don't have the ability to create a group.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

Question if anybody could help me out.

Maybe @LSValmont?? 😄

 

When loading from a "Saved" game, such as Arma 3 Apex Oldman

Does the Initialization order still take effect that is listed here?

https://community.bistudio.com/wiki/Initialization_Order

 

Because it appears that when loading into a Oldman save. The mod is using outdated scripts or something.

Restarting a new campaign and or a different mission file within a campaign fixes it. (But oldman only uses 1 mission file)

 

If I use the "Loaded" eventhandler in my preinit function, can I use that to update the variables within a saved game? or is the function "pre-cached" so to speak and the only way to update it is by restarting?

 

Where i'm getting confused.. is right now my preinit function does not have a "loaded" eventhandler.

And i'm unsure if by adding it in the function, if it will get updated within that particular savefile.

 

I hope that makes sense.. haha

Thanks in advance to anyone who can help!

 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, hortzy said:

Question if anybody could help me out.

Maybe @LSValmont?? 😄

 

When loading from a "Saved" game, such as Arma 3 Apex Oldman

Does the Initialization order still take effect that is listed here?

https://community.bistudio.com/wiki/Initialization_Order

 

Because it appears that when loading into a Oldman save. The mod is using outdated scripts or something.

Restarting a new campaign and or a different mission file within a campaign fixes it. (But oldman only uses 1 mission file)

 

If I use the "Loaded" eventhandler in my preinit function, can I use that to update the variables within a saved game? or is the function "pre-cached" so to speak and the only way to update it is by restarting?

 

Where i'm getting confused.. is right now my preinit function does not have a "loaded" eventhandler.

And i'm unsure if by adding it in the function, if it will get updated within that particular savefile.

 

I hope that makes sense.. haha

Thanks in advance to anyone who can help!

 

 

I have been trying, without success, for A3's default save system to work fine with my mods and scripts without much success for the last couple years.

 

It is incredibly messy from my perspective and it only got worst with OLD MAN but perhaps one of the more veteran guys here will be able to help you.

 

I really hope so because your contributions to the Armaverse have been quite exciting and popular.

 

PS: In a perfect world I think there would have to be a significant code rewrite for the save system for it to be mods and multiplayer friendly.

  • Like 1

Share this post


Link to post
Share on other sites

Well I am glad to see i'm not the only one having issues with that then haha

I'll continue experimenting and see if I find a solution.

 

Thanks @LSValmont

I really appreciate your input through-out the development of this mod!

  • Like 1

Share this post


Link to post
Share on other sites

Update

  • Added Dedicated Servers - ETS Configuration information in a spoiler on the OP.
  • Updated the features list to list same features as on the workshop.

Another note for those of you wanting to know what was updated, fixed or changed, the changelog

on the OP bottom of the page has all the updates, and is current.

  • Like 4

Share this post


Link to post
Share on other sites

I did a ghost recon wildlands inspired drone system for a ravage mission of mine ages ago, funny how someone else did a feature inspired by that game, great minds think alike 😉

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
1 hour ago, Slay No More said:

drone system for a ravage mission of mine ages ago,

Nice! Dont recall seeing it, is it on the workshop?

  • Like 2

Share this post


Link to post
Share on other sites
22 hours ago, Gunter Severloh said:

Nice! Dont recall seeing it, is it on the workshop?

It is indeed! It is on the workshop, it was very under the radar and easily missable, I may release those things on there own just so they aren't forgotten. I don't want to shamelessly plug myself but because you asked here you go, it's an honor to have you take a look at it, maybe someone like yourself can see it, get the idea I was going for and give it some proper justice. 
https://steamcommunity.com/sharedfiles/filedetails/?id=1982286715

To get to the drone, once in game use the scroll menu called "Menu"-> "Open Drones Menu" -> "Deploy UAV", then you can see a few different style drones I did.
Please excuse the bad UI design, I'm looking for someone to help me revamp the entire Menu interface in favor of something that doesn't feel like a early 2000's games main menu interface, I'm extremely embarrassed by the lack of quality GUI in the mission, limited only by my own limitations. 

  • Like 1

Share this post


Link to post
Share on other sites

So your drone function is in a script in the mission i presume?

Should ask Horstzy if hes interested he could extract it and turn it into a mod if you wanted, of course ask him first but he has some great skill.

  • Like 1

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

×