Problems
What the preview's warnings in the Problems panel mean, and what to do about each one.
provinceview.gui above the Problems panel, the preview's buildings panel beside them. Two letters of a sprite name are swapped; Problems reports the missing sprite at once, and the panel's background is gone while the rest of the window still draws. An undo fixes it.While the preview is open, Etch checks your window against your playset, the mods loaded with yours, and lists what it finds in VS Code’s Problems panel (Ctrl+Shift+M). Each entry sits on the line it is about and names Etch as its source. Click an entry to go to that line.
What Etch checks
Section titled “What Etch checks”- the
.guifile of the previewed window; - each
.guior.gfxfile you change while the preview is open.
It checks them as you type, against the game and every mod of your playset. A sprite defined in a mod your mod depends on counts. A sprite defined only in a mod outside your playset does not. Closing the preview clears these entries.
The entries come in two kinds:
- a warning: the game is likely to show something other than you meant, or to fail;
- an information entry, marked with an “i”: something Etch draws differently from the game, or does not know for sure.
Braces and quotes
Section titled “Braces and quotes”These warnings mean that the file’s text is broken, so what comes after the mistake may not be read as you meant:
- “This { is never closed; the block runs to the end of the file.” A
}is missing. Everything after the{counts as inside that block. Add the}where the block ends. - “This } closes no block and is ignored.” A
}too many, or one whose{is missing. Remove it, or add the{. - A string without its closing
"runs to the end of the line. Add the closing". - An
=with no value after it, or with no key before it. Write the missing part, or remove the=.
Etch reads the rest of the file as the entry says. Whether the game reads it the same way has not
been checked. Writing a block without =, as windowType on one line and { on the next, is not
a mistake: the game reads it, and so does Etch.
Missing sprites, textures and fonts
Section titled “Missing sprites, textures and fonts”- “No .gfx file of the playset defines sprite GFX_my_icon.” The name is misspelled, or the
.gfxfile that defines it is in a mod outside your playset. Fix the name, or add that mod to thedependenciesof yourdescriptor.mod. - “Texture gfx/interface/my_icon.dds is not in the playset.” The file is missing, or its path is
misspelled. Where a
.gfxfile names a.tgafile, a.ddsfile of the same name counts too, as it does for the game. - “No .gfx file of the playset defines font my_font.” Use a font that a
.gfxfile defines, or define it. - A font whose
.fntfile or texture is missing gets a warning that names the missing file.
When CWTools is on and its rules check the name after spriteType or quadTextureSprite,
CWTools warns about a missing sprite there, and Etch leaves its own warning out, so you see one
warning, not two (see
Etch and CWTools in the same file).
The same goes for a missing font, after a key whose font name CWTools’ rules check.
CWTools reads only the folders open in VS Code and the base game. So it also warns about a sprite
that only a mod in your dependencies defines. The game finds that sprite, so you can ignore this
warning. Etch gives no warning there.
Missing definitions and widgets
Section titled “Missing definitions and widgets”- “No .gui file of the playset defines my_scrollbar at top level.” A
scrollbartype, or aparentthat should name a definition written directly inguiTypes, names one that no.guifile of the playset has. Fix the name, or add the definition. - “my_window has no widget named my_bg.” A window’s
background, theslider,track,leftbuttonorrightbuttonof a scroll bar, or aparentinside a window names a widget that is not there. Fix the name, or add the widget. - “Constant @my_width is not defined in this file.” A
@namevalue needs its@name = …line in the same file.
Keys and values the game does not read
Section titled “Keys and values the game does not read”Etch checks each widget against the keys EU4 1.37.5 reads for that kind of widget. The game
reads keys in upper or lower case, so Orientation and orientation are both fine. When
CWTools is on and its rules cover the widgets of .gui files, CWTools gives these warnings
instead, and Etch leaves them out (see
Etch and CWTools in the same file).
- “The game does not read sacle in iconType.” The key is misspelled, or this kind of widget has no such key. The game skips it. Fix the spelling, or move the key to a widget that takes it.
- “The game does not read guiButtonType in containerWindowType. It takes buttonType for this widget here.” The game creates only some kinds of widget inside each kind of widget. Here it never creates the button, so it does not show in the game, and the preview leaves it out too, with everything inside it. Use the kind the entry names.
- “The game does not read x in size: it takes width, height, step, min and max.” A
containerWindowTypereads itssizeas{ width = … height = … }, and most other widgets read theirs, and everyposition, as{ x = … y = … }. The game reads no size from the other form, or from two bare numbers. The preview reads none either, so the widget gets no size. Write the fields the entry names. - “The game ignores text in iconType.” An
iconTypeshows notext,font,buttonTextorbuttonFont, and aninstantTextBoxTypeignoressize. Remove the key, or use a widget that shows it. - “LEFT is not one of the nine anchors the game reads for orientation; the game puts the widget
at the upper left.” Use one of the nine anchors:
UPPER_LEFT,UPPER_RIGHT,LOWER_LEFT,LOWER_RIGHT,CENTER_LEFT,CENTER_RIGHT,CENTER,CENTER_UPorCENTER_DOWN. AcontainerWindowTypetakes seven: notCENTER_LEFTorCENTER_RIGHT. The base game writesLEFT25 times: those widgets sit at the upper left. - “The game reads spacing as a whole number: 2.5 is read as 2.” The game drops the part after the point. Write the whole number you want.
- “The game reads alwaystransparent as yes or no, not maybe.” The value is the wrong kind for the
key: a word where the game wants a number, a block
{ … }where it wants one value, or the reverse. The entry says what the game reads.
Names written twice
Section titled “Names written twice”- “Top-level name my_window is already defined in this file …” Rename one of the two. At startup the game keeps one of them at random, and reloading the file can crash the game.
- A sprite defined again, in the same file or another, gets an information entry: the game uses the one loaded last, and the entry says which that is.
- A font defined again gets an information entry too. Etch uses the first one; which one the game uses is not known.
These warnings are about a text the preview draws, from the .gui file or from your
localisation. When the text comes from your localisation, the entry ends with “in the localisation
of” and the key.
- “The font has no glyph for U+…” The text’s font has no letter for that character (U+… is the character’s code number). Use another font, or another character.
- “Character U+… is not in Windows-1252.” The game’s fonts have letters only for the characters of Windows-1252, and this one is not among them. See Encoding.
- “Unknown text colour §x.” No
textcolorsblock of the playset’s.gfxfiles defines that letter after§. A§at the very end of a text gets “Colour code § at the end of the text.” - “No sprite GFX_text_my_key for the text icon £my_key£.” Define the sprite, or fix the key.
The same goes for a font icon written with
¤.
Kinds and files Etch cannot draw
Section titled “Kinds and files Etch cannot draw”- “The game reads browserType, but vanilla EU4 1.37.5 does not use it and Etch does not draw it.” The game shows the widget; the preview leaves it out. Keep it if you meant it. A block the game does not read at all gets a warning instead: see Keys and values the game does not read.
- “my_spriteType is not a sprite kind vanilla EU4 1.37.5 uses; Etch does not draw it.” Check the spelling of the block’s name.
- “Texture gfx/interface/my_icon.dds cannot be drawn: …” and similar entries mean that a texture
or
.fntfile is there, but Etch cannot read it. The entry says why. Save the file again from your image editor.
Where the preview differs from the game
Section titled “Where the preview differs from the game”These are information entries. They tell you where the preview may differ from the game:
- a sprite whose shader Etch does not have is drawn with Etch’s default shader;
- a widget’s
rotationandorigoare not applied; - a name that matches only when upper and lower case are ignored: Etch does not know whether the game ignores case there.
Problems of your window profile
Section titled “Problems of your window profile”A mistake in your mod’s window profile,
.etch/profiles/<window>.jsonc, is an error in the Problems panel, on its line. Etch leaves that
entry of the profile out and draws the rest. See Views and window profiles.
Problems with finding the game or the mods of your playset are not in the Problems panel. They show as a notice above the window: see Where Etch finds the game.
Other checks in Problems
Section titled “Other checks in Problems”Other parts of Etch list what they find in the same panel:
- Province IDs and names that the game does not check and can crash on;
- Encoding: where the game would read other letters than VS Code shows;
- the lines the live game, EU4 running beside the editor,
writes to its
error.logafter it reloads a file you saved: see Reload on save; - the mistakes the live game finds in your files while it starts: see Start and stop;
- the widgets the preview places or shows differently from the live game: see Snapshot and compare.
What it doesn’t do
Section titled “What it doesn’t do”- The preview checks only while it is open, and only the previewed window’s file and the
.guiand.gfxfiles you change. Other files get no entries from it. - An entry that says “unverified” describes a case that has not been checked against the game.