Editor support for Star Wars: Empire at War and Forces of Corruption mod development.
- XML and Lua: completions, hover documentation, cross-file diagnostics, navigation, rename
- Story tooling: campaign navigator, story graph, cross-language symbols
- Localisation editor
- Model preview
- Lua debugger
Preview release. Not every feature is complete; behaviour may change between versions. Report problems on
the issue tracker.
Requirements
- Visual Studio Code 1.107 or later
- Windows 11 (x64); Windows 10 is unsupported (end of mainstream support October 2025)
Nothing else to install: the language server and the Lua analyzer ship inside the extension, self-contained, with
no .NET runtime needed. The extension is published for Windows x64 only.
Getting started
1. Install the extension
From the Marketplace, or aet-eaw-edit-x.x.x.vsix from the
Releases page (Extensions view, ... menu,
Install from VSIX...).
After an install or an update the What's New page opens once with the release notes; EaWEdit: What's New
opens it again.
2. Open the mod
The language server starts for a workspace with a .pgproj, or a folder laid out like a mod without one: a Data
folder holding XML, Scripts, Art, Audio, Text or a MEG archive, or a modinfo.json. The game's own folder
and any other folder get no server.
3. Create a mod project file
A mod opened without one is offered a project file, once: Create project file writes it from what the folder
holds - the directories that exist, the text format found in Data/Text, the name from modinfo.json - and opens it.
Nothing is created and modinfo.json is not changed. Not for this folder stops the offer for good.
By hand, the .pgproj goes at the root of the mod workspace:
{
"_type": "aetswg.ModProject",
"_typeVersion": "aetswg-1.1.0",
"game": "foc",
"name": "My Mod",
"directories": {
"xml": ["data/xml"],
"scripts": ["data/scripts"],
"art": ["data/art"],
"audio": ["data/audio"]
},
"localisation": {
"type": "CSV",
"directory": "data/text"
},
"projectReferences": []
}
_type and _typeVersion - the file's format, written and maintained by the extension. A file without them loads as
format 1.0.0; a newer format than the extension understands is refused.
game - eaw or foc, the game the mod is checked against. Required from format 1.1.0; an older file is offered an
update that writes foc. An eaw project cannot reference a foc project.
- Paths are relative to the
.pgproj.
projectReferences - other .pgproj files whose symbols the mod inherits, e.g. a base game project.
localisation.type - CSV, DAT, XML or NLS.
icons (optional) - megaTexture (atlas pair without extension, e.g. data/art/textures/mt_commandbar) and
sourceRoots (loose icon folders). Omitted: engine convention.
- No
$schema line. The extension validates every .pgproj with the schema it ships, which matches the installed
version; a $schema URL replaces it with a copy from elsewhere that can be a format behind or ahead. Another editor
may point $schema at the release's copy:
https://raw.githubusercontent.com/AlamoEngine-Tools/pg-starwarsgame-lsp/refs/tags/v<version>/PG.StarWarsGame.LSP.Client.VSCode/aet-eaw-edit/resources/pgproj.schema.json.
Several projects in one window
Every .pgproj under the open folders is a project with a language server of its own.
- A file belongs to the project whose directory holds it. A dependency outside every folder belongs to the first
project that references it; the others see its changes on save.
- A
.pgproj inside another project's directory is served as that project's dependency, not as a project.
- Diagnostics name their project:
aetswg (<project name>).
- Commands act on the project of the document in front; with none, the project picked last in the window, or a picker.
EaWEdit: Select Project changes the pick.
- The story and localisation navigators list one group per project.
- Each project has its own output channel and log file, in its own directory.
- A single project behaves as before: one server, no project level anywhere.
Upgrading from 0.1.x
Required .pgproj change. Localisation moved from directories to its own node:
"directories": {
"xml": ["data/xml"],
"scripts": ["data/scripts"],
"art": ["data/art"],
- "audio": ["data/audio"],
- "text": ["data/text"],
- "textResourceType": "Csv"
+ "audio": ["data/audio"]
},
+ "localisation": {
+ "type": "CSV",
+ "directory": "data/text"
+ },
"projectReferences": []
A .pgproj in the old shape fails to load with a notification naming this fix.
Several .pgproj files. Each one gets a language server of its own; see
Several projects in one window.
Clear cached indexes. Delete .aetswg next to every .pgproj and %USERPROFILE%\.aetswg\, then run EaWEdit:
Restart LSP Server. Both are rebuilt automatically.
XML features
Indexes the full EaW/FoC object graph across the workspace.
- Completions - enum values and named objects from the whole workspace
- Hover - type, description and valid values for tags, enum values and references
- Diagnostics
- Unknown references
- Unknown or misspelled tags, with a suggestion
- Unnamed objects, missing required tags
- Type mismatches, malformed values, deprecated fields
- Duplicate declarations
- Engine rules - about 150 checks taken from the game's parser and error messages
- Numeric ranges
- Tags required or forbidden together
- Comparisons between tags of one object
- Variant-inheritance rules
- Go to definition -
F12 / Ctrl+Click, across files
- Find all references -
Shift+F12
- Rename -
F2, workspace-wide
- Code actions - quick fixes, including creating a missing localisation key
- Code lens - reference counts above every named object, and above every value an enum file or
GameConstants.xml defines for a dynamic enum
- Auto-close tags - on
> (needs editor.formatOnType)
- Linked editing - opening and closing tag renamed together (needs
editor.linkedEditing)
- Variant inheritance - Show Effective Object opens the merged XML of a
Variant_Of_Existing_Type object
- XML structure - judged by the game's own reader, with repairs; see XML structure
- Folding, expand selection, matching-tag highlight - on malformed files too
- Formatting - re-indents, changes nothing the game reads; see Formatting
XML structure
Every EaW XML file is read as the game reads it and, when the game keeps it, as standard XML.
| The game |
Standard XML tools |
Severity |
IDs |
| Drops the whole file |
- |
Error |
aetswg-012-3001 to aetswg-012-3009 |
| Reads the file |
Reject it |
Warning |
aetswg-015-0001 to aetswg-015-0003 |
| Reads less than the file shows, or something else |
Accept it |
Warning |
aetswg-015-0004 to aetswg-015-0006 |
- One error per dropped file - the first point the game's reader stops at
- EaW and FoC - where they differ (a mismatched end tag), the stricter FoC rule applies
- Comments inside values - read as the game reads them: the comment is cut out, the text around it joined
| ID |
Finding |
Repair |
aetswg-012-3001 |
No <?xml ...?> declaration |
Insert the XML declaration |
aetswg-012-3002 |
End tag naming another element |
Close the element left open; rename a misspelled end tag; remove one too many |
aetswg-012-3003 |
End tag differing in case only |
Rename the end tag |
aetswg-012-3004 |
End tag outside any element |
Remove the end tag |
aetswg-012-3005 |
No root element, or a root without child elements |
- |
aetswg-012-3006 |
A second root element |
- |
aetswg-012-3007 |
Attribute without = or without double quotes |
Use double quotes, unless the value holds " |
aetswg-012-3008 |
-- inside a comment, or a comment never closed |
Separate the hyphens - -- only |
aetswg-012-3009 |
File ends inside markup, or with an element open |
Close the element left open |
aetswg-015-0001 |
Declaration ending in > instead of ?> |
End the declaration with ?> |
aetswg-015-0002 |
& that starts no entity |
- escaping changes the value the game reads |
aetswg-015-0003 |
Anything else standard XML tools reject |
- |
aetswg-015-0004 |
Text after a child element, skipped by the game |
Remove the text the game skips |
aetswg-015-0005 |
Value ending in whitespace other than space, tab, CR or LF, which the game keeps |
Remove the character |
aetswg-015-0006 |
Comment inside a value - off by default |
Move the comment above the element |
- An element left open - the end tag goes where the file shows the element ends
- An element with a value closes right after it
- Never past the next element of the same name
- Otherwise where the indentation puts it, or, with nothing indented deeper, as the other elements of that name are
built
- Vanilla: 24,922 of 24,941 deleted end tags restored to the original tree
- Fix all - lightbulb Fix all repairable XML structure problems in this file
- Repeats until nothing repairable is left, at most 50 passes
- Skips IDs suppressed project-wide; directives in the file do not stop it
aetswg-015-0006 off by default - common practice in mods; standard XML readers return two text nodes, so
other tools may read a different value
- Carried by
.aetswg/suppressions.json: in a new project from the start, in an existing one once, on upgrade
- Deleting that entry turns it on
Editor structure
- Folding - elements over several lines, multi-line comments
- Expand selection - tag name, element, then each enclosing element (
Shift+Alt+Right)
- Matching-tag highlight - on a tag name, both names of its element
- Malformed files - an unclosed element gets no fold and highlights alone; every other pair keeps working
Format Document and Format Selection re-indent EaW XML files. Nothing the game reads changes.
- Scope - whitespace between tags and comments, in elements with no text of their own
- Trailing whitespace removed; more than one blank line becomes one
- Indentation from the editor: tabs, or the configured number of spaces
- Kept as written - values, comments, attributes, entities, same-line layout, line endings (CRLF, LF, mixed)
- A leaf's whitespace-only value is a value and stays
- An element with text stays whole: the game joins the text around a comment
- Well-formed files only - a file standard XML tools reject is refused with its line and column
- Checked - the result is compared with the original before it applies; a changed result is refused
- Vanilla - all 993 well-formed shipped files format with unchanged diagnostics and line endings; a second pass
changes nothing
Lua features
Scripts under the declared scripts directories are indexed and checked.
- Completion of string arguments that name game objects, text keys and modules
- Go to definition
- Rename, including XML objects referenced from Lua
- Quick fixes
- Hover and diagnostics
- Lua analyzer - identifier and member completion, the workspace's own functions and types on hover,
references, symbols, signature help, folding, semantic highlighting, code lenses and inlay hints; see
Lua analyzer
- Engine surface from measured stubs - the registered engine functions, the wrapper classes with their
methods, the standard library the game opens (Lua 5.0: no
math, io or os) and the globals each script
host maps in, as ---@meta files in the schema repository
- String arguments that name a game object, a faction, a sound or music event, a text key or a movie complete
and resolve against the workspace; ability types, animations and reward types complete from the schema enums
- A plan script's task forces are globals; a force without its
<Name>_Thread function is reported (Engine7)
- A script's own definition of an engine function takes the engine's parameter and return types
- Entry points - the functions the game or a vanilla library calls by name - are documented on hover; one the game
calls is not renamed
- One Lua state per script - the game runs every script with the libraries it requires in a state of its own:
references, code lenses and go to definition stay within it; a rename of a global reaches every script sharing a
library that defines or calls it
- The game's state machine - for scripts whose state machine and story libraries keep the game's contract
- Hover on state handlers, their message and state names; the message typed
OnEnter, OnUpdate or OnExit
- State names: go to the handler, completion in
Set_Next_State, rename
- Diagnostics
Engine8 to Engine13: a transition to an unregistered state, a non-function registered, a story
event naming an undefined function, a state registered twice, a handler not taking one parameter, a message
compared with anything else
- A script's state reused between instances - unless
ScriptPoolCount = 0, the game hands a script's state to
its next instance; Engine14 to Engine17: a host global read at definition time, a global read before it is set
at run time and not reset by Definitions (a reset on OnUpdate counts), a reused state without Flush_G, a
release that never empties the event queue
- Lua 5.0, as the game runs it -
#, %, ... as a value and long strings with = levels are Lua 5.1 and
reported as errors (Syntax3011): the game does not load a script that uses them. A long comment with = levels
over several lines is reported too: Lua 5.0 reads --[=[ as a line comment and the rest as code
Lua analyzer
EmmyLua Analyzer (emmylua_ls 0.25.1, MIT) runs behind the
language server, bundled and on by default. The editor talks only to this server; it mirrors the open scripts to the
analyzer and merges both answers.
- Scope - the project's own scripts are the analyzer's workspace; dependency layers and the engine stubs are its
library, read but never edited
- Engine stubs - the
---@meta files from the schema repository; ---@aetref tags on their parameters stay this
server's, for game-object completion, navigation and rename
- Ours where both answer - hover shows this server's card first; completion keeps this server's item for a label
both offer; a rename of an engine name or a game object stays this server's, and an analyzer rename that would edit
a file outside the project's scripts is refused
- Diagnostics - one list per script. Kept from the analyzer: rules that hold for any Lua, as
LuaAnalyzer1 to
LuaAnalyzer11 (aetswg-016-*), and a member an engine type does not have as LuaAnalyzer12 - the engine defines
all of its members; a syntax error is Syntax3010. Dropped: rules that depend on the stubs being complete
(missing or mismatched parameters, a field of a Lua table), and every rule a future analyzer version adds
- Not bundled - on a platform without the bundled analyzer, string-argument completion, engine hover, navigation
and rename remain
Lua debugger
Requires a debug build of the game with its Lua debug server running; retail builds have none.
With thanks to EvilBobTheBob (@andrewfullard), of Phoenix Rising and EaWX,
whose eaw-lua-debugger documented the game's Lua debug server
protocol. This debugger was built against that description.
Debug type Empire at War Lua in Run and Debug:
- Breakpoints in Lua files under the project's script directories
- Attach to a running game, or launch it with the mod chain
- Call stack, locals in the Variables view, watches and hovers on plain names
- Debug Console running Lua in the selected or stopped script
- Lua Scripts view: every running script instance with its coroutine threads; break in a script or a thread (the
game cannot start a script on request)
F5 in a Lua file attaches with the defaults below. launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "eaw-lua",
"request": "attach",
"name": "Attach to Empire at War (Lua)"
},
{
"type": "eaw-lua",
"request": "launch",
"name": "Launch Empire at War (Lua)",
"program": "<the debug StarWarsI.exe>"
}
]
}
| Attribute |
Request |
Default |
Description |
host |
both |
127.0.0.1 |
Machine running the game |
port |
both |
1234 |
The game's Lua debug UDP port; the game takes the first free port from 1234 upward |
sourceRoots |
both |
every project layer's script directories |
Directories the game's script paths map onto, mod first |
clientName |
both |
AetLuaDebugger:<pid> |
Client name the game logs |
unsafeTableExpansion |
both |
false |
Expand tables in the Variables view |
dropDuplicateOutermostFrame |
both |
true |
Drop a duplicated outermost call-stack entry |
program |
launch |
(required) |
Debug game executable |
args |
launch |
[] |
Extra arguments, after the mod chain |
cwd |
launch |
executable's directory |
Working directory |
modPaths |
launch |
built from the project layers |
MODPATH= entries, leaf first; replaces the chain from the .pgproj |
attachTimeoutSeconds |
launch |
60 |
Attach retry window after launch |
Launch and the mod chain
- One
MODPATH= per project layer: mod first, dependencies after
- The game reads a mod folder as-is, so each layer needs:
- Its declared directories under its
Data/ folder
- No space in its path
- A layer that does not comply is refused with the reason
modPaths overrides the chain
- A build step for other layouts is planned
(#144)
Lua Scripts view
- Refresh reloads the list
- Expanding a script fetches its threads
- Break actions are greyed out, with the reason in the tooltip, while a script is stopped or a break is already waiting
Limits of the game's debug server, reported rather than hidden:
- Breakpoint conditions, hit counts and log messages are never evaluated; such breakpoints are reported as not set
- The whole game freezes while a script is stopped
- Pause takes effect at the next Lua line of the selected script, or of any attached script
- Locals are the names found in scope at the stopped line
- Upvalues resolve to the global of the same name
- Numbers are reported as integers
- Tables show as
table: 0x... without children unless unsafeTableExpansion is on
- The game is reported to crash on member text of 255 bytes or more
Suppressing diagnostics
Every diagnostic carries a stable id aetswg-<group>-<number> (e.g. aetswg-004-0001), shown in the Problems panel's
Code column.
Quick fixes
Ctrl+. on a problem offers four scopes, narrowest first, none preselected:
- Suppress ... for this line
- Suppress ... for this
<Unit> / function / chapter - only with an enclosing declaration
- Suppress ... in this file
- Suppress ... across the project
Writing directives by hand
| Language |
Comment form |
| XML |
<!-- aetswg:suppress aetswg-004-0001 --> |
| Lua |
-- aetswg:suppress aetswg-004-0001 |
Story dialog (.txt) |
# aetswg:suppress aetswg-004-0001 |
| Keyword |
Covers |
aetswg:suppress |
the next element (XML), statement (Lua), or command line (dialog) |
aetswg:suppress-object |
the enclosing object element, function, or [CHAPTER n] section |
aetswg:suppress-file |
the whole file |
A directive may share a longer comment. A scope with no target (an -object directive outside any object, a trailing
directive) covers its own line only.
Project-wide suppressions live in .aetswg/suppressions.json, written by the across the project quick fix. Commit
that file.
Lists, wildcards, and reasons
Several ids per directive, comma-separated; a note after reason:::
<!-- aetswg:suppress aetswg-010-0002, aetswg-010-0003 reason:: deliberate shadow, cleared with the art team -->
* in place of the number silences a group, e.g. aetswg-004-* for every asset-file check:
| Group |
Covers |
aetswg-001-* |
References that do not resolve |
aetswg-002-* |
Enum values |
aetswg-003-* |
Value format: numbers, booleans, tuples, arity |
aetswg-004-* |
Asset files: models, textures, audio, maps |
aetswg-005-* |
Localisation keys |
aetswg-006-* |
Document structure |
aetswg-007-* |
Cross-tag rules within one object |
aetswg-008-* |
Variant inheritance |
aetswg-009-* |
Story and campaigns |
aetswg-010-* |
Symbols and layers: duplicates, shadowing |
aetswg-011-* |
Engine constraints |
aetswg-012-* |
Syntax errors, and XML files the game drops |
aetswg-013-* |
Suppression comments themselves |
aetswg-014-* |
Model preview: what assembling a unit or reading a particle file found |
aetswg-015-* |
XML strictness: XML the game reads that standard tools reject, or reads differently |
aetswg-016-* |
Lua analyzer: findings that hold for any Lua - unused or redefined locals, unreachable code, annotation errors |
Groups classify the problem, not the language: aetswg-001-* covers XML and Lua alike.
When a directive is wrong
aetswg-013-0001 - an entry that is not an id or wildcard (typo, or missing leading zeros: aetswg-4-1 for
aetswg-004-0001)
aetswg-013-0002 - a directive naming no diagnostic
Only the bad entry is rejected; the rest of the list applies. Silence these with aetswg-013-*.
<Override> is not a suppression
<!-- <Override Name="..."/> --> declares intended shadowing of a lower layer, a claim the server checks. Unaffected by
suppression.
Story mode
Campaigns are followed from CampaignFiles.xml through plot manifests to the Story_*.xml thread files and understood
as one graph. Edit and Simulation modes are experimental, each behind its own setting:
aet-eaw-edit.experimental.storyEditing and aet-eaw-edit.experimental.storySimulator.
- Campaign Editor view
- Campaigns, factions, galactic plot threads, the faction's battles in play order with their own plot files and the
script their manifest attaches beneath them, and the faction's attached Lua scripts
- Suspended threads marked
- Click opens the file; a battle opens its graph
- Story graph - one panel per campaign faction at the galactic level, and one per battle
- Auto-laid-out event flow with AND/OR junctions and cross-file portals
- Battles as sub-graphs: the galactic graph shows each tactical mission as one portal that opens the battle's own
panel; the battle graph shows the galactic events that link it in and listen for its outcome as portals back, each
opening the galactic panel on that event. In Simulation a pick on the portal selects the battle's decision beside
the dock instead - fight, auto-resolve, won or lost - and the portal's arrow opens the battle's graph into
Simulation. The command palette lists the battles after their faction
- Node colour by lifecycle: inactive, waiting, armed, fired, disabled
- Unreachable events dimmed; schema-untested types dashed
- Filters: name, branch, lifecycle, plot state, the incoming or outgoing chain of one event - inside the panel's
scope; the chain runs through a battle's portal
- Engine links (dash-dot): the links the game makes that no prerequisite writes - a speech or movie to the
listener that waits for it to end, a tutorial dialog to the listener for its Continue button, a battle to the
galactic listeners for its outcome and for the summary dialog closing. Drawn so a sequence the game plays in order
reads in order; never a prerequisite
- Thread lanes on the galactic graph (Empire at War's acts); disabled inside a battle, which is one plot
- Params by name - every event and reward slot carries a label from the schema ("Planets", "Flash id", "Required
result"); the description with its legend and ranges is the tooltip, and a missing-param warning quotes the same name
after the slot
- Colour key - flyout keying node, border and edge styles, including per-branch hues on zoomed-out nodes
- Editing (Edit mode)
- Drag a prerequisite between events
- Drop event and reward types from the palette
- Edit names, params, branch, perpetual and dialog in place
- Staged and applied on save as one
workspace/applyEdit; minimal edits; inserted tags in the engine's order
- Simulation (Simulation mode, setting
aet-eaw-edit.experimental.storySimulator)
- The campaign runs forward in 1 s ticks by the engine's own event rules: push-based arming, campaign-wide trigger
rewards, resets, disables, timers from arming, flag comparisons with the engine's defaults, speech and movie
completions owed to the next tick
- The world is a fact table seeded from the campaign XML - planets and owners, units, tech, credits - written only by
rewards and by the author; nothing moves, builds or fights on its own
- Every trigger the game would decide is a decision for the author: capture a planet, build or destroy a unit, win
or lose a battle, send a script event, or assume the trigger met; pickers list what fits the facts first and accept
any name
- Battles run as their own session, as the game plays them: the galactic simulation arms the galactic listeners
only. Entering a battle - from its portal, its row in the dock, or the decision that waits on it - opens its panel
into Simulation on its own clock, seeded with the galaxy's flags and world, and the galaxy stands still until it
resolves. Won or lost, from either panel: the battle's own listeners fire, the flags it wrote cross into the galaxy,
and the galactic outcome listeners fire. A rewind replays the outcome as one step without replaying the battle
- A
Continue_Tutorial listener is a decision only while a tutorial dialog shows: the dialog's Continue button is
what raises it, a TUTORIAL_DIALOG reward puts the dialog up and continuing closes it. A flag poll that already
holds is the clock's work, not a wait: the story is not waiting for input while a chain behind a flag write is still
landing
- Rule out: a decision the author knows will not come in this run (the defeat listener of a battle to be won, say)
leaves the list from its flyout. The listener stays armed, as in the game; the Ruled out group at the end of the
decisions reverses the call, and the listener firing after all clears it
- A linked battle waits for its choice, as the game's pending-battle panel does: a
LINK_TACTICAL reward makes
the battle pending and holds gameplay time - the story keeps running (pushes, flag polls, scripts, generic and GUI
events), only STORY_ELAPSED timers stand still. The decision sits on the battle's portal: Fight opens the
battle's panel straight into its session, Auto-resolve leaves won or lost and the flag picks to the author. A
FORCE_CLICK_GUI on the left choice button fights by itself, as the tutorial does, and on the right one
auto-resolves. The battle_end_closed listener is the battle's to raise, not a decision, while one is pending or
running; a loss that links the same mission again is a new attempt
- Campaign scripts run as their
PGStateMachine: a fired event enters the state, its OnEnter thread sleeps and
sends Story_Event ids back into the graph, drawn as state nodes and links
- Dock header: the tick and what stopped the clock; content: decisions, world, flags, scripts, each row opening beside
the dock; foot: the transport - restart, one tick back, play, one tick, run until the story reaches a new decision,
a breakpoint or nothing more can happen - with a pace of pulse, step or a custom rate. The clock is never held back
by open decisions: a real campaign has hundreds of armed listeners from tick 0
- The run's switches, at the end of the transport: Break on gates; Resume after an answer, play picking itself up
once the decision it stopped for is answered, kept per user; Speech and movies finish on their own, the session's
option, changed from the next tick on and kept through a rewind. All on except Break on gates
- Canvas: the flow along the edges, fire counts, gate meters on armed timers and flag checks, breakpoint marks; lenses
for the path taken, the flow tints and the script states
- Trace panel: every transition with its tick, node, cause and source; filter by text or
t12 for one tick; copy
- Breakpoints on any event and on every clock or flag gate; rewind to any tick replays the same answers
- Large campaigns - lightweight overview when zoomed out, real nodes only for the visible part; 1000+ events stay
responsive
- Campaign diagnostics
- Dangling or cyclic prerequisites
- Duplicate event names
- Prerequisites, reset and disable targets the engine cannot see because they live in another plot file
- Two events of one name in one plot file
- Events that can never fire
- Suspended plots nothing activates
- Problems bar can follow the branch filter; jumping to a hidden problem lifts it
- Cross-language symbols
- Event names, flags and AI-notification ids indexed across XML and Lua
- Go to definition from
Prereq tokens and STORY_AI_NOTIFICATION ids to the Lua Story_Event("...") call
F2 renames across threads and scripts
- Dialog scripts (
.txt scripts declared in the .pgproj)
- Diagnostics
- Inlay hints with the localisation text of
TEXT and TITLE lines
- Go to definition on speech, movie and sound arguments
Dependency and base-game files are read-only. Node positions, events and junctions, portals and script states alike,
persist per campaign faction in .aetswg/story-layout.json.
Model preview
- Alamo Model Preview editor for
.alo models and .ala animations; the file only, no XML
- Preview Assembled Unit (command and GameObject code lens) - the unit as the game builds it
- Hardpoints on their attachment bones
- Movable turrets
- Firing arcs
- Team colour
- Model lens
- Model tree with per-part visibility
- LOD and ALT levels
- Skeleton, cameras, info inspector
- Scene and light settings
- Animation lens
- Clip library by family, action and take
- The game's loop rule: idle repeats, death does not
- Transport, playback speed
- Gameplay lens
- Attacker weapons and abilities against the unit
- Shields and hardpoint health
- Destroy and repair hardpoints, with damage smoke and death clone
- Damage log naming the armour type per hit
- Particles - effects, groups and emitters of a particle system
- Saved shots - captures kept in a set
- Handoff - Open in AloViewer and Open in Particle Editor via
aet-eaw-edit.tools.aloViewerExecutable and
aet-eaw-edit.tools.particleEditorExecutable
- Shaders - Set Up Base Shader Sources fetches Petroglyph's published shader sources into
aet-eaw-edit.shaders.directory; never redistributed
- Game models - from the game install: found in the Steam library or the Windows registry, or set in
aet-eaw-edit.lsp.source.baseGameDirectory and, for Forces of Corruption, expansionDirectory
- Energy pool - behind
aet-eaw-edit.features.preview.energyPool, a development setting and off on purpose: the
engine implements it, the shipped game disables it
- Not covered - sounds and animation SFX maps; AloViewer remains the tool for those
Encyclopedia preview
Read-only.
- Preview Encyclopedia Popup (command and GameObject code lens) - the in-game tooltip card
- Icon, name, class line
Encyclopedia_Text wrapped as the game wraps it
- Ship names from the game's tables
- Faction switch
- Screen it is drawn for - the game sizes the glyphs from its display; 1920x1080 unless another is
picked, kept per user
- Language -
aet-eaw-edit.lsp.localisation.language (the game's language, not the extension's)
- Icons - from the mega texture
- Game icons baked into the baseline
- A project's own
mt_commandbar (.pgproj icons) replaces them wholesale
- Missing everywhere: error
- In sources but not in the mega texture: warning to rebuild
Mod Browser
Read-only.
- Mod Browser view - the outlines Game Data, Assets, Scripts and Schema; one panel per project
- Rail - VS Code's tree of lists, their loaded entries and each entry's relations, a picture per kind; the
path to the open one is the breadcrumb
- Keys: up and down,
Page Up, Page Down, Home, End; right opens a row, then goes to its first child;
left closes it, then goes to its parent; Enter opens, Space selects, F12 goes to the definition
- A click on a list's row opens that entry's relations in the rail; the keys select without opening
- Width dragged by its right edge, and kept
- Lists - each entry once, as the definition the game uses, with its origin - the project or dependency
that defines it, by name, or
Game - and what it overrides
- Paged on the server, 200 at a time, and sorted there by a header click: name, type, behaves like, origin
- Search form: name, what it behaves like with its count, origin; its height dragged by its top edge
- A filter in each column header, writing into the same search
- Column widths and order dragged in the header, kept per list; filtering and sorting leave them as they are
- Relations - computed for one entry, when it opens; an empty one counted zero, with the reason
- Game objects: models, particle systems, particles, SFX and speech events, hardpoints, other references,
textures, Lua script, references, overrides - the definitions the one the game uses replaces, each opening
at its line unless it is packed
- Objects only the game defines: no relations from their tags (
Not in the mod's files)
- Models: animations, particle systems, textures, references. Particle systems: textures, and as references
the models whose proxies carry them and the objects naming them. Animations: model. Textures and audio:
references. Lua scripts: loaded by, requires. Enums: references
- Scripts - Lua scripts by their folder under
Data/Scripts: GameObject, Library, Story, AI, Evaluators,
FreeStore, Interventions, Miscellaneous, and Other for any other
- Schema - the XML types, each with its tags; the enums, each built in or dynamic and opening into its values -
a dynamic one's from the game's files and the project's, each value listing the objects using it; the
behaviours, with what decides each and the game objects that have it
- A value is a key and a value: the name XML writes and what the engine uses for it, two columns of the list.
An animation type's value is the name its files are filed under -
Transition To Move is
<model>_MOVESTART_<NN>.ala
- Previews - an entry opens into its tiles, each at a fixed place on its type's grid
- Game object: header, problems, encyclopedia card with its faction switch, references
- Other XML object: header, problems, what its tags name, references
- Model: header with its bones and counts, problems, textures, particle systems, animations, references, and
its tree of bones, meshes and effects down the right half
- Particle system: header, problems, textures, references
- Lua script: header with its size, lines and dates, loaded by, requires
- Schema type, tag and behaviour: its documentation - value type, what it references, its enum and values,
whether it repeats, description, notes
- Enum: whether it is built in or dynamic, its documentation, every value, the tags typed with it
- Textures, audio and animations: none; selecting one shows its relations
- Tabs - a click selects; a double click or
Enter opens the entry in a tab beside the table's own, which keeps
its search, scroll and selection. One preview tab, in italics, is reused until it is pinned
- Actions -
F12 goes to the definition. The context menu lists only what can be done; a row's hover icons
and the entry's page offer Preview unit, Show encyclopedia card, Show effective object, Preview model,
Preview on its model (an animation, with its model's clip selected), Reveal in File Explorer and Copy name,
an unavailable one disabled with the reason
Localisation editor
Localisation Editor activity bar view, files grouped into Text files and Credits files; one grid tab per
file, splittable side by side.
- Editing - staged edits, count on Save, one all-or-nothing write; refused if the file changed on disk
- Validate - without writing; duplicate and empty keys are errors in text files, expected in credits files
- Rows - right-click menu: add and delete; reorder on credits files
- Add language - from the game's language list, for formats that hold more than one
- Fill language - from another language or from the game's own translations
- Inherited rows - hidden by default, Inherited toggle shows them; Reset to inherited value on overridden
rows
- Filter - plain text, wildcard (
*, ?) or regex; scoped to keys, one language or everything
- Columns - language columns chosen from the header gear; empty languages hidden at first
- Export to DAT and Convert to another format - from the file's context menu; conversion keeps the original
- New project - initialise from the EaW + FoC baseline, or import existing files
Saves rewrite changed rows only; untouched rows keep quoting, comments and line endings.
Credits files
Ordered lists that may repeat a key. Rows are addressed by position, so duplicates, spacer rows and order survive
editing.
- Line kinds, offered as tiles to drag into the table:
HEADER - label
CENTER - name
[TBL] - blank spacer
- Open Credits Preview to the Side and Play Credits Crawl Full Screen play the staged rows as the game does
Detection: engine naming (credits*), or in the .pgproj:
"localisation": {
"type": "CSV",
"directory": "data/text",
"credits": {
// "convention" (default), "explicit" (only the files listed), or "none"
"detection": "convention",
"files": ["rolls.csv"]
}
}
One format per project: a CSV project's credits file is a .csv. "type": "DAT" projects edit compiled .dat files
directly (language from the file name, sort order preserved). Set Localisation Project Format changes the format
from the editor.
Commands
Command Palette (Ctrl+Shift+P).
| Command |
Description |
| EaWEdit: New Mod Project |
Creates a .pgproj and initial directories |
| EaWEdit: Reload Mod Project |
Re-reads the .pgproj, re-indexes |
| EaWEdit: Select Project |
The project commands act on, with several open |
| EaWEdit: Re-validate Workspace |
Re-runs diagnostics in every language |
| EaWEdit: Restart LSP Server |
Restarts the language server |
| EaWEdit: Copy Bug Report Info |
Client and server status for a public issue; no paths |
| EaWEdit: What's New |
The release notes of the installed version |
| EaWEdit: Force LSP Startup |
Runs the startup scan again when a session came up without one |
| EaWEdit: Show Effective Object (Variant Inheritance) |
Merged XML of a variant object |
| EaWEdit: Preview Model |
Opens a model by file name, without XML |
| EaWEdit: Preview Assembled Unit |
Opens the GameObject under the cursor, assembled from the XML |
| EaWEdit: Set Up Base Shader Sources |
Fetches the shader sources into aet-eaw-edit.shaders.directory |
| EaWEdit: Preview Encyclopedia Popup |
The encyclopedia card of the GameObject under the cursor |
| EaWEdit: Open Mod Browser |
Lists what the project indexes, by type |
| EaWEdit: Open Story Graph |
A faction's story graph |
| EaWEdit: Refresh Story Navigator |
Rebuilds the campaign tree |
| EaWEdit: New Localisation Project |
Initialise from baseline, or import |
| EaWEdit: Initialise Localisation Project from Baseline |
Starter file from the game baseline |
| EaWEdit: Import Existing Localisation Files |
Adopts CSV, XML, Properties or DAT files |
| EaWEdit: Set Localisation Project Format |
Writes localisation.type |
| EaWEdit: Open Localisation Editor |
Grid tab for a file |
| EaWEdit: Open Localisation File as Text |
Plain text editor for a file |
| EaWEdit: Refresh Localisation Files |
Re-reads the project's files |
| EaWEdit: Convert Localisation File to Another Format |
CSV, XML, Properties or DAT |
| EaWEdit: Export Localisation to DAT |
Compiled .dat for a file |
| EaWEdit: Open Credits Preview to the Side |
Credits crawl beside the editor |
| EaWEdit: Play Credits Crawl Full Screen |
Credits crawl over the editor |
| EaWEdit: Refresh Lua Scripts |
Reloads the Lua Scripts view from the game; in a debug session |
| EaWEdit: Refresh Script Threads |
Reloads one script's threads (inline); in a debug session |
| EaWEdit: Break in Script |
Break at the script's next Lua line (inline); game running |
| EaWEdit: Break in Thread |
Break at the thread's next Lua line (inline); game running |
Settings reference
Eleven settings on the settings page; everything else is always on. The development settings are hidden from it.
Experimental
Off by default, each on its own; a change restarts the language server.
| Setting |
Default |
Description |
aet-eaw-edit.experimental.storyEditing |
false |
Edit mode in the story graph |
aet-eaw-edit.experimental.storySimulator |
false |
Simulation mode in the story graph |
Language
| Setting |
Default |
Description |
aet-eaw-edit.lsp.localisation.language |
ENGLISH |
Game language for displayed localisation text (hovers, inlay hints, encyclopedia card) |
The game directories are found in the Steam library or the Windows registry; a set one wins. The tools are used only
once set.
| Setting |
Default |
Description |
aet-eaw-edit.lsp.source.baseGameDirectory |
(found) |
Empire at War install (GameData); models, textures and string table that ship with the game |
aet-eaw-edit.lsp.source.expansionDirectory |
(found) |
Forces of Corruption install (corruption), searched alongside the base game |
aet-eaw-edit.tools.aloViewerExecutable |
(empty) |
AloViewer.exe, for Open in AloViewer |
aet-eaw-edit.tools.particleEditorExecutable |
(empty) |
ParticleEditor.exe, for Open in Particle Editor |
aet-eaw-edit.shaders.directory |
(empty) |
Base game shader sources (.fx) for the preview; filled by Set Up Base Shader Sources or a copy at hand |
aet-eaw-edit.whatsNew.openAfterUpdate |
true |
Open the What's New page once after an update, and on the first start |
Localisation editor
| Setting |
Default |
Description |
aet-eaw-edit.localisation.format |
format-dat |
Default format for new localisation projects (format-dat, format-csv, format-xml, format-nls) |
Diagnostics
| Setting |
Default |
Meaning |
aet-eaw-edit.diagnostics.workspaceOnStartup |
false |
Diagnose every indexed file once the scan finishes, instead of only the files that are opened. Expensive - on the base game, 580 files, that is 18,281 diagnostics and 21.8 MiB the editor holds. Turn it on only when a session has started with no diagnostics at all |
Development
For development and troubleshooting. Hidden from the settings page; @tag:advanced in its search shows them, and
settings.json completes and describes them.
| Setting |
Default |
Meaning |
aet-eaw-edit.lsp.debug.trace.server |
off |
messages or verbose: LSP traffic in the EaWEdit output channel |
aet-eaw-edit.lsp.debug.logLevel |
Information |
Trace, Debug, Information, Warning or Error: detail in the server's own log file; Debug records whether a document reached a sync handler |
aet-eaw-edit.lsp.debug.waitForDebugger |
false |
Start the server with --wait-for-debugger |
aet-eaw-edit.lsp.executable |
(empty) |
A server to run instead of the bundled one; empty = bundled |
aet-eaw-edit.lsp.devMode.enabled |
false |
Start the server from source with dotnet run --project |
aet-eaw-edit.lsp.devMode.projectPath |
(empty) |
PG.StarWarsGame.LSP.Server.csproj for dev mode |
aet-eaw-edit.lua.analyzerPath |
(empty) |
An emmylua_ls to run instead of the bundled one; empty = bundled |
aet-eaw-edit.lsp.schema.source |
http |
http (GitHub, the newest compatible schema release) or local |
aet-eaw-edit.lsp.schema.localPath |
(empty) |
The schema repository's eaw folder, holding _index.json; not its root (source local) |
aet-eaw-edit.lsp.schema.url |
(empty) |
Custom schema index URL (source http) |
aet-eaw-edit.lsp.source.baseline.type |
http |
http or local; the baseline is the snapshot of every vanilla object and localisation key, cached in %USERPROFILE%\.aetswg\baselines\ |
aet-eaw-edit.lsp.source.baseline.localPath |
(empty) |
Local baseline file (type local) |
aet-eaw-edit.lsp.source.baseline.url |
(empty) |
Custom baseline URL (type http) |
aet-eaw-edit.features.preview.energyPool |
false |
Energy pool in the preview (editor-side, no restart). Off on purpose: the shipped game disables the mechanic |
What this extension downloads
Three data sources; nothing else is sent or received. No telemetry.
| What |
Where |
When |
How to disable |
| XML schema |
GitHub - newest compatible schema release |
On server start; nothing when the release is already cached; default branch when no release exists |
aet-eaw-edit.lsp.schema.source = local |
| Game baseline |
Configured URL (default: GitHub releases) |
Once; cached in %USERPROFILE%\.aetswg\baselines\; refreshed on new versions |
aet-eaw-edit.lsp.source.baseline.type = local |
| Shader sources |
Petroglyph's published download |
Only on Set Up Base Shader Sources |
Do not run the command; set aet-eaw-edit.shaders.directory to a copy at hand |
Troubleshooting
No diagnostics. The workspace needs a .pgproj, or a mod's Data folder; aet-eaw-edit.lsp.executable empty (the
bundled server) or pointing to a PG.StarWarsGame.LSP.Server.exe; then EaWEdit: Restart LSP Server.
"LSP server failed to start". Windows may have blocked the downloaded executable: Properties > Unblock on
PG.StarWarsGame.LSP.Server.exe, then restart the server. Otherwise Show Output in the notification.
Version mismatch. Reported only for a server set in aet-eaw-edit.lsp.executable; the bundled one always matches.
Clear the setting to use it.
Features work in some files only. Only directories listed in the .pgproj are indexed; add the paths to
directories.xml or directories.scripts.
"'directories.text'/'directories.textResourceType' were removed". Pre-0.2.0 .pgproj;
see Upgrading from 0.1.x.
"The game did not answer on 127.0.0.1:1234 within 60 s". Debug build with luadebug run in its console required;
retail builds never answer. A second game instance listens on 1235: set port.
Remote machine: allow UDP to that port.
Breakpoint: "The file is under none of the configured script roots". The file is outside every project layer's
script directories; move it, or add its root to sourceRoots.
Launch refused: layer not runnable. Declared directories under Data/ and no space in the path, or pass the folders
via modPaths. See Lua debugger.
Raw server output. aet-eaw-edit.lsp.debug.trace.server = messages; EaWEdit output channel.
No diagnostics at all, for any file. aet-eaw-edit.lsp.debug.logLevel = Debug, then restart the server and read
the EaWEdit output channel (a Debug build of the server also writes aetswg-*.log in each project's folder): it
records whether XML document sync was registered and whether each didOpen reached the handler. At the default level
neither line is written.
Acknowledgements
EvilBobTheBob (@andrewfullard), of Phoenix Rising and EaWX, for
eaw-lua-debugger - the Python client that documented the game's
Lua debug server protocol. The Lua debugger here was built against that description.
CppCXY and the EmmyLua contributors, for the
Lua analyzer this extension ships unmodified. Its licence is in ThirdPartyNotices.txt.
Issues
AlamoEngine-Tools/pg-starwarsgame-lsp/issues
| |