{%hackmd HkOsb-H_D %} # Building 制定版 Godot Source Code **目錄** [TOC] ## 目的 :::success 原生引擎未提供龍骨相關工具,需要依靠第三方插件。 - 打包 制定版 GodotEngine。 - 制定版 HTML5 調試 & export 需求。 ::: - <font color="#f00">nas 已有 GodotEngine & templates 3.5 龍骨版本,關注 `調試godotEngineHTML5` 即可。</font> - nas : `\\nas\dm2\99.Tools\Godot\godot.v3.5\` - 調試 HTML5 需要完成此步驟 - [調試godotEngineHTML5](#調試godotEngineHTML5) - 如需自己產版本請依序向下閱讀,步驟有順序性。 - **查閱資料 :** - [官網-AppBuild](https://docs.godotengine.org/zh_TW/stable/development/compiling/compiling_for_windows.html) 、 [官網-HTML Build](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_web.html#building-export-templates) 、 [EngineBuild 參考步驟](https://www.youtube.com/watch?v=VIPe51aEIjE) --- ## 下載 Godot - Source Code git : https://github.com/godotengine/godot/tree/master ## 下載 制定版本 - 龍骨插件 1. clone 指定放入 `...\godot\modules` folder 2. git : https://github.com/mauville-technologies/godot_dragonbones.git 3. 測試龍骨Project : `\\nas\dm2\99.Tools\Godot\dragonTest\scenesChange` - [龍骨資訊連結](https://ozzadar.itch.io/godot-dragonbones-3-3-3) - 作者有提供 Dokerfile 使用。 ## 安裝 python 3.5+ ``` 安裝目的 : python 為 GodotSourceCode Building GodotEngine 指定語言。 ``` 1. https://www.python.org/downloads/ 2. 環境變數Path新增 python 路徑 - 參考位置 : `C:\Users\name\AppData\Local\Programs\Python\Python39`  ## 安裝 scons ``` 安裝目的 : scons 為 python makefile 工具。 ---- 補充 : scons 是一個開放源代碼,以 Python 語言編寫的下一代的程序建造工具,功能上類似於make。 SConstruct 文件就內容而言是Python腳本,scons 讀入它時,會把腳本的命令都執行一遍, 但具體編譯過程則有 scons 自己相機而定。 ``` 1. Terminal : `pip install SCons` 2. 環境變數Path新增 scons 路徑 (將會出現在python路徑資料夾內) - 參考位置 : `Python39\Scripts\scons.exe`  ## 安裝 emsdk ``` 安裝目的 : emsdk 為 GodotSourceCode Building HTML5 templates 的轉譯工具。 ---- 補充 : emsdk 把 C/C++ 編譯成 asm.js 以及 WebAssembly 的工具集。 ``` 1. [emsdk官網](https://emscripten.org/docs/getting_started/downloads.html) 2. Terminal : ``` git clone https://github.com/emscripten-core/emsdk.git cd emsdk ./emsdk install latest ./emsdk activate latest ``` - 需注意若為Windows環境且Visual Studio為2017版,請將 ./emsdk install latest 指令改為 emsdk install latest –vs2017 3. Terminal : `emsdk_env --build=Release` 4. 環境變數Path新增 emsdk 路徑 - 參考位置 : `C:\Users\name\emsdk\upstream\emscripten` - global指令查證版本 : `emcc -v`  ## Building GodotEngine.exe - **nas已有制定版本** : \\\nas\dm2\99.Tools\Godot\godot.v3.4.5\godot.v3.4.5-dragonbones.exe 1. 位於 godot 專案內。 2. Terminal : `scons platform=windows vsproj=yes target=release_debug` 3. windows 版本將會在 `godot/bin` folder * <font color="#f00">補充 : 編譯者 Visual Studio 2019 版本</font> * [官網資料](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html#creating-windows-export-templates) ## Building HTML5 templates - **nas已有3.4.5龍骨 版本** : \\\nas\dm2\99.Tools\Godot\godot.v3.4.5\templates-dragonbones 1. 位於 godot 專案內。 2. 修改 godot Source Code [修改資訊來自](https://github.com/mauville-technologies/godot_dragonbones) - `godot\platform\javascript\detect.py` ```diff= def configure(env): ... - env.Append(CCFLAGS=["-fno-exceptions", "-fno-rtti"]) + env.Append(CCFLAGS=["-fno-exceptions"]) ... ``` - `godot\platform\android\detect.py` ```diff= def configure(env): ... - env.Append(CXXFLAGS=["-fno-rtti", "-fno-exceptions"]) + env.Append(CXXFLAGS=["-fno-exceptions"]) ... ``` 4. **Terminal** : `scons platform=javascript tools=no target=release` - 產出 : godot.javascript.opt.zip 5. **Terminal** : `scons platform=javascript tools=no target=release_debug` - 產出 : godot.javascript.opt.debug.zip 6. templates 將會產在 `godot/bin` folder 7. **Terminal** : 修改檔案名稱(不改名也可以正常使用) ``` mv bin/godot.javascript.opt.zip bin/webassembly_release.zip mv bin/godot.javascript.opt.debug.zip bin/webassembly_gdnative_debug.zip ``` * [Terminal官網資料](https://docs.godotengine.org/en/stable/development/compiling/compiling_for_web.html#building-export-templates) ## 調試godotEngineHTML5 - **nas已有3.4.5龍骨 版本** : \\\nas\dm2\99.Tools\Godot\godot.v3.5\templates-dragonbonesdragonbones - templates 會辨認 GodotEngine 版本號,不同版本無法共用。 1. GodotEngine/Project/Export/Add/HTML5 2. HTML5/Options/Custom Template - Debug : `webassembly_debug.zip` - Release : `webassembly_release.zip`  --- ###### tags: `godot`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up