Skip to content

jackhumbert/let_there_be_flight

Repository files navigation

Let There Be Flight

This is a mod for Cyberpunk 2077 that adds a flying mechanism to all cars, with a couple different modes and options.

Other features include:

  • Imminent explosion audio indicator
  • Visual explosions happen more readily with other cars
  • Quick-eject in flight mode (hold exit)

Video preview of the Drone/Acrobat mode

preview

Installation

For an up-to-date version of the mod, you can download just the game_dir/ folder, and install that into your game's directory.

Official, numbered releases are available here - If you're upgrading, check the release notes for special instructions.

Dependencies

Configuration

red4ext/let_there_be_flight/inputs.xml contains all the keybindings for the keyboard & controller - you can customize these to your liking. See all possibilities here: https://nativedb.red4ext.com/EInputKey

Other settings can be found in red4ext/plugins/let_there_be_flight/packed.reds for the time being - search for FlightSettings.SetFloat to see all the variables used by the mod.

Vehicles can be customized via extending the IFlightConfiguration class (should not be extended directly if you don't know what you're doing - use CarFlightConfiguration, SixWheelCarFlightConfiguration, or BikeFlightConfiguration). As an example, the below disables flight for all vehicles except the Jen Rowley Type 66:

public class CustomCarFlightConfiguration extends CarFlightConfiguration {
  public func CanActivate() -> Bool = false;
}

public class CustomSixWheelCarFlightConfiguration extends SixWheelCarFlightConfiguration {
  public func CanActivate() -> Bool = false;
}

public class CustomBikeFlightConfiguration extends BikeFlightConfiguration {
  public func CanActivate() -> Bool = false;
}

public class FlightConfiguration_quadra_type66__basic_jen_rowley extends CarFlightConfiguration {
  public func CanActivate() -> Bool = true;
}

Troubleshooting

To better report crashes, click on "What does this report contain?" in the crash handler window:

CrashReporter_ZpKyOJoSbT

And find the Cyberpunk2077.dmp file, shown here:

explorer_iuXThrg7iB

Copy this file, along with your red4ext/logs/ctd_helper.log file before you run the game again - it will get overwritten on each launch:

explorer_vV4IdIzcT7

If you can include both of these files in any report, it should make it a lot easier to track down bugs.

Translating

The en-us localization dictionary can be seen in /wolvenkit/source/raw/user/jackhumbert/localization/let_there_be_flight.en-us.json.json - this is a JSON-formatted file. To create a new translation, copy this file, and adjust all of the femaleVariant values. Please use the standard language tag (like 'en-us', 'fr-fr', etc) as the file name. You can send this to me and I'll include it with LTBF, or you can host it yourself on Nexus, etc.

If you want to distribute your own language pack for LTBF, you'll need to use Wolvenkit convert & pack this into an .archive file (please name this file using the language tag, like this: let_there_be_flight.fr-fr.archive), which needs to be paired with a let_there_be_flight.fr-fr.archive.xl file to be read correctly by Archive-XL. Example contents are below:

localization:
  onscreens:
    fr-fr: user\jackhumbert\localization\let_there_be_flight.fr-fr.json

You'll need to replace all fr-fr instances with your language code.

Uninstallation

There's an installation script at red4ext/plugins/let_there_be_flight/uninstall.bat - if you run this, all LTBF mod files will be deleted, but its dependencies will remain.

Development

These are some of the steps I take to update the mod for new versions of the game - it involves some manual address looking-up using IDA, a custom version of Zoltan, and my fork of RED4ext.SDK:

  1. Merge deps/red4ext.sdk from upstream
  2. Update all addresses with "1.61hf1 RVA:" (that matches latest game version) in RED4ext.SDK
  3. Patterns & hints for each addresss should be in each file
  4. Addresses that don't have the current version likely aren't used by LTBF
  5. Run "Generate Addresses" in the VS Code project
  6. Update the game option addresses in src/red4ext/FlightSystem.cpp
  7. Update RED4ext.SDK VFTs
  8. Uncomment the VFT finder in src/red4ext/FlightSystem.cpp:L192
  9. Run the game until it crashes (expected)
  10. Copy the #defines from red4ext/logs/let_there_be_flight.log to deps/red4ext.sdk/include/RED4ext/Addresses_VFT.hpp

Special thanks to @psiberx for Codeware Lib, InkPlayground Demo, and Redscript & CET examples on Discord, @WopsS for RED4ext, @jac3km4 for Redscript toolkit, @yamashi for CET and the E-mode mod (very helpful in figuring out how to work with FMOD), @rfuzzo & team (especially @seberoth!) for WolvenKit, and all of them for being helpful on Discord.

Interested in adding flying vehicles or a similar mechanic to an existing game? Let me know!

Audio system made with FMOD Studio by Firelight Technologies Pty Ltd.