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.01k stars 175 forks source link

`sectionconfig` and `nodes2` broken since 2013. #2881

Open ohlidalp opened 2 years ago

ohlidalp commented 2 years ago

Hello.

About a year ago I studied the truck file parser of v0.4.0.7 (year 2013, before all my changes) and I discovered that sectionconfig and nodes2 were far more powerful than anyone knew. See this example:

; this defines a list of configurations the player can select from when spawning.
sectionconfig -1 VanillaSportscar
sectionconfig -1 SportscarWithRearWing
sectionconfig -1 SportscarWithFrontWing
sectionconfig -1 SportscarWithBothWings

; the vanilla car: nodes2, beams

section -1 SportscarWithFrontWing, SportscarWithBothWings
; the front wing: nodes2, beams
end_section

section -1 SportscarWithRearWing, SportscarWithBothWings
; the rear wing: nodes2, beams
end_section

; anything else using named nodes

The takeaways:

Unfortunately this was never documented... I saw a single mod "KickerRamp" in the archive which would use sectionconfig to put additional named nodes in the middle of the truck file. Apparently someone knew about the functionality but most people didn't. Also, it was very difficult to understand from the code itself, so I unwittingly removed it as part of cleanup efforts. I'm currently working to restore it: