﻿Hardcore Warrior -> NoX Core converter (hardcore_conv)
======================================================
(한국어 안내는 아래에 있습니다.)

WHAT IT DOES
- It converts the Hardcore Warrior campaign maps into a mod pack for NoX Core, an open-source
  reimplementation of Nox.
- Each map's compiled script is rewritten into plain map script. What the maps' injected memory
  code did is done instead by the mod's own Luau scripts (mod\hardcore_warrior), written by hand.
- It never runs, emulates or copies the maps' memory injection or machine code. Code that only
  worked through memory injection, and that has no rule yet, is switched off ("stubbed") and the
  report lists it.
- It only reads your maps and your Nox folder. It writes only into the output folder.

HOW TO USE IT
  1. Double-click hardcore_conv_gui.exe (or hardcore_conv.exe: it opens the same window).
     If Windows says "Windows protected your PC", click "More info", then "Run anyway".
  2. Pick the three folders with the Browse... buttons:
     - Nox game folder: your Nox folder, the one with thing.bin. It is only read.
     - Your maps folder: the folder with your .map files (sub-folders are searched too).
     - Output folder: where to write. Leave it empty for a new export_<date>_<time> folder in
       this folder. Otherwise a new or empty folder, or an earlier output of this tool (then it
       is replaced).
  3. Press Convert. The log shows what happens. When it has finished:
     - a green box: everything was converted;
     - a RED box: read it (see WHAT THE MESSAGES MEAN below); the list under it names each map
       and function.
     Open report shows REPORT.html; Open output folder shows the result. English / 한국어 at the
     top right switches the window's language. The window remembers your folders
     (hardcore_conv_gui.ini in this folder).

WHAT YOU GET
  <out>\mods\hardcore_warrior\   the ready mod: mode.json, the Luau scripts, the text tables and the
                                 converted maps (maps\HW01A\HW01A.map, ...)
  <out>\REPORT.html              the summary: open it in a browser. REPORT.txt is the same as text.
  <out>\report\                  per map: <HW>.conv.json (the details), <HW>.ns (the converted
                                 script), <HW>.compile.txt; stubs.tsv (every stub); data_diff.txt
                                 (your own thing.bin and modifier.bin against the game's, below)
  The mod's own files (its scripts) come from mod\hardcore_warrior in this folder, or, in the Hardcore
  Warrior pack's download, from the pack's mods\hardcore_warrior beside this folder.

YOUR MAPS AGAINST THE PACK'S SOURCE
  The first thing the log and the report show: each of your maps against the maps the pack was made
  from (rules\source_maps.tsv: their names, sizes and fingerprints, not the maps themselves):
  - "same as the pack's source": nothing to review;
  - "CHANGED since the pack was made": it names the functions that changed (and the new and gone
    ones): those are the ones to review; any code in them that no rule covers gets the big warning;
  - "NEW (not in the pack)": a map the pack hasn't (a map not in rules\maps.tsv isn't converted);
  - "missing from your folder": a map of the pack you didn't give.

YOUR OWN DATA FILES
  When your maps folder (or a folder above it) has its own thing.bin or modifier.bin, the report
  lists each record they add, change or remove against your game folder's, and which of them your
  maps use (report\data_diff.txt, and the end of REPORT.txt). The mod carries the differences as its
  own data, mods\hardcore_warrior\data\thing.patch and modifier.patch (only what differs), used in its
  games only; what no patch can carry (a spell's price, say) is listed there. The source check also
  says whether these two files are the same as the pack's.

INSTALLING IT IN NOX CORE
  Copy the folder <out>\mods\hardcore_warrior into NoX Core's mods folder (the mods folder next to
  noxcore.exe), replacing an older copy. It needs the NoX Core build of 2026-11-26 or newer. In the
  game, choose Co-op Campaign and the campaign "Hardcore Warrior", and play a warrior.

WHAT THE MESSAGES MEAN
- THE BIG WARNING (the red box with "NEW CUSTOM MAP CODE"; exit code 3): your maps have new code
  that the converter doesn't cover:
  * map-specific memory code, or a library routine, with no rule, body or override, that isn't on
    our list of known stubs;
  * an override whose function has changed. An override is our hand-written replacement of one
    function, and it records a fingerprint (a hash) of the function it replaces. If that function
    is different in your map, the override is NOT applied;
  * a map that isn't in the pack's map list (rules\maps.tsv). It isn't converted.
  This code will NOT work in NoX Core until we add a rule or an override for it. Each such function
  is stubbed out: it does nothing and logs its name once, so it can't half-work. The rest of the
  map is converted as usual.
- "Known stubs" (a small notice in the log): functions we already know about. They wait for NoX
  Core features or rules. You don't need to do anything.
- ERRORS (a red box; exit code 1): a map couldn't be converted or written, or a map the pack needs
  (War03d, from your Nox maps folder) is missing. The maps that converted are written. Please send
  us the report.
- NOTHING WAS DONE (a red box; exit code 2): a wrong folder or option. The box says why.

SENDING US A REPORT
  When you see the big warning or an error, send the report (REPORT.html, REPORT.txt and the report
  folder, zipped) through https://github.com/mordentral/NoXCore, or to whoever gave you this tool.
  If you can, add the maps that changed. The report holds the conversion results and the folder
  paths you used, nothing else. The window's Copy log and Save log... buttons give you the log too.

ADVANCED: THE COMMAND LINE
  hardcore_conv.exe does the same in a command prompt (open one in this folder):

    hardcore_conv.exe --game-dir "C:\GOG Games\Nox" --out "D:\HW_export" "D:\MyMaps\maps"

  --game-dir   your Nox game folder (the one with thing.bin). It is only read.
  --out        where to write. Optional: by default a new export_<date>_<time> folder in this folder.
               It must be a new or empty folder, or an earlier output of this tool (then it is
               replaced).
  the last     the folder with your maps. Sub-folders are searched for .map files too.

  Exit codes: 0 done; 3 done, with new custom code (the big warning); 1 errors; 2 nothing done.

Hardcore Warrior campaign by Jisoo/KLN, Russian translation by Lycoris, converted for NoX Core.


==========================================================================================

Hardcore Warrior -> NoX Core 변환 도구 (hardcore_conv)
(이 한국어 안내와 프로그램 창의 한국어는 기계 번역의 도움을 받아 작성했습니다. 어색한 부분이
있으면 알려 주세요.)

어떤 도구인가요
- Hardcore Warrior 캠페인 맵을 NoX Core(Nox의 오픈 소스 재구현)용 모드 팩으로 변환합니다.
- 각 맵의 컴파일된 스크립트를 일반 맵 스크립트로 다시 씁니다. 맵에 주입된 메모리 코드가 하던 일은
  저희가 직접 작성한 모드의 Luau 스크립트(mod\hardcore_warrior)가 대신합니다.
- 맵의 메모리 주입 코드나 기계어 코드는 절대 실행하거나 에뮬레이션하거나 복사하지 않습니다.
  메모리 주입으로만 작동하던 코드 중 아직 규칙이 없는 것은 꺼 두며(스텁), 보고서에 표시합니다.
- 맵과 Nox 폴더는 읽기만 하고, 출력 폴더에만 씁니다.

사용 방법
  1. hardcore_conv_gui.exe를 더블클릭하세요 (hardcore_conv.exe를 더블클릭해도 같은 창이 열립니다).
     "Windows의 PC 보호" 창이 나오면 "추가 정보"를 누른 뒤 "실행"을 누르세요.
  2. 찾아보기... 버튼으로 세 폴더를 고르세요.
     - Nox 게임 폴더: thing.bin이 있는 Nox 폴더. 읽기만 합니다.
     - 맵 폴더: .map 파일이 있는 폴더 (하위 폴더도 찾습니다).
     - 출력 폴더: 결과를 저장할 곳. 비워 두면 이 폴더 안에 새 export_<날짜>_<시간> 폴더를
       만듭니다. 직접 고를 때는 새 폴더나 빈 폴더, 또는 이 도구로 만든 이전 출력 폴더(이 경우
       새로 덮어씁니다)여야 합니다.
  3. 변환 버튼을 누르세요. 진행 상황이 로그에 나옵니다. 끝나면:
     - 초록색 상자: 모두 변환되었습니다.
     - 빨간색 상자: 내용을 읽어 주세요(아래 "메시지의 의미" 참고). 아래 목록에 맵과 함수가
       나옵니다.
     보고서 열기는 REPORT.html을, 출력 폴더 열기는 결과 폴더를 엽니다. 오른쪽 위의
     English / 한국어로 창의 언어를 바꿀 수 있습니다. 고른 폴더는 기억됩니다(이 폴더의
     hardcore_conv_gui.ini).

결과물
  <out>\mods\hardcore_warrior\   바로 쓸 수 있는 모드: mode.json, Luau 스크립트, 텍스트 표,
                                 변환된 맵(maps\HW01A\HW01A.map 등)
  <out>\REPORT.html              요약 보고서입니다. 브라우저로 여세요. REPORT.txt는 같은 내용의
                                 텍스트 파일입니다.
  <out>\report\                  맵별 상세: <HW>.conv.json(상세 내용), <HW>.ns(변환된 스크립트),
                                 <HW>.compile.txt, stubs.tsv(모든 스텁 목록), data_diff.txt(직접 만든
                                 thing.bin, modifier.bin과 게임 파일의 비교, 아래 참고)
  모드 자체 파일(스크립트)은 이 폴더의 mod\hardcore_warrior에서, Hardcore Warrior 팩 다운로드에서는
  이 폴더 옆의 팩 mods\hardcore_warrior에서 가져옵니다.

입력 맵과 팩의 원본 비교
  로그와 보고서 맨 위에, 입력한 각 맵을 팩을 만들 때 쓴 원본 맵(rules\source_maps.tsv: 맵 자체가
  아니라 이름, 크기, 지문만 들어 있음)과 비교한 결과가 나옵니다.
  - "팩의 원본과 같음": 검토할 것이 없습니다.
  - "팩을 만든 뒤 바뀜": 바뀐 함수(새 함수, 없어진 함수 포함)의 이름이 나옵니다. 그 함수를
    검토하세요. 규칙이 없는 코드가 있으면 아래의 큰 경고가 나옵니다.
  - "새 맵 (팩에 없음)": 팩에 없는 맵입니다(rules\maps.tsv에 없는 맵은 변환하지 않습니다).
  - "폴더에 없음": 입력하지 않은 팩의 맵입니다.

직접 만든 데이터 파일
  맵 폴더(또는 그 위의 폴더)에 직접 만든 thing.bin이나 modifier.bin이 있으면, 보고서에 게임 폴더의
  파일과 비교해 추가, 변경, 삭제된 항목과 맵이 사용하는 항목이 나옵니다(report\data_diff.txt,
  REPORT.txt의 끝). 모드는 그 차이만 자체 데이터(mods\hardcore_warrior\data\thing.patch,
  modifier.patch)로 담아 이 모드의 게임에서만 씁니다. 패치로 담을 수 없는 것(주문 가격 등)은 그곳에
  나옵니다. 원본 비교에서도 이 두 파일이 팩의 것과 같은지 알려 줍니다.

NoX Core에 설치하기
  <out>\mods\hardcore_warrior 폴더를 NoX Core의 mods 폴더(noxcore.exe 옆의 mods 폴더)에
  복사하세요. 이전 것이 있으면 바꿔 넣으세요. 2026-11-26 또는 그 이후의 NoX Core 빌드가 필요합니다.
  게임에서 협동 캠페인(Co-op Campaign)을 고른 뒤 "Hardcore Warrior" 캠페인을 선택하고 전사로
  플레이하세요.

메시지의 의미
- 큰 경고("새로운 맵 전용 코드"가 적힌 빨간색 상자, 종료 코드 3): 변환 도구가 처리하지 못하는
  새로운 코드가 맵에 있습니다.
  * 규칙, 본문(body), 오버라이드가 없고 알려진 스텁 목록에도 없는 맵 전용 메모리 코드나
    라이브러리 루틴
  * 함수가 바뀐 오버라이드. 오버라이드는 함수 하나를 저희가 손으로 다시 쓴 것으로, 대체하는
    함수의 지문(해시)을 기록해 둡니다. 맵의 그 함수가 다르면 오버라이드를 적용하지 않습니다.
  * 팩의 맵 목록(rules\maps.tsv)에 없는 맵. 이 맵은 변환하지 않습니다.
  이런 코드는 저희가 규칙이나 오버라이드를 추가하기 전까지 NoX Core에서 작동하지 않습니다.
  해당 함수는 스텁으로 대체됩니다. 즉, 아무 동작도 하지 않고 처음 한 번 이름만 로그에 남기므로
  일부만 작동하는 일은 없습니다. 맵의 나머지 부분은 평소대로 변환됩니다.
- "알려진 스텁"(로그의 작은 알림): 저희가 이미 알고 있는 함수로, NoX Core 기능이나 규칙을
  기다리고 있습니다. 따로 하실 일은 없습니다.
- 오류(빨간색 상자, 종료 코드 1): 변환하거나 저장하지 못한 맵이 있거나, 팩에 필요한 맵
  (Nox의 maps 폴더에 있는 War03d)이 없습니다. 변환된 맵은 저장됩니다. 보고서를 보내 주세요.
- 아무 작업도 하지 않음(빨간색 상자, 종료 코드 2): 폴더나 옵션이 잘못되었습니다. 상자에 이유가
  나옵니다.

보고서 보내기
  큰 경고나 오류가 나오면 보고서(REPORT.html, REPORT.txt, report 폴더를 함께 압축한 파일)를
  https://github.com/mordentral/NoXCore 를 통해 보내 주시거나, 이 도구를 전해 드린 사람에게
  보내 주세요. 가능하면 바뀐 맵도 함께 보내 주세요. 보고서에는 변환 결과와 사용하신 폴더 경로만
  들어 있습니다. 창의 로그 복사, 로그 저장... 버튼으로 로그도 보낼 수 있습니다.

고급: 명령줄
  hardcore_conv.exe는 명령 프롬프트에서 같은 일을 합니다(이 폴더에서 명령 프롬프트를 여세요).

    hardcore_conv.exe --game-dir "C:\GOG Games\Nox" --out "D:\HW_export" "D:\MyMaps\maps"

  --game-dir   Nox 게임 폴더(thing.bin이 있는 폴더). 읽기만 합니다.
  --out        결과를 저장할 폴더. 생략할 수 있으며, 기본값은 이 폴더 안의 새 export_<날짜>_<시간>
               폴더입니다. 새 폴더나 빈 폴더, 또는 이 도구로 만든 이전 출력 폴더(이 경우 새로
               덮어씁니다)여야 합니다.
  마지막 인자  맵이 들어 있는 폴더. 하위 폴더의 .map 파일도 찾습니다.

  종료 코드: 0 완료, 3 완료(새로운 맵 전용 코드가 있어 큰 경고), 1 오류, 2 아무 작업도 하지 않음.

Hardcore Warrior 캠페인: Jisoo/KLN 제작, 러시아어 번역: Lycoris. NoX Core용으로 변환.
