This should be the default behaviourIs there any way to make the error checker recognize mod-added content so this doesn't happen?
This should be the default behaviourYour mod content should be used for validation as well as completion.
The most common reason I see for the kind of problem you're talking about (where it doesn't seem to load all your files) is only opening one file at a time in vscode.
It will only correctly load everything if you use "File -> Open Folder" and then open either:
1. Your mod folder directly
2. The Stellaris folder two levels above it (e.g. either Stellaris in documents, or Vanilla Stellaris)
As to ignoring whole folders, I haven't had anyone ask for that, and I'm not sure why you'd need it. You can type file filters in the "Problems" list to filter to only certain folders, if that's what you're trying to do? The individual file ignores were really meant for things like credits.txt which aren't script files.
Hm, well I can use "Open Folder" to add my mod and have it parse correctly and then save it as a workspace, but if I add even the base game files to that workspace, even if I have error checking for vanilla files turned off, it will show errors. I dunno, maybe there's a better way to do this? I've found it just incredibly useful to have all the vanilla files loaded in my workspace to refer to when modding, but I can't figure out how to make it work here.
By default errors in Vanilla are hidden (as you usually aren't interested in validating/edited vanilla directlyI'm getting some errors I can't quite figure out.
{
"resource": "/c:/Users/EspenHansen/OneDrive/Modding/Stellaris/Mods/essi2tweaks/Stellar Naming/common/random_names/00_empire_names.txt",
"owner": "_generated_diagnostic_collection_name_#2",
"code": "CW002",
"severity": 8,
"message": "This block has mixed key/values and values, it is probably a missing equals sign inside it.",
"source": "CW002",
"startLineNumber": 1153,
"startColumn": 2,
"endLineNumber": 1153,
"endColumn": 7
}
{
"resource": "/f:/Steam/steamapps/common/Stellaris/common/random_names/00_empire_names.txt",
"owner": "_generated_diagnostic_collection_name_#2",
"code": "CW002",
"severity": 8,
"message": "This block has mixed key/values and values, it is probably a missing equals sign inside it.",
"source": "CW002",
"startLineNumber": 1153,
"startColumn": 2,
"endLineNumber": 1153,
"endColumn": 7
}
And several of these, but only in the modded file, not the original. Even though the script parts in question are identical in both.
{
"resource": "/c:/Users/EspenHansen/OneDrive/Modding/Stellaris/Mods/essi2tweaks/Stellar Naming/common/random_names/00_empire_names.txt",
"owner": "_generated_diagnostic_collection_name_#2",
"code": "CW251",
"severity": 4,
"message": "This AND is unnecessary",
"source": "CW251",
"startLineNumber": 4941,
"startColumn": 4,
"endLineNumber": 4941,
"endColumn": 7
}
EDIT: Similar issue with 00_rules.txt gives warning in the modded file, but not the original
some_cause = {
first = true
second = false
third true
fourth = true
}
If you use "Open folder" and select your mod folder, it will load and validate as soon as you open a file inside it. This can take a minute or two to load depending on your PC's speed. You'll know it's happening because there's some progress text in the bottom left. "Loading project..." then "Validating files...". To test it just set a trigger/effect to a nonsense value, you should see it highlight that as an error.Please explain how to validate the files. I have the extensions installed and the syntax highlighting and help with completing all work and I can see how it helps me while typing but how can I get your tool to check my mod for errors in the existing code?
Thanks
If you use "Open folder" and select your mod folder, it will load and validate as soon as you open a file inside it. This can take a minute or two to load depending on your PC's speed. You'll know it's happening because there's some progress text in the bottom left. "Loading project..." then "Validating files...". To test it just set a trigger/effect to a nonsense value, you should see it highlight that as an error.
{
"cwtools.cache.stellaris": "\"I\\Steam\\steamapps\\common\\Stellaris\"",
"cwtools.localisation.languages": [ "English",],
"cwtools.errors.vanilla":false,
"cwtools.experimental":true,
"cwtools.trace.server": "off",
"cwtools.errors.ignorefiles": ["README.txt,credits.txt,credits_l_simp_chinese.txt,reference.txt,startup_info.txt"],
"files.associations": {
"*.txt": "stellaris"
},
"workbench.startupEditor": "newUntitledFile"
}
immediate = {
add_resource = { fred = 54000 }
}
{
"cwtools.cache.stellaris": "I\\Steam\\steamapps\\common\\Stellaris",
"cwtools.localisation.languages": [ "English",],
"cwtools.errors.vanilla":false,
"cwtools.experimental":true,
"cwtools.trace.server": "off",
"cwtools.errors.ignorefiles": ["README.txt,credits.txt,credits_l_simp_chinese.txt,reference.txt,startup_info.txt"],
"workbench.startupEditor": "newUntitledFile",
"files.associations": {
"*.txt": "stellaris",
"*.yml": "stellaris",
"mod": "stellaris",
"Stellaris": "stellaris"
}
}
Thank you for your reply.
I understand but I still need some help. It keeps saying generating vanillia cache so I think I have the cache directory syntax wrong. The install is at
I:\Steam\steamapps\common\Stellaris - maybe the program has a problem with the install being on a drive other than c ?
using jason for the setting file it keeps trying to format it as
Code:{ "cwtools.cache.stellaris": "\"I\\Steam\\steamapps\\common\\Stellaris\"", "cwtools.localisation.languages": [ "English",], "cwtools.errors.vanilla":false, "cwtools.experimental":true, "cwtools.trace.server": "off", "cwtools.errors.ignorefiles": ["README.txt,credits.txt,credits_l_simp_chinese.txt,reference.txt,startup_info.txt"], "files.associations": { "*.txt": "stellaris" }, "workbench.startupEditor": "newUntitledFile" }
and jason shows no errors in the settings file. If I try to make any changes then jason complains about errors in expected syntax.
1) so is this correct the way jason wants to format the cache location?
2) for file association I have some drive letter short cuts that bypass the Stellaris so I tried to use "mod" but only ".txt" seems to work.
For my test error I did
Code:immediate = { add_resource = { fred = 54000 } }
and the program never marks fred as being in error but as I said it keeps doing the generate vanilla cache.
EDIT:
I also tried the following with no change
Code:{ "cwtools.cache.stellaris": "I\\Steam\\steamapps\\common\\Stellaris", "cwtools.localisation.languages": [ "English",], "cwtools.errors.vanilla":false, "cwtools.experimental":true, "cwtools.trace.server": "off", "cwtools.errors.ignorefiles": ["README.txt,credits.txt,credits_l_simp_chinese.txt,reference.txt,startup_info.txt"], "workbench.startupEditor": "newUntitledFile", "files.associations": { "*.txt": "stellaris", "*.yml": "stellaris", "mod": "stellaris", "Stellaris": "stellaris" } }
so what should I change to the above?
"cwtools.cache.stellaris": "f:\\Games\\Steam\\steamapps\\common\\Stellaris",
"cwtools.trace.server": "messages",
"cwtools.rules_version": "latest",
"extensions.autoUpdate": true,
simsulla kindly contributed a good amount of the basic support for Vic2, so if you open a vic2 mod it should activate and do basic syntax validation.Does this work for Vic2 files as well?
random_list = {
0.5 = { do stuff }
}
random_list = {
50 = { do stuff }
}
I'm getting error messages on random lists that seem incorrect. It looks like, from the tooltip, what's expected is something like this:
Code:random_list = { 0.5 = { do stuff } }
Because it says it wants a floating point value between 0 and 0.99999. However, the base game code contains plenty of random lists that are like this:
Code:random_list = { 50 = { do stuff } }
With whole number values that are conceptually percentages. What's going on?
![]()