![]() |
Rigs of Rods 2023.09
Soft-body Physics Simulation
|
This extends the FreeForces system to be able to behave exactly like beams in truck fileformat. 2 new freeforce types are available: HALFBEAM_GENERIC and HALFBEAM_ROPE. Because one freeforce can only affect one node (strict rule), to fully simulate a beam, you need 2 equivalent HALFBEAM_* freeforces in opposite directions. For example of use, see the new script 'example_freeforce_halfbeam.as'. TIP: To make this GIF, I had to stop the engine on the other DAF otherwise it refused to move even with handbrake off.
To diagnose deforming and breaking of these freeforces, a new script event SE_GENERIC_FREEFORCES_ACTIVITY was added, with these activity types:
When adding a HALFBEAM, you use the same arguments as with TOWARDS_NODE, all 'set_beam_defaults' params are optional with the same defaults as in truck file:
Like any freeforce, freebeams are invisible by default, but you can archieve the same look and feel of the classic beam visuals. Because they exist outside of any actor, a whole new code and setup logic was needed. There are 3 new messages:
All are pushable via game.pushMessage(). Like with freeforces, you need to manually supply ID when creating/modifying freebeamGfx - use game.getFreeBeamGfxNextId() The example script 'example_freeforce_halfbeam.as' was updated to add the freebeamGfx, and also to enter 'set_beam_defaults' values (for the sake of demo).
This page is archived from Original GitHub PR and respective commit messages.