astruyk / Ares

An arma3 mod that adds some extra functionality to Zeus
51 stars 11 forks source link

Add generic 'turn on lights', 'turn off lights' and 'lights auto' commands to make units turn on headlights and laser pointers #28

Open astruyk opened 10 years ago

astruyk commented 10 years ago

Works with laser pointers now, but headlights are wonk. Something like the following ALMOST works, except it makes the headlights flicker:

    {
        _vehicle = vehicle _x;
        if ((_x in vehicle _vehicle) && (driver _vehicle == _x)) then
        {
            null = [_x] spawn
                {
                    _driver = _this select 0;
                    _driver setVariable ["forceLightsState", "on"];
                    while {alive _driver && (_driver getVariable["forceLightsState", "auto"] == "on")} do
                    {
                        _driver action ["lightOn", (vehicle _driver)];
                        sleep 0.01;
                    };
                };
        };
    } foreach (units _group);
astruyk commented 10 years ago

This might be possible with the new light commands from 1.32.

TheOtherTaylor commented 10 years ago

From what I can tell keeping vehicle lights off was previously impossible. In stealth and combat states though, most vehicles keep their lights off. I messed with this on the mission on Saturday and had no luck.