Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Commit 6f8429f

Browse files
committed
updated doc
1 parent 0930eb4 commit 6f8429f

21 files changed

+98
-1057
lines changed

README.md

Lines changed: 95 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,17 @@
2121

2222
## Table of Contents
2323

24-
- [Table of Contents](#table-of-contents)
25-
- [About The Project](#about-the-project)
26-
- [Built With](#built-with)
27-
- [Getting Started](#getting-started)
28-
- [Prerequisites](#prerequisites)
29-
- [Installation](#installation)
30-
- [Usage](#usage)
31-
- [Installing the script](#installing-the-script)
32-
- [Generating data using Overpass Turbo](#generating-data-using-overpass-turbo)
33-
- [Generating data just with coordinates](#generating-data-just-with-coordinates)
34-
- [Converting data](#converting-data)
35-
- [Run the script in game](#run-the-script-in-game)
36-
- [Roadmap](#roadmap)
37-
- [Contributing](#contributing)
38-
- [License](#license)
39-
- [Contact](#contact)
24+
- [Installation](#installation)
25+
- [Usage](#usage)
26+
- [list](#list)
27+
- [tpll](#tpll)
28+
- [tpdms](#tpdms)
29+
- [draw](#draw)
30+
- [Find a railroad name](#find-a-railroad-name)
31+
- [Roadmap](#roadmap)
32+
- [Contributing](#contributing)
33+
- [License](#license)
34+
- [Contact](#contact)
4035

4136

4237

@@ -46,146 +41,147 @@
4641

4742
The BTE generation is not perfect and some structures such as railway lines are missing.
4843
Doing it by hand is unthinkable given the curves and the number of measurements that would have to be taken.
49-
- It is a WorldEdit script:
50-
- in case of problem the command `//undo` is always available.
51-
- no loading of chunks by the players, and it's very fast.
52-
- You generate the data on your computer, the script on the server only plots, so there is a minimum of operations and lag.
53-
- You have control over the data, whether the rails in a defined area or an entire line.
54-
- You can also trace any missing structure
44+
This set of tools will allow you to enjoy a better experience on BTE and build to your full potential.
5545

5646
### Built With
5747

5848
* [Node](https://nodejs.org/)
59-
* [AutoHotkey](https://www.autohotkey.com/)
6049

6150
## Getting Started
6251

63-
### Prerequisites
6452

65-
You must have [Node](https://nodejs.org/) and npm installed on your system. (Comes with it)
6653

67-
### Installation
54+
### Prerequisites
6855

69-
1. Clone the repo
70-
```sh
71-
git clone https://github.com/oganexon/BTE-tools.git
72-
```
73-
2. Install NPM packages
74-
```sh
75-
npm install
76-
```
56+
You must have WorldEdit as a minimum but install the BTE modpack, it's preferable.
7757

78-
## Usage
58+
##
59+
60+
# Installation
7961

80-
The only functionality is currently the railway tracks outline generation.
62+
1. Download the [Rhino Javacsript interpreter](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino) for Java,
63+
which you can get from [here](https://github.com/mozilla/rhino/releases/download/Rhino1_7_12_Release/rhino-1.7.12.zip).
64+
Open the zip file, go to `/lib` and move `rhino-1.7.12.jar` (or newer) to your `mods` Minecraft folder.
65+
(Usually `C:\Users\[USERNAME]\Twitch\Minecraft\Instances\Build The Earth modpack\mods` on Windows)
8166

82-
**[NOTE] The current way of doing things is a bit messy, to convert latitude and longitude to Minecraft coordinates a script
83-
is run to enter commands very quickly in the game chat. We should find a way to get these coordinates with a function.
84-
I already tried to translate the [java function](https://github.com/orangeadam3/terra121/blob/68ff27735ba447d6c9c017463e890eb90422569c/src/main/java/io/github/terra121/projection/ModifiedAirocean.java)
85-
into javascript [here](./draw/tpll/tpll-node.js). It doesn't work,
86-
if someone finds the problem I would be very grateful to him !**
67+
2. Download the latest version of BTE-scripts [here](https://github.com/oganexon/BTE-tools/releases) and place the `craftscripts` folder in `/config/worldedit`.
8768

88-
### Installing the script
69+
3. (Recommended) Change the value of `scripting-timeout` to `30000` or higher in `/config/worldedit`. (`3000` ms by default)
8970

90-
Before you start using CraftScripts, you’ll have to install the [Rhino JavaScript engine](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino).
91-
A direct link to the download is [here](https://github.com/mozilla/rhino/releases/download/Rhino1_7_12_Release/rhino-1.7.12.zip).
92-
Open the zip file, and extract `rhino-1.7.12.jar` (or newer).
93-
Move `rhino-1.7.12.jar` to the plugins/ or plugins/WorldEdit folder (on Bukkit) or the mods folder (other platforms).
9471

95-
Once you have the JS engine installed, drop `draw.js` in the craftscripts folder (in the WorldEdit config folder - either plugins/WorldEdit or
96-
config/WorldEdit depending on platform).
9772

98-
### Generating data using Overpass Turbo
73+
## Usage
9974

100-
By using turbo overpass, you can view the selection directly. This is the recommended method.
75+
```bash
76+
/cs <COMMAND> [ARGS]
77+
```
10178

102-
Use the [region request](http://overpass-turbo.eu/s/TwW) or the [name request](http://overpass-turbo.eu/s/TwY)
79+
These are WorldEdit scripts, if blocks are modified you have access to `//undo`.
10380

104-
The region request is used to select every rail in the bounding box.
81+
- **list** : Lists all available commands.
82+
- **tpll** : Replaces the tpll command since permissions can be a problem.
83+
- **tpdms** : Same as tpll but takes `degrees minutes seconds` (such as `47°35'6.32"N 6°53'50.06"E` ).
84+
- **draw** : Traces any imported shape of an OpenStreetMap query - railroads, roads, etc.
10585

106-
The name request is used to select every rail of a defined line.
86+
Do you need another function? Request it [here](https://github.com/oganexon/BTE-tools/issues).
10787

108-
To find a railway name, right click near the rails and click on `Query features`
10988

110-
![](images/name1.png)
11189

112-
Then, click on the desired rail
90+
### list
11391

114-
![](images/name2.png)
92+
```bash
93+
/cs list
94+
```
95+
Lists all available commands.
11596

116-
And finally, get the name.
11797

118-
![](images/name3.png)
11998

120-
To get the correct data, click on `export` then `download/copy as GeoJSON`.
99+
### tpll
121100

122-
### Generating data just with coordinates
101+
```bash
102+
/cs tpll <latitude> <longitude> [altitude]
103+
```
104+
Replaces the tpll command since permissions can be a problem.
105+
This modified version will take you to the highest block even if you've build already.
106+
You don't need to remove the comma if there is one when you copy the coordinates.
123107

124-
Go on [OpenStreetMap](https://www.openstreetmap.org/) and select the region of interest.
108+
Examples :
125109

126-
Take the coordinates of the lowest point on the right and the highest point on the left.
110+
```bash
111+
/cs tpll 47.58523 6.89725
112+
/cs tpll 47.58523, 6.89725, 370
113+
```
127114

128-
Put them in the config file (read the next paragraph).
129115

130-
### Converting data
131116

132-
Go to `./draw/src`
117+
### tpdms
133118

134-
```sh
135-
cd ./draw/src
119+
```bash
120+
/cs tpdms <latitude> <longitude> [altitude]
136121
```
122+
Same as tpll but takes `degrees minutes seconds`
123+
This modified version will take you to the highest block even if you've build already.
124+
You don't need to remove the comma if there is one when you copy the coordinates.
137125

138-
Configure `config.json`:
139-
140-
```json
141-
{
142-
"block": "iron_block",
143-
"logFile": "C:\\Users\\[USERNAME]\\Twitch\\Minecraft\\Instances\\Build The Earth modpack\\logs\\latest.log",
144-
"output": "output.json",
145-
"input": "input.json",
146-
"overpass": false, // if true, will request data to the API with the following parameters
147-
"requestType": "region",
148-
"region": "47.6008,6.9398,47.6131,6.9569", // Coordinates retrieved with OpenStreetMap
149-
"name": "LGV Rhin-Rhône",
150-
"feature": "rails" // More to come
151-
}
126+
Examples :
127+
128+
```bash
129+
/cs tpdms 47°35\'6.32"N 6°53\'50.06"E
130+
/cs tpdms 47°35\'6.32"N, 6°53\'50.06"E, 370
152131
```
153132

154-
If you used Overpass Turbo, put the geoJSON data in `draw/input.json`
155133

156-
You're all set. Open Minecraft, it will be used to convert coordinates.
157134

158-
```sh
159-
node init.js
135+
### draw
136+
137+
```bash
138+
/cs draw <file> <block> [options]
160139
```
140+
Traces any imported shape of an OpenStreetMap query - railroads, roads, etc.
161141

162-
Then, run convert.exe and select `temp.json`. You're asked to put a delay, if your computer is quite slow you should increase it.
163-
After the warning, you have 2 seconds to click on Minecraft, then it will enter commands automatically.
142+
Options :
143+
- **u** (up): Draw a block above
164144

165-
When finished, run:
145+
Setup :
146+
- Create a `drawings` folder inside `/config/worldedit`.
147+
- Get a geoJSON file of valid tracings / OR
148+
- Choose one of the following links:
149+
- [Rails - bounding box](http://overpass-turbo.eu/s/TwW) (Select the desired region using the map)
150+
- [Rails - name](http://overpass-turbo.eu/s/TwY) (Replace with a specific railroad name) [(find a railroad name)](#find-a-railroad-name)
151+
- Click `Run` > `Export` > `download/copy as GeoJSON`
152+
- Place the file in the `drawings` folder.
166153

167-
```sh
168-
node generate.js
154+
Examples :
155+
156+
```bash
157+
/cs draw rails1 iron_block
158+
/cs draw file3 stone u
169159
```
170160

171-
The process is over, copy `output.json` to `/drawings` in the `/worldedit` folder.
172161

173-
### Run the script in game
174162

175-
```sh
176-
/cs draw output [block] [options]
177-
```
163+
## Find a railroad name
164+
165+
To find a railway name, right click near the rails and click on `Query features`
166+
167+
![](images/rails1.png)
168+
169+
Then, click on the desired rail
170+
171+
![](images/rails2.png)
172+
173+
And finally, get the name.
174+
175+
![](images/rails3.png)
176+
178177

179-
It should take a few seconds depending on data size. You should put `scripting-timeout` to a higher value like `30000`
180-
in `worldedit.properties` to avoid timeout since it takes longer to compute the first time.
181178

182179
## Roadmap
183180

184181
See the [open issues](https://github.com/oganexon/BTE-tools/issues) for a list of proposed features (and known issues).
185182

186183

187184

188-
<!-- CONTRIBUTING -->
189185
## Contributing
190186

191187
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
@@ -198,14 +194,12 @@ Contributions are what make the open source community such an amazing place to b
198194

199195

200196

201-
<!-- LICENSE -->
202197
## License
203198

204199
Distributed under the MIT License. See `LICENSE` for more information.
205200

206201

207202

208-
<!-- CONTACT -->
209203
## Contact
210204

211205
Oganexon#2001 - Discord

images/name1.png

-143 KB
Binary file not shown.

images/name2.png

-22.9 KB
Binary file not shown.

images/name3.png

-34.2 KB
Binary file not shown.

images/rails1.png

19.7 KB
Loading

images/rails2.png

11.7 KB
Loading

images/rails3.png

10.1 KB
Loading

src/draw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* global importPackage Packages context player argv BufferedReader FileReader Vector */
2-
const getProjection = require('./projections/projection')
2+
const getProjection = require('./getProjection')
33

44
importPackage(Packages.java.io)
55
importPackage(Packages.java.awt)
File renamed without changes.

0 commit comments

Comments
 (0)