Page MenuHomeFeedback Tracker

AI controlled vehicles with collision lights are unable to use headlights/main lights
Reviewed, WishlistPublic

Description

It is currently impossible that AI will turn on vehicle headlights, as long as the vehicle has additional collision lights.
Instead of using the headlights AI will only turn on/off the collision lights, depending on behavior.

This affects every vehicle with collision lights (currently all helicopters, speedboats and SDVs).

No matter if the behavior is set to safe or careless, AI will never turn on the headlights/main lights. Even when using a gamelogic to turn them on, the AI driver/pilot will turn off the headlights/main lights as soon as they light up.
{F22545} {F22546} {F22547} {F22548} {F22549} {F22550} {F22551} {F22552}

Details

Legacy ID
3853983793
Severity
None
Resolution
Open
Reproducibility
Always
Category
AI Control / Commanding
Steps To Reproduce
  1. Open Editor and set it to nighttime
  2. Place AI controlled Vehicle with collision lights (every chopper/SDV/speedboat) on map
  3. Group it to the player with the player as group leader
  4. Preview and change the behaviour to safe or careless
  5. See how it only turns on the collision lights with the headlights/main lights untouched

alternatively you can use my attached mission (you really should)

Additional Information

Using my mission:

  • Contains all vehicles affected by this issue
  • Ability to switch behaviour of all units via radio commands
  • Teamswitching into every vehicle affected by this issue
  • Turn on vehicle lights with a gamelogic via addaction for manned/unmanned affected vehicles
  • Ability to see how AI immediately turn off the vehicle headlights/main lights after the player used the gamelogic to turn them on

Event Timeline

GrumpyOldMan edited Additional Information. (Show Details)
GrumpyOldMan set Category to AI Control / Commanding.
GrumpyOldMan set Reproducibility to Always.
GrumpyOldMan set Severity to None.
GrumpyOldMan set Resolution to Open.
GrumpyOldMan set Legacy ID to 3853983793.May 7 2016, 5:10 PM
FrankHH added a subscriber: FrankHH.May 7 2016, 5:10 PM

Confirmed. I've never seen AI use helicopter headlights.

Added updated mission file for reproduction.
It looks like the AAF jets are handling their lights just fine, so it might be just a small edit in the config files of the vehicles to fix this issue.

I would really like to have some developer look into this since it's apparently only a small tweak in the vehicle configs to fix this. would really help mission designers since the current "workaround" is basically to repeatedly force the vehicle light to turn on, which is not a solution for performance dependant missions.

This is still the case on the current Version (1.08)

Unfortunately this is still the case in the current stable branch (1.10)

This is still the case on the current stable branch 1.12.115915.

"Configured lights, position lights and collision lights of both planes and helicopters" - spotrep #00019

What exactly has been reconfigured as stated in the patchnotes?

Still true on the current devbranch.

This has been the case since Alpha and is still the case with the release of the third campaign episode "Win"...

Uploaded picture, ground vehicles are working fine, vehicles that have additional collision lights won't use main lights when set to safe.

Any chance that this will get fixed anytime soon?
Running a script that turns the main light on every frame is a bit much if you're running multiple choppers...

Iceman added a comment.Apr 8 2014, 4:29 PM

Hello,

thanks for submitting the ticket. Air vehicles should not be using their reflectors by default. They should have their collision lights switched on when safe. Do I understand the problem right? Or is some script forcing them to use head lights broken?

Thank you.

In Arma2 choppers would use their lights/searchlights/reflectors or whatever you want to call them when in SAFE or CARELESS mode (see picture), which was perfectly fine. It just doesn't work in arma3 anymore.

In Arma3 choppers will only use the collision lights, while every single jet (see pictures) will use the reflectors in SAFE or CARELESS mode. So there's definitely some inconsistency with the reflector usage.

It would be great if it could be like it was in arma2 where SAFE or CARELESS meant: reflectors on.

AWARE could be reflectors off, collision lights on, and COMBAT/STEALTH reflectors off, collision lights off.

Cheers

I see your point (and the assets being inconsistent are the strongest arguments). However, even jets use their reflector lights only for taking off/landing purposes. When they fly to follow waypoints, their lights are off.

I will discuss this issue in general within the development team.

Many thanks for your feedback, have a nice day.

Any new conclusions on this?
Having AI controlled choppers with controllable (by mission maker) reflector lights would be nice to have. One of those features I'm missing from Arma2.

Cheers

mp5gosu added a subscriber: Grumpy.May 7 2016, 5:10 PM

@Grumpy Old Man: Still the same.

JQuel added a comment.Aug 24 2014, 9:13 PM

Yes please. I find it odd that we can't control an AI controlled helicopters searchlight (ie, Just turn it on, leave it on and not have the AI pilot turn it off).

I'd like to be able to have a helicopter simulate searching an area with the main light/searchlight/reflector. This will add some good immersion for those sneaky, sneaky night missions.

You can always spawn a light and attach it to the helicopter for the time being.

I know this. I appreciate your input, but I didn't post looking for a work-around.
This would save editors the hassle of working around something that really should just work and not just 'attaching' lights to things, like helicopters that already have lights.
The issue I think here is the inconsistency between assets and not providing an easy way to control them (the main light/searchlight/reflector, switch it on or off).
Leave it upto the AI and they will invariably do what you don't want them too :)

As an off shoot to this (and a work around, although I wasn't looking for one haha!)I did a little more research and managed to get this working.

In a script, I create a chopper, crew it, set its behaviour, give it some waypoints then pass it into the below:

null=[_searchChop] spawn {

while {true} do {  
    player action ["lightOn", _this select 0];
    sleep 0.01;
};

};

main light/searchlight/reflector is on, however, method has couple of probs which I haven't thought out yet.
Trouble with this method,
a) endless loop (no, no, never)
b) the sleep 0.01, wasted CPU cycles.

Changing the sleep period, even by .4, causes the search light to flicker and is NOT to be tested by those who suffer from flashing images (this is not a joke!)

Without this however, the AI turns the light off, regardless of combat mode/behaviour

mestoth added a subscriber: mestoth.May 7 2016, 5:10 PM

This bug is still current in 1.32:
You added setPilotLight which is fantastic.. and works for every other vehicle, however all helicopters still do this.
Edit 1: For clarity
Helicopters which have search lights on them will NOT use them. You can force them to do it with the below script (and posted above), but it requires you to FORCE the light on every 0.01 second (to override the pilots 'turn off' action). This is inconsistent with every other vehicle in the game (and makes no sense)

I have tried a variety of things, setting them to captive, Setting to Careless. the old while {true} do { (driver _this) action ["lightOn", _this]; (driver _this) action ["collisionlightOn", _this]; sleep 0.01}; is the only way it seems to keep the light on.

Could you review the pilot AI behaviour, they are still turning it off it appears.

Tanks\APCS\Cars etc all work. Choppers...not at all

Still current in 1.34..
I guess Helicopters dont fly at night :O

There is a new work around, although I am still yet to confirm (one my clan mates found it (lecks) from gear selector.

Apparantly with the new patch, a heli with its rotors destroyed can be attached to the helicopter you want. Forceon the lights on the destroyed helicopter. apparantly it works..have yet to test.

Still current bug in 1.34: however I have found a work around through some testing with Lecks (full credit to Lecks from ASOR (also ASOR Gear Selector http://www.armaholic.com/page.php?id=26181) for finding this:

The hint is there for my current mission editor, remove at your discretion.
This function works:
HINT "Lights SCRIPT RUNNING";
(driver _this) setCaptive true;
(group driver _this) setBehaviour "Careless";
(driver _this) setBehaviour "Careless";
_this enablesimulation true; _this enablesimulationglobal true;
sleep 30;
sleep 30 is there to allow the choppers to take off if they are in uneven terrain. I had my units set as simulation disabled to start (to suit my mission). Otherwise they attach on uneven terrain and half the choppers explode!
_type = typeOf _this;
_copy = _type createVehicle getPos _this;
_copy setHit [getText(configFile >> "cfgVehicles" >> (typeof _copy) >> "HitPoints" >> "HitHRotor" >> "name"), 1];
_copy attachTo [_this, [0,0,0]];
_copy setPilotLight true;
_copy setCollisionLight true;
_copy engineOn true;
(driver _this) setCaptive true;

Went through some testing again on this issue now that the Helicopter DLC is out and a new command "setPilotLight" has been added.

Much to my disappointment, the "setPilotLight" command is basically the same as the "LightOn"/"LightOff" action, no matter the behavior setting of the group, the lights are always turned off as soon as they light up (at max. 2-3 frames).

Despite the last comment from Iceman that these reflector lights are only being used during TakeOff/Landing procedure I've yet to see AI heli pilots do such a thing.

Can we get a solution to this so we can finally skip the need for ridiculous workarounds just for having a pilot enable his lights?

This was working just fine in A2 and A2:OA for years without disturbing anyone, why this was changed in A3 is beyond me.

Would love some further input on this issue.

Cheers

F2kSel added a subscriber: F2kSel.May 7 2016, 5:10 PM
F2kSel added a comment.Mar 3 2015, 4:30 AM

The work around described by mestoth does work but not for all choppers.
It does prove that both sets of lights can work together.

Just fix the damn lights.

Still the case in 1.46 stable.

PiepMGI added a subscriber: PiepMGI.May 7 2016, 5:10 PM

Nothing new under the sun (sorry the moon)

Still no change on this issue. (1.54)

nomisum added a subscriber: nomisum.May 7 2016, 5:10 PM

wholeheartedly upvoted

Still no changes in 1.64.

Workaround meanwhile:

_veh = yourchopper;
_ID = format ["%1%2%3",time,random 10000,getposatl _veh];
[_ID, "onEachFrame", {

	if (alive _this AND isEngineOn _this) then {

		if ((getposatl _this select 2 < 50 OR toupper landResult _this isequalto toupper "Found") AND (daytime < 7 OR daytime > 18)) then {

			_this setPilotLight true

		};

	};

},_veh] call BIS_fnc_addStackedEventHandler;

Gives fluid permanent turned on reflector lights when landing or low altitude, during night.
No wonky 0.002s sleep while true loops needed.

great workaround Grumpy! with 1.66 the issue is still there. I modified your code a bit, so the lights work as intended. Now, when the behaviour of the solider changes from "SAFE" to "COMBAT" or "AWARE" lights will turn off. (You can config it like you want, just change the behaviour mode to the behavior the lights should be on. )

_soldier = yourdriver/pilot
_veh = yourchopper;
_ID = format ["%1%2%3",time,random 10000,getposatl _veh];
[_ID, "onEachFrame", {

if (behaviour _soldier == "SAFE") then {

		if ((daytime < 7 OR daytime > 18)) then {

			_this setPilotLight true

		};

};

},_veh] call BIS_fnc_addStackedEventHandler;

you can add more conditions, so the lights would stay on when behaviour mode is "AWARE" or something. Example: (behaviour _soldier == "SAFE" OR behaviour _soldier == "AWARE")

Prefer this command: sunorMoon

if (sunOrMoon < 0.5) then {

			_this setPilotLight true

		};