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 15 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

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.
Recent introduction of INT token type to GenericDocument broke the previous contract of NUMBER token type (handled by functions `isTokFloat()` and `getTokFloat()`) covering both ints and floats.
To resolve this, a convenience getters `isTokNumeric()` / `float getTokNumeric()` were added - these work the same way as `*TokFloat()` functions before, accepting both INT and FOAT tokens and returning `float` datatype.
The addonpart parser was updated to use these.
@ohlidalp ohlidalp force-pushed the Flip_nbutility_projects branch from 0a31404 to 7328ea4 Compare October 25, 2024 00:21
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