Closed ohlidalp closed 1 year ago
After getting feedback from Discord, I'll do these changes: EDIT: more feedback, I'm reassigning 'N' as CYCLE_LIGHTS and 'B' as HIGH_BEAMS.
s
- Sidelights (running/parking lights) - control with TOGGLE_TRUCK_LIGHTS or CYCLE_TRUCK_LIGHTSf
- Low beams - control with TOGGLE_TRUCK_LIGHTS or CYCLE_TRUCK_LIGHTSt
- Tail lights - activated together with f
.h
- High beams - activated separately by TOGGLE_TRUCK_HIGH_BEAMSg
- Fog lights - activated by TOGGLE_TRUCK_FOG_LIGHTSKey controls:
Purpose: To raise the bar for vehicle accuracy - add separate headlight/high beam/foglight/sidelight (running light) controls, including multiplayer sync.
Estimate: 3 man days. Flares and hotkeys work, just dashboard system needs to be extended.
By popular demand (last but not least: https://forum.rigsofrods.org/threads/incandesant-material-flares.3749/) I tried hooking flares into our existing "command key inertia" system (docs: https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#set_inertia_defaults) so they would fade in and out with fine control. The result is a complete success.
To test, use the attached vehicle (modified Agora bus with 10 user flares). flare3-agoras.zip
All lights are set to the same parameters:
flares3
set_inertia_defaults 0.4, 0.8, linear, linear
In the GIF below, right blinker is on, user lights 0-6 are toggled on, and finally brake lights are tested.
AgoraS with silly custom dashboard HUD to test the new elements.
I've restored the lights
lamp as an alias for sidelights
(aka "daytime running lights" in the US).
It's the least wrong solution - sidelights automatically light up with low beams which is what the classic N key now does.
Also the light cycling hotkey is intelligent now, anyway, it skips light types which have no flares installed - so for existing mods it will just toggle "1. off 2. sidelights+headlights".
Reverse lights no longer work:
master
this PR
Everything else seems to work nicely though 👍
Closes #2751 (when done). Closes #2946 because syncing of flare states between linked actors is completely redone here. Pardon the messy history below, this PR grew quie far beyond it's intended scope.
Changes:
custom_lightN
(N is 1-10),headlights
,highbeams
,foglights
,sidelights
,brake_lights
,reverse_light
,beacons
.lights
(bool) is now an alias ofsidelights
.lights
repurposed for headlights, added fieldshigh_beams
,fog_lights
. Savegame version was not bumped, the new fields are optional and default to false.pp_beacon_light
was renamed tobeacon_light
. On loading game, the latter is preffered if exists, otherwise former is loaded. The strange pp_ prefix was caused by find-&-replace derp in commit 5a159ad9c0d0ffb1fa3e6f4f9c4577fab3910e3e.flares3
which obeysset_inertia_defaults
for incandescence effect, see this commentenum Lightmask
because new flare types wouldn't fit in existingenum Flagmask
. Also, these flags are used for both networking and internally, simplifying light syncing between linked actors.Limitations:
flares3
works only for flare billboards, not light sources or materialflarebindings. To be done after OGRE13 port.Testing: