Skip to content
New issue

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

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

Already on GitHub? # to your account

Shock tuning script (+ scripting improvements) #2920

Merged
merged 7 commits into from
Sep 29, 2024

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Jul 10, 2022

New features:

  • ImGuiCol_ enum finally bound to AngelScript, all copypasted defs were removed.
  • Functions getShockCount(), getShockSpringRate(), getShockDamping(), getShockNode1/2() and getShockVelocity(), added to BeamClass in the scripting API.
  • Created simple script which draws 3 graphs for each shock, directly in scene. Graph size, scale and sample count are configurable in the Config collapsing section. To run it, open console and say loadscript example_game_shockTuning.as
  • The [X] close button on script windows was fixed, it now shows the yellow prompt "Terminate this script?" (opt-out in code).

obrazek

@ohlidalp
Copy link
Member Author

Purpose: To be able to monitor shock forces in slow motion mode. Requested from Discord.

Estimate: 1 man day. The improved imgui-AngelScript bindings got merged elsewhere already.

Work to be done: Just script work. Each shock needs more detailed display.

@ohlidalp ohlidalp marked this pull request as ready for review September 28, 2024 20:42
Uses DearIMGUI graphs to visualize shock spring/damp/velo values.
Also improved quality of life: editor now recognizes _AUTOSAVE suffix and loads under orig name.
The STOP/RUN button now recognizes the crash and resets.
The exceptions panel now stays open and shows the errors. There are new buttons [clear] per line and [clear all].

Unrelated: cleaned lots of older DBG messages.
This snowballed into a big grooming of scripts:
- all individual scripts, including all examples, had to be fixed.
- a helper class `CloseWindowPrompt` was added to 'imgui_utils.as'
- Bindings of 'ImGuiCol_' enum were added to the game, copypasted constants were removed from all scripts.
- a copypasted helper `getDummyFullscreenWindow()` was also added to 'imgui_utils.as' - related because it uses ImGuiCol_ constant.
- the Tutorial script in script_editor.as was updated to use `CloseWindowPrompt` from 'imgui_utils.as' - the separate example script was removed.
@ohlidalp ohlidalp changed the title Shock tuning script Shock tuning script (+ scripting improvements) Sep 29, 2024
@ohlidalp
Copy link
Member Author

@ohlidalp ohlidalp merged commit 41060b8 into RigsOfRods:master Sep 29, 2024
2 checks passed
@ohlidalp ohlidalp deleted the shock-tuning branch September 29, 2024 23:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant