R3EXS 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README_EN.md CHANGED
@@ -1,260 +1,260 @@
1
- # R3EXS
2
-
3
- RGSS3_Extract_Strings_Tool
4
-
5
- <p style="text-align: center;">A tool for extracting and translating strings from the RGSS3 game engine.</p>
6
-
7
- [**English**](README_EN.md)&nbsp;&nbsp;&nbsp;[**简体中文**](README.md)
8
-
9
- ## Contents
10
-
11
- - [Synopsis](#synopsis)
12
- - [Features](#features)
13
- - [Function List](#function-list)
14
- - [Installation](#installation)
15
- - [Usage](#usage)
16
- - [Project Build](#project-build)
17
- - [Documentation](#documentation)
18
- - [Links](#links)
19
-
20
- ## [Synopsis](#contents)
21
-
22
- R3EXS is a gem built using Ruby, designed to extract and translate strings in RGSS3 games.
23
-
24
- ## [Features](#contents)
25
-
26
- It uses [Prism](https://github.com/ruby/prism) to accurately extract strings and symbols from Ruby scripts.
27
-
28
- ## [Function List](#contents)
29
-
30
- 1. [Unpack Game.rgss3a file](#unpack-game-rgss3a-file)
31
- 2. [Serialize rvdata2 files to JSON file](#serialize-rvdata2-files-to-json-file)
32
- 3. [Deserialize JSON files to rvdata2 file](#deserialize-json-files-to-rvdata2-file)
33
- 4. [Extract all strings](#extract-all-strings)
34
- 5. [Inject all strings](#inject-all-strings)
35
-
36
- ## [Installation](#contents)
37
-
38
- ### Install using RubyGems
39
-
40
- 1. Install [Ruby](https://www.ruby-lang.org/en/) (make sure to install Devkit to support compiling C extensions)
41
- 2. Install the [R3EXS](https://rubygems.org/gems/R3EXS) gem
42
-
43
- ```bash
44
- gem install R3EXS
45
- ```
46
-
47
- ### Download executable file directly
48
-
49
- Click to download [R3EXS.exe](https://github.com/LuoTat/R3EXS/releases)
50
-
51
- Since the R3EXS.exe file is packaged using [Ocran](https://github.com/Largo/ocran) and [Tebako](https://github.com/tamatebako/tebako)
52
-
53
- The `Windows` environment provides `R3EXS-windows_Ocran` and `R3EXS-windows_Tebako`
54
-
55
- The `Linux (GLIBC >= 2.31)` environment provides `R3EXS-linux_Tebako`
56
-
57
- it will extract the Ruby environment the first time it runs, so the first run may be slower.
58
-
59
- ## [Usage](#contents)
60
-
61
- The following commands assume they are run in the game’s root directory, ensuring the `./Game.rgss3a` file exists or has already been unpacked into the `./Data` folder.
62
-
63
- ~~If you enjoy a crazy amount of console output or feel like the execution is too fast~~, please enable the `--verbose` option.
64
-
65
- ### [Unpack Game.rgss3a file](#function-list)
66
-
67
- ```bash
68
- NAME
69
- decrypt - Decrypt the Game.rgss3a file
70
-
71
- SYNOPSIS
72
-
73
- R3EXS [global options] decrypt [command options] <Game.rgss3a file path>
74
-
75
- COMMAND OPTIONS
76
- -o, --output_dir=DIRECTORY - The *.rvdata2 output dir (default: ./)
77
- ```
78
-
79
- Example code:
80
-
81
- ```bash
82
- R3EXS decrypt ./Game.rgss3a
83
- ```
84
-
85
- ### [Serialize rvdata2 files to JSON file](#function-list)
86
-
87
- ```bash
88
- NAME
89
- rvdata2_json - Serialize rvdata2 files into JSON
90
-
91
- SYNOPSIS
92
-
93
- R3EXS [global options] rvdata2_json [command options] <the *.rvdata2 dir>
94
-
95
- COMMAND OPTIONS
96
- -c, --[no-]complete - Enable complete serialization
97
- -n, --[no-]with_notes - Enable notes attribute serialization
98
- -o, --output_dir=DIRECTORY - The *.json output dir (default: ./JSON)
99
- -s, --[no-]with_scripts - Enable Scripts.rvdata2 serialization
100
- ```
101
-
102
- Example code:
103
-
104
- ```bash
105
- // Serialize only translatable parts
106
- R3EXS rvdata2_json ./Data
107
-
108
- // Complete serialization
109
- R3EXS rvdata2_json -c ./Data
110
- ```
111
-
112
- ### [Deserialize JSON files to rvdata2 file](#function-list)
113
-
114
- ```bash
115
- NAME
116
- json_rvdata2 - Deserialize JSON files back into rvdata2
117
-
118
- SYNOPSIS
119
-
120
- R3EXS [global options] json_rvdata2 [command options] <the *.json dir>
121
-
122
- COMMAND OPTIONS
123
- -c, --[no-]complete - Enable complete deserialization
124
- -o, --output_dir=DIRECTORY - The NEW *.rvdata2 output dir (default: ./Data_NEW)
125
- -r, --original_dir=DIRECTORY - The ORIGINAL *.rvdata2 dir (default: ./Data)
126
- -s, --[no-]with_scripts - Enable Scripts JSON deserialization
127
- ```
128
-
129
- Example code:
130
-
131
- ```bash
132
- // If --complete was not enabled in rvdata2_json
133
- // Provide --original_dir or ensure ./Data folder exists in the current directory
134
- R3EXS json_rvdata2 ./JSON
135
-
136
- // If --complete was enabled in rvdata2_json
137
- // --original_dir is not required
138
- R3EXS json_rvdata2 -c ./JSON
139
- ```
140
-
141
- ### [Extract all strings](#function-list)
142
-
143
- ```bash
144
- NAME
145
- ex_strings - Extract all strings
146
-
147
- SYNOPSIS
148
-
149
- R3EXS [global options] ex_strings [command options] <the *.json dir>
150
-
151
- COMMAND OPTIONS
152
- -o, --output_dir=DIRECTORY - The ManualTransFile.json or ManualTransFile_scripts.json output dir (default: ./)
153
- -p, --[no-]with_scripts_separate - Enable Scripts extraction into a separate ManualTransFile_scripts.json
154
- -s, --[no-]with_scripts - Enable Scripts extraction
155
- -y, --[no-]with_symbol - Enable Symbol extraction in Scripts extraction
156
- ```
157
-
158
- Example code:
159
-
160
- ```bash
161
- // Do not extract Scripts
162
- R3EXS ex_strings ./JSON
163
-
164
- // Extract Scripts
165
- R3EXS ex_strings -s ./JSON
166
-
167
- // Extract Scripts and separate them into ManualTransFile_scripts.json
168
- R3EXS ex_strings -s -p ./JSON
169
- ```
170
-
171
- ### [Inject all strings](#function-list)
172
-
173
- ```bash
174
- NAME
175
- in_strings - Inject all strings
176
-
177
- SYNOPSIS
178
-
179
- R3EXS [global options] in_strings [command options] <the *.json dir>
180
-
181
- COMMAND OPTIONS
182
- -m, --manualtransfile_path=FILE - The ManualTransFile.json path (default: ./ManualTransFile.json)
183
- -o, --output_dir=DIRECTORY - The NEW *.json output dir (default: ./JSON_NEW)
184
- -s, --[no-]with_scripts - Enable Scripts Injection
185
- ```
186
-
187
- Example code:
188
-
189
- ```bash
190
- // Do not inject into Scripts
191
- R3EXS in_strings ./JSON
192
-
193
- // Inject into Scripts
194
- R3EXS in_strings -s ./JSON
195
- ```
196
-
197
- ---
198
-
199
- For more information, use
200
-
201
- ```bash
202
- R3EXS help
203
- ```
204
-
205
- ## [Project Build](#contents)
206
-
207
- To build and run the project, first clone the entire repository:
208
-
209
- ```bash
210
- git clone git@github.com:LuoTat/R3EXS.git
211
- ```
212
-
213
- Then use `bundle` to install dependencies:
214
-
215
- ```bash
216
- bundle install
217
- ```
218
-
219
- Finally, compile the C extension:
220
-
221
- ```bash
222
- rake compile
223
- ```
224
-
225
- ---
226
-
227
- Build the local documentation:
228
-
229
- ```bash
230
- yardoc
231
- ```
232
-
233
- Build the `R3EXS_Ocran.exe` file:
234
-
235
- ```bash
236
- rake ocran
237
- ```
238
-
239
- View all rake tasks:
240
-
241
- ```bash
242
- rake -T
243
- ```
244
-
245
- ## [Documentation](#contents)
246
-
247
- [R3EXS Api Documentation](https://rubydoc.info/gems/R3EXS)
248
-
249
- ## [Links](#contents)
250
-
251
- - [oj](https://github.com/ohler55/oj)
252
- - [gli](https://github.com/davetron5000/gli)
253
- - [Prism](https://github.com/ruby/prism)
254
- - [Ocran](https://github.com/Largo/ocran)
255
- - [Tebako](https://github.com/tamatebako/tebako)
256
- - [RGSS3](https://github.com/taroxd/RGSS3)
257
- - [rvdata2json](https://github.com/DICE2000/rvdata2json)
258
- - [VX-Ace-Translator](https://github.com/AhmedAhmedEG/VX-Ace-Translator)
259
- - [RPGMakerDecrypter](https://github.com/uuksu/RPGMakerDecrypter)
260
- - [RPGMaker VX Ace F1-Manual](https://miaowm5.github.io/RMVA-F1)
1
+ # R3EXS
2
+
3
+ RGSS3_Extract_Strings_Tool
4
+
5
+ <p style="text-align: center;">A tool for extracting and translating strings from the RGSS3 game engine.</p>
6
+
7
+ [**English**](README_EN.md)&nbsp;&nbsp;&nbsp;[**简体中文**](README.md)
8
+
9
+ ## Contents
10
+
11
+ - [Synopsis](#synopsis)
12
+ - [Features](#features)
13
+ - [Function List](#function-list)
14
+ - [Installation](#installation)
15
+ - [Usage](#usage)
16
+ - [Project Build](#project-build)
17
+ - [Documentation](#documentation)
18
+ - [Links](#links)
19
+
20
+ ## [Synopsis](#contents)
21
+
22
+ R3EXS is a gem built using Ruby, designed to extract and translate strings in RGSS3 games.
23
+
24
+ ## [Features](#contents)
25
+
26
+ It uses [Prism](https://github.com/ruby/prism) to accurately extract strings and symbols from Ruby scripts.
27
+
28
+ ## [Function List](#contents)
29
+
30
+ 1. [Unpack Game.rgss3a file](#unpack-gamergss3a-file)
31
+ 2. [Serialize rvdata2 files to JSON file](#serialize-rvdata2-files-to-json-file)
32
+ 3. [Deserialize JSON files to rvdata2 file](#deserialize-json-files-to-rvdata2-file)
33
+ 4. [Extract all strings](#extract-all-strings)
34
+ 5. [Inject all strings](#inject-all-strings)
35
+
36
+ ## [Installation](#contents)
37
+
38
+ ### Install using RubyGems
39
+
40
+ 1. Install [Ruby](https://www.ruby-lang.org/en) (make sure to install Devkit to support compiling C extensions)
41
+ 2. Install the [R3EXS](https://rubygems.org/gems/R3EXS) gem
42
+
43
+ ```bash
44
+ gem install R3EXS
45
+ ```
46
+
47
+ ### Download executable file directly
48
+
49
+ Click to download [R3EXS.exe](https://github.com/LuoTat/R3EXS/releases)
50
+
51
+ Since the R3EXS.exe file is packaged using [Ocran](https://github.com/Largo/ocran) and [Tebako](https://github.com/tamatebako/tebako)
52
+
53
+ The `Windows` environment provides `R3EXS-windows_Ocran` and `R3EXS-windows_Tebako`
54
+
55
+ The `Linux (GLIBC >= 2.31)` environment provides `R3EXS-linux_Tebako`
56
+
57
+ it will extract the Ruby environment the first time it runs, so the first run may be slower.
58
+
59
+ ## [Usage](#contents)
60
+
61
+ The following commands assume they are run in the game’s root directory, ensuring the `./Game.rgss3a` file exists or has already been unpacked into the `./Data` folder.
62
+
63
+ ~~If you enjoy a crazy amount of console output or feel like the execution is too fast~~, please enable the `--verbose` option.
64
+
65
+ ### [Unpack Game.rgss3a file](#function-list)
66
+
67
+ ```bash
68
+ NAME
69
+ decrypt - Decrypt the Game.rgss3a file
70
+
71
+ SYNOPSIS
72
+
73
+ R3EXS [global options] decrypt [command options] <Game.rgss3a file path>
74
+
75
+ COMMAND OPTIONS
76
+ -o, --output_dir=DIRECTORY - The *.rvdata2 output dir (default: ./)
77
+ ```
78
+
79
+ Example code:
80
+
81
+ ```bash
82
+ R3EXS decrypt ./Game.rgss3a
83
+ ```
84
+
85
+ ### [Serialize rvdata2 files to JSON file](#function-list)
86
+
87
+ ```bash
88
+ NAME
89
+ rvdata2_json - Serialize rvdata2 files into JSON
90
+
91
+ SYNOPSIS
92
+
93
+ R3EXS [global options] rvdata2_json [command options] <the *.rvdata2 dir>
94
+
95
+ COMMAND OPTIONS
96
+ -c, --[no-]complete - Enable complete serialization
97
+ -n, --[no-]with_notes - Enable notes attribute serialization
98
+ -o, --output_dir=DIRECTORY - The *.json output dir (default: ./JSON)
99
+ -s, --[no-]with_scripts - Enable Scripts.rvdata2 serialization
100
+ ```
101
+
102
+ Example code:
103
+
104
+ ```bash
105
+ // Serialize only translatable parts
106
+ R3EXS rvdata2_json ./Data
107
+
108
+ // Complete serialization
109
+ R3EXS rvdata2_json -c ./Data
110
+ ```
111
+
112
+ ### [Deserialize JSON files to rvdata2 file](#function-list)
113
+
114
+ ```bash
115
+ NAME
116
+ json_rvdata2 - Deserialize JSON files back into rvdata2
117
+
118
+ SYNOPSIS
119
+
120
+ R3EXS [global options] json_rvdata2 [command options] <the *.json dir>
121
+
122
+ COMMAND OPTIONS
123
+ -c, --[no-]complete - Enable complete deserialization
124
+ -o, --output_dir=DIRECTORY - The NEW *.rvdata2 output dir (default: ./Data_NEW)
125
+ -r, --original_dir=DIRECTORY - The ORIGINAL *.rvdata2 dir (default: ./Data)
126
+ -s, --[no-]with_scripts - Enable Scripts JSON deserialization
127
+ ```
128
+
129
+ Example code:
130
+
131
+ ```bash
132
+ // If --complete was not enabled in rvdata2_json
133
+ // Provide --original_dir or ensure ./Data folder exists in the current directory
134
+ R3EXS json_rvdata2 ./JSON
135
+
136
+ // If --complete was enabled in rvdata2_json
137
+ // --original_dir is not required
138
+ R3EXS json_rvdata2 -c ./JSON
139
+ ```
140
+
141
+ ### [Extract all strings](#function-list)
142
+
143
+ ```bash
144
+ NAME
145
+ ex_strings - Extract all strings
146
+
147
+ SYNOPSIS
148
+
149
+ R3EXS [global options] ex_strings [command options] <the *.json dir>
150
+
151
+ COMMAND OPTIONS
152
+ -o, --output_dir=DIRECTORY - The ManualTransFile.json or ManualTransFile_scripts.json output dir (default: ./)
153
+ -p, --[no-]with_scripts_separate - Enable Scripts extraction into a separate ManualTransFile_scripts.json
154
+ -s, --[no-]with_scripts - Enable Scripts extraction
155
+ -y, --[no-]with_symbol - Enable Symbol extraction in Scripts extraction
156
+ ```
157
+
158
+ Example code:
159
+
160
+ ```bash
161
+ // Do not extract Scripts
162
+ R3EXS ex_strings ./JSON
163
+
164
+ // Extract Scripts
165
+ R3EXS ex_strings -s ./JSON
166
+
167
+ // Extract Scripts and separate them into ManualTransFile_scripts.json
168
+ R3EXS ex_strings -s -p ./JSON
169
+ ```
170
+
171
+ ### [Inject all strings](#function-list)
172
+
173
+ ```bash
174
+ NAME
175
+ in_strings - Inject all strings
176
+
177
+ SYNOPSIS
178
+
179
+ R3EXS [global options] in_strings [command options] <the *.json dir>
180
+
181
+ COMMAND OPTIONS
182
+ -m, --manualtransfile_path=FILE - The ManualTransFile.json path (default: ./ManualTransFile.json)
183
+ -o, --output_dir=DIRECTORY - The NEW *.json output dir (default: ./JSON_NEW)
184
+ -s, --[no-]with_scripts - Enable Scripts Injection
185
+ ```
186
+
187
+ Example code:
188
+
189
+ ```bash
190
+ // Do not inject into Scripts
191
+ R3EXS in_strings ./JSON
192
+
193
+ // Inject into Scripts
194
+ R3EXS in_strings -s ./JSON
195
+ ```
196
+
197
+ ---
198
+
199
+ For more information, use
200
+
201
+ ```bash
202
+ R3EXS help
203
+ ```
204
+
205
+ ## [Project Build](#contents)
206
+
207
+ To build and run the project, first clone the entire repository:
208
+
209
+ ```bash
210
+ git clone git@github.com:LuoTat/R3EXS.git
211
+ ```
212
+
213
+ Then use `bundle` to install dependencies:
214
+
215
+ ```bash
216
+ bundle install
217
+ ```
218
+
219
+ Finally, compile the C extension:
220
+
221
+ ```bash
222
+ rake compile
223
+ ```
224
+
225
+ ---
226
+
227
+ Build the local documentation:
228
+
229
+ ```bash
230
+ yardoc
231
+ ```
232
+
233
+ Build the `R3EXS_Ocran.exe` file:
234
+
235
+ ```bash
236
+ rake ocran
237
+ ```
238
+
239
+ View all rake tasks:
240
+
241
+ ```bash
242
+ rake -T
243
+ ```
244
+
245
+ ## [Documentation](#contents)
246
+
247
+ [R3EXS Api Documentation](https://rubydoc.info/gems/R3EXS)
248
+
249
+ ## [Links](#contents)
250
+
251
+ - [oj](https://github.com/ohler55/oj)
252
+ - [gli](https://github.com/davetron5000/gli)
253
+ - [Prism](https://github.com/ruby/prism)
254
+ - [Ocran](https://github.com/Largo/ocran)
255
+ - [Tebako](https://github.com/tamatebako/tebako)
256
+ - [RGSS3](https://github.com/taroxd/RGSS3)
257
+ - [rvdata2json](https://github.com/DICE2000/rvdata2json)
258
+ - [VX-Ace-Translator](https://github.com/AhmedAhmedEG/VX-Ace-Translator)
259
+ - [RPGMakerDecrypter](https://github.com/uuksu/RPGMakerDecrypter)
260
+ - [RPGMaker VX Ace F1-Manual](https://miaowm5.github.io/RMVA-F1)
data/bin/R3EXS CHANGED
@@ -32,9 +32,11 @@ class App
32
32
  begin
33
33
  R3EXS.rgss3a_rvdata2(args[0], options[:output_dir], global_options[:verbose])
34
34
  puts "#{R3EXS::Utils::GREEN_COLOR}All rvdata2 files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
35
- rescue TypeError => e
36
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
37
- puts 'Please make sure the rgss3a file is not corrupted.'
35
+ rescue R3EXS::RGSS3AFileError => e
36
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
37
+ $stderr.puts 'Unknown RGSS3A file decrypted type'
38
+ rescue SystemCallError => e
39
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.class}: #{e.message}#{R3EXS::Utils::RESET_COLOR}"
38
40
  end
39
41
  end
40
42
  end
@@ -214,4 +216,4 @@ class App
214
216
  end
215
217
  end
216
218
 
217
- exit App.run(ARGV)
219
+ exit App.run(ARGV)