Page MenuHomeFeedback Tracker

A command to return vehicle turret laser targets
Closed, ResolvedPublic

Description

I'd like to request a new scripting command to return vehicle laser targets.

Right now there is just a single scripting command to return laser target: laserTarget, which only returns laser target for primary gunner, which is not sufficient for vehicles like Strider where commander has laser target while primary turret is driver, or any vehicle which might have two laser target sources.

Suggested scripted command to return laser target of specified turret:

<Entity> = <Vehicle> laserTarget <Turret>;

a command to return laser target for specified turret path. Another name could be laserTargetTurret to describe the command better.

Another useful addition would be making laser targets trigger Fired and FiredMan event handlers, because right now you have to execute laserTarget each frame to find out if laser target was fired or not.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

Steps to observe limited use of current laserTarget command:

  1. Start a mission with a player unit and empty Strider I_MRAP_03_F placed
  2. Get in commander seat of Strider and activate the laser
  3. Execute laserTarget vehicle player - laser isn't returned
Additional Information

Few other ideas include <Array> = laserTargets <Vehicle> to return array of laser targets from all turrets of this vehicle, similar to current laserTarget but this command is too disorganized and it would be impossible to tell which turret did which laser, so I advise against it.

Another way might be something similar to allTurrets which would return all turret paths and laser entity for each turret (or null if none), which is too excessive so I'd be against it.

Existing laserTarget command might be updated to return first laser target by going through all vehicle turrets, to fix vanilla Strider issue.

Event Timeline

SaMatra created this task.Aug 28 2022, 10:03 AM
SaMatra updated the task description. (Show Details)Aug 28 2022, 10:07 AM
SaMatra edited Additional Information. (Show Details)
SaMatra changed Severity from None to Feature.Aug 28 2022, 10:17 AM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedAug 28 2022, 11:12 AM

What about querying a particular unit in the vehicle, does it work for different gunners with laser targeting devices in the same vehicle?

What about querying a particular unit in the vehicle, does it work for different gunners with laser targeting devices in the same vehicle?

No it doesn't, laserTarget always returns null when executed on a unit that's on in turret with enabled laser designator.

BIS_fnc_KK added a comment.EditedAug 28 2022, 11:32 AM

So would fixing that be sufficient?

Yes, this will make all laser targets accessible.

If we are to change original command behavior, then I would also make laserTarget iterate through turrets to find first laser target, so you can safely execute it on Strider and return laser target from commander.

Just thought about a case, what if turret has laser designator but player can also turn out and use their weapons as FFV turret and use their personal laser designator?

Just tested that, it is indeed a case, you can have both laser designator on a turret, then turn out and use your own laser designator, both laser targets will exist at the same time and only one will be accessible after proposed changes to the command.

Just thought about a case, what if turret has laser designator but player can also turn out and use their weapons as FFV turret and use their personal laser designator?

What does command return on a foot soldier using LD now?

SaMatra added a comment.EditedAug 28 2022, 12:11 PM

Right now:
laserTarget playerOnFoot => Target if laser designator is fired
laserTarget playerInVehicle => Always null
laserTarget vehicle => Target if primary turret designator is fired

So when player is tuned out and using personal LD it would return that target and if turned in and using vehicle LD it would return that target, sounds consistent?

Here is repro to have two laser targets at once which this change to scripting command won't cover:

  1. Place a player and empty AMV-7 Marshall (B_APC_Wheeled_01_cannon_F)
  2. Give player designator with player addMagazine "Laserbatteries"; player addWeapon "Laserdesignator";
  3. Get into commander seat of AMV-7 Marshall
  4. Add designator to commander seat: vehicle player addMagazineTurret ["Laserbatteries", [0,0]]; vehicle player addWeaponTurret ["Laserdesignator_vehicle", [0,0]];
  5. Fire commander seat laser designator
  6. Turn out and fire personal designator
  7. Execute allMissionObjects "LaserTarget" and observe that it returns 2 laser targets at once.

But after some testing it seems that non-active laser target deletes after a bit, so its not really two at once but new and old one.

So when player is tuned out and using personal LD it would return that target and if turned in and using vehicle LD it would return that target, sounds consistent?

I guess this turned out check should only apply if turret is FFV, I just tested it on a turret where you can turn out but not shoot and turret's laser target stays, but if turret is FFV and you turn out, turret's target deletes after a bit.

BIS_fnc_KK added a comment.EditedAug 28 2022, 12:30 PM

This is what I thought, that only current target matters therefore whatever unit tracking now is what should be returned, for simplicity and consistency, no?

This is what I thought, that only current target matters therefore whatever unit tracking now is what should be returned, for simplicity and consistency, no?

Just did another test and found out that you don't have to be on the seat to keep lasing. So you can say have LDs on gunner and commander, both on and then switch to driver, two laser targets will persist as long as you're in the vehicle and there would be no way to return them even with changed laserTarget command (no unit to check against)

Even more bizarre, if you go to commander seat with commander and gunner still lasing, turn out, commander laser will delete after a bit but gunner laser will persist!

I'm all for simplicity but it seems there is nothing simple with Arma.

SaMatra added a comment.EditedAug 28 2022, 12:46 PM

So in total:

  1. You can have LDs working in seats without any units in them as long as there is unit somewhere in the vehicle (and turret is local to them maybe?)
  2. You can have LTs from both turret LD and personal LD, but turret LD will delete after a bit.

I guess there is no way to solve this comprehensively without alternative syntax to accept turret path, since turrets can keep lasing without units in them.

To update current behavior results:

laserTarget playerOnFoot => Target if laser designator is fired
laserTarget playerInVehicle => Target if in FFV turret using personal LD
laserTarget vehicle => Target if primary turret designator is fired

SaMatra added a comment.EditedAug 28 2022, 12:49 PM

What I propose after more tests:

  1. Make current syntax iterate through turret until first laser target is found instead of just primary turret.
  2. Have alternative syntax of <Target> = <Vehicle> laserTarget <Turret>; or another command with laserTargetTurret name to be consistent with other turret commands naming.

This way you can check what player is lasing in their turret seat with vehicle player laserTargetTurret (vehicle player unitTurret player);

<Vehicle> laserTarget <Turret> should be doable

rev. 149851

<vehicle> laserTarget <turret>
<vehicle> isLaserOn <turret>

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Aug 29 2022, 8:13 PM
BIS_fnc_KK changed the task status from New to Feedback.

Tested seemingly all possible scenarios, including MP cases, new alt syntaxes all work perfectly, no issues found.

R3vo closed this task as Resolved.Sep 30 2023, 9:49 AM
R3vo claimed this task.