Skip to content

Commit

Permalink
Update hot reload documentation, rename entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
Basssiiie committed Apr 30, 2023
1 parent 02cd8e8 commit 18d9251
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,13 @@ This plugin makes use of the [FlexUI](https://github.com/Basssiiie/OpenRCT2-Flex
This project supports the [OpenRCT2 hot reload feature](https://github.com/OpenRCT2/OpenRCT2/blob/master/distribution/scripting.md#writing-scripts) for development.

1. Make sure you've enabled it by setting `enable_hot_reloading = true` in your `/OpenRCT2/config.ini`.
2. Open `rollup.config.js` and change the output file path to your plugin folder.
- Example: `C:/Users/<YOUR NAME>/Documents/OpenRCT2/plugin/RideVehicleEditor.js`.
- Make sure this path uses `/` instead of `\` slashes!
3. Open command prompt and use `cd` to change your current directory to the root folder of this project.
4. Run `npm start` to start the hot reload server.
5. Use the `/OpenRCT2/bin/openrct2.com` executable to [start OpenRCT2 with console](https://github.com/OpenRCT2/OpenRCT2/blob/master/distribution/scripting.md#writing-scripts) and load a save or start new game.
6. Each time you save any of the files in `./src/`, the server will compile `./src/registerPlugin.ts` and place compiled plugin file inside your local OpenRCT2 plugin directory.
7. OpenRCT2 will notice file changes and it will reload the plugin.
2. Open command prompt and use `cd` to change your current directory to the root folder of this project.
3. Run `npm start` to start the hot reload server.
4. Use the `/OpenRCT2/bin/openrct2.com` executable to [start OpenRCT2 with console](https://github.com/OpenRCT2/OpenRCT2/blob/master/distribution/scripting.md#writing-scripts) and load a save or start new game.
5. Each time you save any of the files in `./src/`, the server will compile `./src/plugin.ts` and place compiled plugin file inside your local OpenRCT2 plugin directory.
6. OpenRCT2 will notice file changes and it will reload the plugin.

If your local OpenRCT2 plugin folder is not in the default location, you can specify a custom path in `rollup.config.js`.

### Final notes

Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getOutput()
* @type {import("rollup").RollupOptions}
*/
const config = {
input: "./src/registerPlugin.ts",
input: "./src/plugin.ts",
output: {
file: getOutput(),
format: "iife",
Expand Down
File renamed without changes.

0 comments on commit 18d9251

Please sign in to comment.