RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.03k stars 178 forks source link

Added prop animation sources `dashboard` and `signalstalk` #3152

Closed ohlidalp closed 6 months ago

ohlidalp commented 7 months ago

This allows the modder to use any input source from the dashboard system (https://docs.rigsofrods.org/vehicle-creation/making-custom-hud/#input-sources) to be used as input source for prop animation (https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#add_animation).

The new source name is 'dashboard' and the data link is specified by 'link: ' argument.

Below is an example showing 2 ways to have parking-brake animation: the old direct source and the new method via dashboard:

; STANDARD:
7,3,6,   0.125, 0.68, -0.02,   -90,0,0    beacon.mesh
add_animation 180, 0, 0, source: parking , mode: x-rotation
; DASHBOARD:
7,3,6,   0.12, 0.15,  -0.02,     -90,0,0    redbeacon.mesh
add_animation 180, 0, 0, source: dashboard,  mode: x-rotation, link:parkingbrake

The screenshot shows it in action. Test mod is attached below. obrazek dashpropboard.zip

ohlidalp commented 7 months ago

I ended up adding the stalk prop animation (requested by Mark on Discord; the reason for starting this PR) as a separate source signalstalk, although originally I intended to stuff it into the dashboard system.

For the demo I ussed arrow mesh as a stalk :)

    7,3,6,   0.81, 0.75, 0.04,   0,0,-90    arrow2.mesh
        add_animation 25, 0, 0,  source: signalstalk, mode: x-rotation

dashpropboard_w_stalk.zip

obrazek