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

Added hydro flag j, restored bug with i for backw. compat. #2933

Merged
merged 1 commit into from
Sep 4, 2022

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Aug 28, 2022

It turns out the i flag has a bug: it always makes the hydro invisible, but if it comes as first/single flag, then it also makes the hydro commanded by steering input. That means:

  • ri will make the hydro respond only to airplane rudder, and invisible.
  • ir will make the hydro respond to both airplane rudder and steering input, and invisible. This makes it behave a lot different than plain hydro though, and many SimMonsters mods use it as a feature.

To resolve backward compatibility, I added a new flag j, which makes the hydro invisible but without the quirks of i. The parser still recognizes i but internally I'm using only j and n.

The documentation https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#hydros needs to be updated:

  • `` no flags given -> force n flag.
  • n means Normal and makes the hydro driven by steering input.
  • j makes the hydro invisible.
  • i makes the hydro invisible, but BEWARE: if it comes as first/single flag, then it also forces n flag. This quirk is maintained for backwards compatibility.

Fixes #2932

@ohlidalp ohlidalp requested a review from tritonas00 August 28, 2022 23:13
@RigsOfRods RigsOfRods deleted a comment from po185021 Sep 1, 2022
It turns out the `i` flag has a bug: it always makes the hydro invisible, but if it comes as first/single flag, then it also makes the hydro commanded by steering input. That means:
* `ri` will make the hydro respond only to airplane rudder, and invisible.
* `ir` will make the hydro respond to both airplane rudder and steering input, and invisible.

To resolve backward compatibility, I added a new flag `j`, which makes the hydro invisible but without the quirks of `i`.

The documentation https://docs.rigsofrods.org/vehicle-creation/fileformat-truck/#hydros needs to be updated:
* `` no flags given -> force `n` flag.
* `n` means Normal and makes the hydro driven by steering input.
and the above.
@ohlidalp
Copy link
Member Author

ohlidalp commented Sep 4, 2022

Test using this vehicle (all hydros have ir flags):
dafsemi-hydro-ir.zip

  • on master, it won't steer at all.
  • on this PR, it will steer but differently than plain DAF.

Note it got broken in 9421c68 - if you build an earlier commit, it will work the same way as in this PR.

@ohlidalp ohlidalp removed the request for review from tritonas00 September 4, 2022 20:50
@ohlidalp ohlidalp merged commit e6407e2 into RigsOfRods:master Sep 4, 2022
@ohlidalp ohlidalp deleted the hydro-compat branch September 4, 2022 20:50
# 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.

Compatibility regression of hydros flag r (rudder input)
2 participants