👼Script: get/set ActorSimAttr
directly - HAZARDOUS ⚠️
#3210
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows advanced users to set actor physics attributes directly, including some not accessible from .truck file format.
In AngelScript, the actor (BeamClass) got 2 new methods:
The set* function always logs "[RoR|Actor] setSimAttribute: '{attr}' = {val}", where {attr} is the attribute name as string.
Currently, the available attributes only cover TractionControl:
Fixes #3188 - The wheel slip constant was hardcoded since 57dfbba but now it's adjustable again. Note that this is possibly not the final solution and other wheelslip coefs may need to be added, i.e. ACTORSIMATTR_TC_WHEELSLIP_CURSPEED_RATIO which would emulate the way it worked in earlier versions. This is open for experimenting.
Tip: To set this value automatically on each spawn, you can attach a script via .truck file format, see #3001 and enter this code:
Scripting reference manual is at https://developer.rigsofrods.org/d2/d42/group___script_side_a_p_is.html though it applies to previous stable release