Open CuriousMike56 opened 1 year ago
It seems any "event" source is affected by this issue: https://forum.rigsofrods.org/resources/tatum-class-1-buggy.325/
1, 19, 46, 0.5, 0, 0, 0, 0, 0, class1buggy-pulleys.mesh
add_animation 5, 0, 0, source: tacho, mode: z-rotation
add_animation 0.05, 0, 0, source:event, mode:y-offset, event:TRUCK_STARTER, eventlock
I just took a quick look, it got broken here: https://github.com/RigsOfRods/rigs-of-rods/pull/2949 - specifically this commit https://github.com/RigsOfRods/rigs-of-rods/commit/e583df2cb35197fc7bdc9326908eb9a8aae3cf00.
There are actually 2 bugs there:
Other trailers with the same problem as the Centerline: https://forum.rigsofrods.org/resources/trout-river-live-bottom.104/ https://forum.rigsofrods.org/resources/55-ton-fontaine-eagerbeaver-rgn.621/
Turns out the animations work as intended if a truck is attached and you activate the commands from the truck:
https://github.com/RigsOfRods/rigs-of-rods/assets/46073351/efcf5dab-7cca-4385-9ae2-f61c5ea50aa5
Turns out the animations work as intended if a truck is attached and you activate the commands from the truck:
@CuriousMike56 I don't really understand how this is working; either way, is there anything I need to fix or can this be closed?
@ohlidalp The problem is that the animations only work when a truck is attached, they should function regardless of connection. And there's also the misleading "Failed to identify animation source" error that spams the console.
@CuriousMike56
The problem is that the animations only work when a truck is attached, they should function regardless of connection.
Ah, thanks for clarifying, I wasn't sure if that quirk is undesirable or mods use it. Very puzzling, tho.
And there's also the misleading "Failed to identify animation source" error that spams the console.
I was sure I fixed that one bit long ago... I guess not. Let me take a look. UPDATE: Sure enough, I can't reproduce it.
Got it. The anims don't activate because they're event-triggered, and input events are only evaluated for trucks (with engine), not trailers.
The check is here: https://github.com/RigsOfRods/rigs-of-rods/blob/8d3914b8e0152f1a289c8822ffde16bbc8db8b92/source/main/main.cpp#L1144-L1147 - trailers have type NOT_DRIVEABLE
, not TRUCK
.
The whole enumeration is https://github.com/RigsOfRods/rigs-of-rods/blob/8d3914b8e0152f1a289c8822ffde16bbc8db8b92/source/main/physics/SimData.h#L99-L109 - there is no 'TRAILER' category.
The identification is done when generating modcache: https://github.com/RigsOfRods/rigs-of-rods/blob/8d3914b8e0152f1a289c8822ffde16bbc8db8b92/source/main/resources/CacheSystem.cpp#L903-L906
I could add a TRAILER actor type, the question is how should it be recognized. I could check for fileinfo
category 117 (Trailers) and make sure it has at least 2 wheels (because i.e. Neg's RockPack also uses 117, probably by accident).
In version 2022.12+ command-triggered
add_animation
lines are no longer parsed correctly, showingFailed to identify animation source
in the log: https://forum.rigsofrods.org/resources/centerline-40t-rigid-neck-lowbed.720/The flags on this trailer are supposed to move to their correct locations when pressing CTRL+F3/F4 (2022.04):
https://user-images.githubusercontent.com/46073351/229202841-226b2da8-4d26-43a6-94cd-71d74fab1ad1.mp4
This issue primarily affects Negativeice's mods. Another example: https://forum.rigsofrods.org/resources/komatsu-d39ex.416/ Strangely enough, the joystick animations on the D39EX still function despite throwing the same error.