Skip to content

Commit

Permalink
Merge pull request #11 from SpontanCombust/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust authored Aug 3, 2024
2 parents 8a9101a + 9fe2e23 commit 5a0cf7d
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 73 deletions.
105 changes: 57 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.7.0"
version = "0.8.0"
edition = "2021"
authors = ["SpontanCombust"]

Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ https://github.com/WolvenKit/WolvenKit

## Usage

In order to use this tool make sure the game is running and that it was launched with following arguments: -net -debugscripts.
In order to use this tool one of two requirements must be met:
1. The game must have been launched with following debug arguments[^1]: -net -debugscripts.
2. A REDkit project must be opened

[^1]: You can either create a shortcut to the executable and add those arguments at the end or configure launch parameters in Steam/GOG.

Print help information.
```ps1
Expand All @@ -30,11 +34,16 @@ Recompile game scripts.
rw3d_cli.exe reload
```

Recompile game scripts while developing a mod using REDkit.
Recompile scripts specifically for an active REDkit project.
```ps1
rw3d_cli.exe --target=editor reload
```

Recompile scripts specifically for a game being launched with debug arguments.
```ps1
rw3d_cli.exe --target=game reload
```

Remotely call an exec function from the game. Remember to use quotation marks for the command argument.
```ps1
rw3d_cli.exe exec "spawn('Nekker', 3)"
Expand Down
15 changes: 10 additions & 5 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ pub(crate) struct CliOptions {
#[clap(long, default_value="127.0.0.1", display_order=0)]
ip: String,

/// Select connection target
#[clap(long, value_enum, default_value="game", display_order=1)]
/// Select connection target.
/// - game - connect to the standalone game running with debug arguments,
/// - editor - connect to the game running in the REDkit editor,
/// - auto - try connecting to either the standalone game or one running in REDkit
#[clap(long, value_enum, default_value="auto", display_order=1, verbatim_doc_comment)]
target: ConnectionTarget,

/// The maximum amount of milliseconds that program should wait for the game to respond.
Expand All @@ -51,10 +54,12 @@ pub(crate) struct CliOptions {

#[derive(Debug, ArgEnum, Clone, Copy, PartialEq, Eq)]
enum ConnectionTarget {
/// Connect to the game running on its own
/// Connect to the standalone game running with debug arguments.
Game,
/// Connect to the game running through REDkit editor
Editor
/// Connect to the game running through the REDkit editor.
Editor,
/// Try connecting to either the standalone game or one running through REDkit.
Auto
}

#[derive(Debug, ArgEnum, Clone, Copy, PartialEq, Eq)]
Expand Down
Loading

0 comments on commit 5a0cf7d

Please sign in to comment.