Syntax highlighting for AOE3 scripts

I made a VSCode extension that enables syntax highlighting for the XS language. I know there’s already one named “XS Language”, but it doesn’t highlight certain keywords like mutable, rule, active, etc. So I made this one:


I tried to follow guides about programming language grammars and parsers. I toyed a little but with Nearley (because it’s the easiest to set up in JavaScript), but all my attempts have been disastrous so far. I’d be super happy if an experienced person could give some tips so I can add validation features to this extension (like detecting invalid syntaxes, duplicate declarations, undefined functions, etc.)

I’m open to suggestions. I have been extremely active in the aoe3 legacy modding community these past few weeks, so I want to take advantage of that before I return to lethargic mode again, or before real life occupies me for months, lol


The extension just got a massive update thanks to Divy1211’s AoE2 extension! With his permission, I forked his project and replaced all AoE2-specific data with AoE3 data. The new version is out: AoE3 XS Scripting - Visual Studio Marketplace
Make sure to check it out!

:warning: For the moment, there’s no documentation. When I have more time, I will work on it. Ooor, you can also participate if you wish to help :wink: Here’s the repository: GitHub - thinotmandresy/age3-xs: Language support for Age of Empires 3 XS Language


Amazing ! Thank you !


Nice, is there a doc of all the available functions that you can use?

1 Like

Thank you!

It’s not thourough and requires a bit of cleaning and testing, but the majority of functions and constants can be found directly in the .exe file — I was using a resource editor to extract the strings.

I’m extremely tempted to clone Divy’s website (What Is XS Scripting - AoE2DE UGC Guide) and add content that is focused on AoE3, but I’m scared it’s too much effort for “not much use” (if that makes sense).
Plus, I’m a huge prorastinator anyway :sweat_smile:

what resource editor?

Somebody can EL5 which could be the possible applications?

XS is the language of triggers, AI and some GUI stuff This allows you to write XS easier.

1 Like

I was using GitHub - glmcdona/strings2: strings2: An improved strings extraction tool. which is not a resource editor but I’m pretty sure any resource editor can do the same thing.