Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Instructions #7

Open
CeruleanSky opened this issue Jun 26, 2023 · 0 comments
Open

Windows Instructions #7

CeruleanSky opened this issue Jun 26, 2023 · 0 comments

Comments

@CeruleanSky
Copy link

Hello, I never ran a node project before, so it was a bit of a time trying to make sense of how to get this running locally, especially on windows, as I wanted to have it running offline where internet was spotty.
While these notes are quite rough, I figured I'd share them as they might offer a head start to somebody trying to run this themselves and perhaps can be added to the readme with some revision.

The only problem is I don't know how to generate the map webp for the game_files for objmap-totk , I am guessing they come from romfs\UI\Map but they were converted somehow and seem to be divided into numeric folders.


Clone the radar-totk project or download the zip file.


bump better-sqlite3 version in package.json to one that has the fixes for compiling it, the below works
"better-sqlite3": "^8.4.0",
"@types/better-sqlite3": "^7.6.4",

replace all strings /') with ') , removing the forward slash inside built.ts as filepath in windows uses \


Get node, ensure "Automatically install the necessary tools" on the "Tools for Native Modules" . I used for node v20.3.1-win-x64 extract and ensure it is on the path.

run npm install --include=dev

set NODE_OPTIONS=--openssl-legacy-provider
set Path=%CD%\node_modules\.bin;%PATH% or prefix commands with npx thecommand

Extract romfs including updates from your game and put it in the radar-totk directory , radar-totk\romfs

get zstd from https://github.com/facebook/zstd/releases and put in path
zstd -d romfs\Pack\ZsDic.pack.zs -o ZsDic.pack
??? unpack ZsDic.pack ??? (I think I used Switch-Toolbox, but don't remember).

cd romfs\Ecosystem\FieldMapArea
zstd -D ..\..\Pack\zs.zsdic -d Cave.beco.zs -o Cave.beco
zstd -D ..\..\Pack\zs.zsdic -d Ground.beco.zs -o Ground.beco
zstd -D ..\..\Pack\zs.zsdic -d MinusField.beco.zs -o MinusField.beco
zstd -D ..\..\Pack\zs.zsdic -d Sky.beco.zs -o Sky.beco

Banc:
Use the below to do some recursive extraction for static and dynamic bcett files with zstd, the %~dpn is to remove the file extension
The findstr version is to skip files with bcett in name and use the other zstd dic , this is needed for the recylebox
Maybe use https://github.com/TotkMods/Totk.ZStdTool or switch toolbox instead.
Then finally use byml_to_yml to convert the files

pip install byml or python -m pip install byml and ensure your python install's python_dir\scripts is on path.

cd romfs\Banc
for /R %f in (*static*.bcett.byml.zs) do zstd -D ..\Pack\bcett.byml.zsdic -d "%f" -o "%~dpnf"
for /R %f in (*dynamic*.bcett.byml.zs) do zstd -D ..\Pack\bcett.byml.zsdic -d "%f" -o "%~dpnf"
for /f "delims=" %f in ('2^>nul dir /b /s byml.zs ^| findstr /vi bcett')do zstd -D ..\Pack\zs.zsdic -d "%f" -o "%~dpnf"
for /R %f in (*.byml) do byml_to_yml %f !!.yml

Seems only Dynamic, Static, and recyclebox is used at this time.

go back to project root

ts-node build.ts -b romfs\Ecosystem\FieldMapArea -e tools -d romfs\Banc

Then finally to launch:
ts-node-dev --respawn --transpile-only ./app/app.ts
or
node --enable-source-maps ./app/app.js


These are partial instructions for objmap-totk
Open a new console and clone objmap-totk
go to objmap-totk root dir and edit .env and replace with below:

VUE_APP_GAME_FILES=http://localhost:8321/game_files
VUE_APP_RADAR_URL=http://localhost:3008

then run:
set NODE_OPTIONS=--openssl-legacy-provider
set Path=%CD%\node_modules\.bin;%PATH%

npm install --include=dev
npm run build

then finally to launch:
vue-cli-service serve --host 127.0.0.1 --port 8321

Then open your browser to http://localhost:8321 and enjoy a map with no background but most things seem to work otherwise.

TODO: Get backgrounds working
TODO might have to fix references to https://static.zeldamods.org/anna-static.js and https://anna.zeldamods.org/anna.js , though it probably doesn't hurt when using offline.
TODO: Ensure all fonts work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant