Hello there !
I am trying to use @TriggerHappy 's TypeScript template for wc3.
First let me tell you that I am a complete newbie at TS, although I have already used JavaScript a while back.
So like any well-behaved newbie, I have followed the quick startup guide found at https://github.com/cipherxof/wc3-ts-template/wiki/1.-Getting-Started.
I installed latest version of node.js
As I never used Git before, I installed latest Git for windows from Git for Windows
Once everything seemed to be installed properly, I opened a PowerShell window as an admin.
- Then i went to my users folder "C:\Users\Macadamia".
- Then I typed :
it went pretty well.
- Next I typed "npm install" and it updated successfully.
Once done I edited "tsconfig.json" according to my local folders :
- Then I tried to run "npm run build", and that is where it fails :
So the question is : where did I mess up ?
Thanks, and take care !
EDIT : Ok one blame for me, so I replaced folder separators with "/" and changed the mapFolder back to just "map.w3x"
Being a noob at something really sucks
EDIT 2 : Nearly there.
Here is my tsconfig.json now :
This is definitely the right path for wc3 executable ("J:\Jeux\Warcraft III\x86_64\Warcraft III.exe" on windows)
But when I try "npm run test", I end up with :
What is wrong with my wc3 folder ?
I am trying to use @TriggerHappy 's TypeScript template for wc3.
First let me tell you that I am a complete newbie at TS, although I have already used JavaScript a while back.
So like any well-behaved newbie, I have followed the quick startup guide found at https://github.com/cipherxof/wc3-ts-template/wiki/1.-Getting-Started.
I installed latest version of node.js
As I never used Git before, I installed latest Git for windows from Git for Windows
Once everything seemed to be installed properly, I opened a PowerShell window as an admin.
- Then i went to my users folder "C:\Users\Macadamia".
- Then I typed :
Code:
git clone https://github.com/triggerhappy187/wc3-ts-template.git
cd wc3-ts-template
- Next I typed "npm install" and it updated successfully.
Once done I edited "tsconfig.json" according to my local folders :
Code:
{
"mapFolder": ".\maps\map.w3x",
"minifyScript": false,
"gameExecutable": "J:\Jeux\Warcraft III\x86_64\Warcraft III.exe",
"outputFolder": "./dist/bin",
"launchArgs": [
"-launch",
"-windowmode",
"windowed"
]
}
- Then I tried to run "npm run build", and that is where it fails :
Code:
> [email protected] build C:\Users\Macadamia\wc3-ts-template
> ts-node --ignore "node_modules/(?!mdx-m3-viewer).*" scripts/build.ts
[2020-05-16 18:03:41] error: SyntaxError: Unexpected token m in JSON at position 24
[2020-05-16 18:03:41] error: Could not find key "mapFolder" in config.json
[2020-05-16 18:03:41] error: Failed to compile map.
PS C:\Users\Macadamia\wc3-ts-template>
So the question is : where did I mess up ?
Thanks, and take care !
EDIT : Ok one blame for me, so I replaced folder separators with "/" and changed the mapFolder back to just "map.w3x"
Being a noob at something really sucks
EDIT 2 : Nearly there.
Here is my tsconfig.json now :
Code:
{
"mapFolder": "map.w3x",
"minifyScript": false,
"gameExecutable": "J:/Jeux/Warcraft III/x86_64/Warcraft III.exe",
"outputFolder": "./dist/bin",
"launchArgs": [
"-launch",
"-windowmode",
"windowed"
]
}
This is definitely the right path for wc3 executable ("J:\Jeux\Warcraft III\x86_64\Warcraft III.exe" on windows)
But when I try "npm run test", I end up with :
Code:
> [email protected] test C:\Users\Macadamia\wc3-ts-template
> ts-node scripts/test.ts
[2020-05-16 18:29:02] info: Transpiling TypeScript to Lua...
[2020-05-16 18:29:05] info: Building "map.w3x"...
[2020-05-16 18:29:05] info: Launching map "C:/Users/Macadamia/wc3-ts-template/dist/map.w3x"...
[2020-05-16 18:29:05] error: No such file or directory "J:/Jeux/Warcraft III/x86_64/Warcraft III.exe". Make sure gameExecutable is configured properly in config.json.
PS C:\Users\Macadamia\wc3-ts-template>
What is wrong with my wc3 folder ?
Last edited: