Generates TypeScript definitions for Age of Empires 4 to be used with TypeScriptToLua.
View the types in your browser here.
npm i -D @aoemods/aoetypes- Add this to your
tsconfig.jsonfile.
{
"compilerOptions": {
"types": [
"@aoemods/aoetypes"
],
},
}- TypeScript template: https://github.com/aoemods/aoe4-typescript-template
- Dodge mod (100 rounds): https://github.com/aoemods/dodge-mod
- Clone this repo and
npm i - (Optional): download https://cm2.network/ScarDoc/function_list.htm to
data/coh2-scardocs/ - (Optional): copy
function_list.htmandenum_list.htmtodata/aoe4-scardocs/ - (Optional): run the script
dumpglobals.luaas detailed in its comment - Copy scar / lua scripts from data.sga archives to
data/aoe4-scar/(both cardinal and engine, the script will search there recursively so doesn't matter what the folders are named) npm startwill generate the types intopackages/aoetypes/types/aoetypes.d.ts
- Age of Empires 4 scardocs (no return types)
- Age of Empires 4 scar scripts from engine and cardinal Data.sga
- Company of Heroes 2 scardocs (has return types, matched across the AoE4 scardocs)
- Manual overrides in
src/overrides.ts - Globals dump with
dumpglobals.luaingame with game mode set to None
This project was directly inspired by its Dota 2 counterpart.