此脚本用于从 ETS2 地图文件中提取 Mod 名称。它的工作原理是在地图文件中搜索字符串 “city/country/ferryname”,然后提取其后面的文本。该脚本将输出在地图文件中找到的所有 mod 名称的列表。
- 首先,请确保安装了python并将其添加到环境变量中
- 然后,从地图mod中提取所需的文件
- 使用VSCode或Notepad++打开脚本并进行自定义
- 修改需要提取的文件路径
- 修改需要提取的字段前面的字符(尽可能详细,方便定位),
- 修改需要保存输出的文件路径
- 在脚本所在文件夹右键
在终端中打开
- 输入
python city_name_extract_info
并按回车 - 打开输出的文件并检查其格式
- 根据你的语言修改
val
字段即可 - country和ferry按照此方法重复即可
脚本文件在源代码的src
文件夹以及Release的script.7z
中都含有
This script is used to extract the mod names from ETS2 map files. It works by searching for the string "city/country/ferryname" in the map file and then extracting the text that comes after it. The script will output a list of all the mod names found in the map file.
- Start by installing python and adding it to the environment variables
- Extract the files you need to extract from the map mod folder
- Use VSCode or Notepad++ to open the script and customize the script
- Modify the path of the file to be extracted
- the characters in front of the field to be extracted (as detailed as possible, easy to locate),
- modify the path of the file to be saved as output
- Right click in the folder where the script is located
Open in a terminal
- Type
python city_name_extract_info
and press enter - Open the output file and check its formatting
- Just modify the
val
field according to your language - Country and ferry can be repeated according to this method
The script files are contained in the src
folder of the source code and in script.7z
of the Release