Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools/NodeBeamUtil: added exporting of modified actor. #3185

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Oct 2, 2024

ALPHA VERSION - Please expect glitches and rough edges all over the place

How to use

  1. Spawn a regular zipped mod... N/B utils will ask you to create a project (= unzip the mod to a new directory).
    obrazek

  2. Press the button... game will create the project and show box.
    obrazek

  3. Spawn the project as usual
    obrazek

  4. The N/B util now shows project name with [Save] button.
    obrazek

@ohlidalp
Copy link
Member Author

ohlidalp commented Oct 9, 2024

The N/B utility now has a menubar (if you're working on a project). Exporting the TotalMass slider value back to truck file is somewhat of a challenge, but when you check both the checkboxes under the ExportOptions menu, it works (with a minor discrepancy).

obrazek

@ohlidalp ohlidalp force-pushed the Flip_nbutility_projects branch from 0a31404 to 7328ea4 Compare October 25, 2024 00:21
also unified delimiters to ',' - no effect on functionality
FEATURE CHANGES:
* There's a new checkbox in the NBUtil: "Override all node masses?" - if unchecked, the TotalMass slider doesn't affec the export. If checked, all nodes will get the 'l' flag and weight override parameter. This is the only way to propagate the slider setting to the truck file.
    !KNOWN BUG! The total mass inflates every time the checkbox is used - probably because the dry_mass/load_mass globals are unchanged and wheel nodes still abide it.
* The cinecam was added to the export.

CODE CHANGES:
* Actor.h: some fields/funcs renamed and moved around.
* Actor.cpp - the export function moved to new file 'ActorExport.cpp'
New checkbox: "Reduce dry mass by node mass overrides" - with explanatory text!

I fixed the !KNOWN BUG! mentioned in previous commit - exporting the TotalMass slider value back to truck file is somewhat of a challenge, but when you check both the checkboxes, it works (with a minor discrepancy).
The new code is in ActorExport.cpp.

A lot of code changes was needed:
* RigDef_File.h: removed enum WheelBraking which duplicated enum wheel_t::BrakeCombo in SimData.h. Using the new WheelBraking everywhere. Finally got rid of `wheel_t::BrakeCombo ActorSpawner::TranslateBrakingDef(RigDef::WheelBraking def);`
* Application.h: several enums moved here to break circular header dependencies (nasty C++ thing): RigDef::Keyword (from RigDef_File.h), WheelBraking + WheelPropulsion (from RigDef_File.h), FlareType+ ExtCameraMode (from GfxData.h)
It doesn't crash anymore but the wheel spring/damp still isn't saved.
For wheels, the UI was extended: aside of the scale slider there are now base spring/damp inputs and final value calculation.

The code assumes all wheels have same spring/damp and uses wheel [0] as the master record. This means all other wheels will be overriden by these params.

For wheels2/meshwheels2/flexbodywheels, the game shows a secondary spring/damp setting rows for the rim (actually tire tread, but historically reffered to as 'rim' in the docs) values. Those are then encoded to the truck file depending on keyword: wheel2 has them directly in the def, meshwheels2/flexbodywheels use 'set_beam_defaults'
@ohlidalp ohlidalp force-pushed the Flip_nbutility_projects branch from 7328ea4 to cf22f0f Compare January 26, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant