Before I begin, using Notepad++ is a must for reading, and editing *.WS (Witcher Script) files, and a good UDL (User Defined Languge), will really help.
There are several on the Nexus, but you can use mine, designed with a black background, rather than the white one most nexus uploads use.
Download Attached File, and extract the TW3 Witcher Script [WS] - Dark.XML file it contains
TW3 Witcher Script [WS] - Dark.zip
In Notepad++ Menu select
Language > User Defined Language > Define Your Language
In UDL Window, click the "Import" Button
Navigate to where you extracted the TW3 Witcher Script [WS] - Dark.XML file, and click Open button.
If your *.WS files open and do not apply the UDL, you can now select it from the menu via
Language > Witcher Script [WS] - Dark
Should be last entry in Language menu, unless you add more UDLs after this..
This will make editing your Witcher 3 Scripts, a lot easier, especially with picking out commented mod edits.
Now for the answers to error problems, and I'll writte these with some effort to explain how you can DIY, in future.
Line 139 expecting '{' or ';', near 'var'
Look at Vanilla file in Notepad++, it gives you Line numbers
Starting at Vanilla line 136
Your merged version starting at Line 137
See the missing { that Vanilla had, and your merge doesn't, that's the error in this case.
In General Terms
The error messages usually tell you what the issue is, and though Vanilla is the first resort, Script Merger will tell you all the mods merged, if the Mod Makers not used comments to mark their edits.
You can select the merged file in Script merger, delete the one merged file
Select File > Options
Tick the first Option under the Merging Section
Review each merge in KDiff3 (even if auto solvable)
Then Remerge, and review the changes in KDiff3, because although Script Merger will Auto Merge 99% of things correctly, it isn't always correct, with the most common issue being mixing two mod edit blocks together, when the most likely correct method is first one block, then the second.
Be aware this most often happens around a conflict it asks you about, so always check the surrounding results of a conflict.
You can often fix the errors before you run the game.
It can seem daunting at first, but the more merges you check the better at fixing them you will get.
Error Messages are your friend, and whatever Line number it gives, you work up from that line to fix it.
Close brackets errors may need an open bracket adding, a long way up, but clicking on a closed bracket it Notepad++, gives you a nice and easy line to find where it should start.
Listing from line 2109 we have
I compared this too Friendly HUD's file, given the suspect line is in it's edited sequence.
I had to reach line 2156 (see Why Missing lines are suspect?), not good, but that's another matter
Clearly Friendly HUD code is correct, which calls into question what mod these edits are from.
No idea how this happened, bad manual editing maybe, as Friendly HUD is the only Mod Edit involved it should be auto merged by Script Merger., it seems a poor attempt to merge Friendly HUD, or maybe an old version, seen a few references like this.
// Kinect unplugged for TTP#98732. Keeping code on offchance we bring it back
WTF Kinect ON PC?
Yes, we see code for both XB1, and PS4 on PC version, but more importantly, this is definitely a mod using old code, from a previous patch, or even the original release, as these Kinect references were removed by CDPR in a patch, and are not part of the current vanilla code.
Whatever mod this is from, either needs updating, or replacing with a similar mod made for a patch no earlier than v1.30, but ideally 1.31/1.32.
Why missing lines are suspect?
This code is immediately suspect, as mod edits should always add code lines, even if huge blocks of Vanilla code are technically removed.
A competent mod maker always comments any edit, to name the mod, and uses block comments to edit it out sections of Vanilla code they have replaced, or removed, and always leaves that Vanilla code in place, so other coders can see the what's been altered.
Examples
/* Mod Name - Begin - Slash Asterisk Starts a Block Comment
Huge
Block
Of
Vanilla
Code
// Mod Name -End - we start any comment with the double slash, but end the block with the reversed Asterisk Slash */
// Mod Name - Double slash starts all single line comments, even in a block, to distinguish a comment from Vanilla code
// Mod Name - Double slash means everything after it, on this line is a comment, and it's not read as code (even if it is code see next example)
This is code, and will be read as code // This is more code, but ignored because it comes after a comment marker // Mod Name comment last for code lines
/* Mod Name - Everything after the open block comment marker is treated as comments
Including code lines whether they are marked by comments or not
// Mod Name -until the close Block marker is reached */
// Mod Name - Begin - Use this to mark the start of a block of code added by the mod (some authors use + + + instead of begin)
Block
Of
New modded
Code
// Mod Name -End - Use this to mark the end of a block of code added by the mod (some authors use - - - instead of End)
Even if you never make a mod, and are just trying to merge them, the above commenting principles are used by most mod makers, and knowing them will help in reading code, and merging them.
Always [mod0000_mergedfiles] = <Path To Your Game>\Mods\mod0000_MergedFiles\Content\Scripts
So for first error file is;
<Path To Your Game>\Mods\mod0000_MergedFiles\Content\Scripts\game\gameplay\ability\playerabilitymanager.ws
We have two "unexpected" close curly brackets }, that means the matching open curly brackets { are missing.
With closed Bracket errors we start at the last one, so scroll to Line 4790, and click on the close curly bracket } on that line.
Notepad++ does it's magic now, and gives you a line to follow, at the top of which should be the open curly bracket {
Now to confirm our suspicions, we need to check Vanilla, and any mods indicated by nearby commented mod edits.
Repeat for the other four errors, which are all missing open curly brackets {
Not much I can do without at least a link to the merged file in question.
You've not installed this mod correctly.
There's a Menu XML file that goes here
<Path To Your Game>\Bin\Config\R4Game\User_Config_Matrix\PC\modnewgameplusplus.xml
Best place to get help with a specific mod, is on the mods Nexus Page.
Mod Menu Limit Fix
Only thing to add, is be aware of the nine Submenu limit, and the mod we use to add more than nine Mod menus.
Community Patch - Menu Strings by Wasteland Ghost aka wghost81
Also read the Description page, but in short, for every Mod XML
Search for
Mods
Replace with Mods.subsection where subsection is the listed IDs, Like this
Mods.alchemy_and_equipment
Mods.camera
Mods.characters
Mods.combat
Mods.gameplay
Mods.quests_and_adventures
Mods.user_interface
Mods.visuals_and_graphics
Mods.miscellaneous
This gives us Nine categories, each of which can hold nine mod menus, giving us 81 in Total.
Also be aware the Categories are just for convenience, mod menus don't care where they are put.
There are several on the Nexus, but you can use mine, designed with a black background, rather than the white one most nexus uploads use.
Download Attached File, and extract the TW3 Witcher Script [WS] - Dark.XML file it contains
TW3 Witcher Script [WS] - Dark.zip
In Notepad++ Menu select
Language > User Defined Language > Define Your Language
In UDL Window, click the "Import" Button
Navigate to where you extracted the TW3 Witcher Script [WS] - Dark.XML file, and click Open button.
If your *.WS files open and do not apply the UDL, you can now select it from the menu via
Language > Witcher Script [WS] - Dark
Should be last entry in Language menu, unless you add more UDLs after this..
This will make editing your Witcher 3 Scripts, a lot easier, especially with picking out commented mod edits.
Now for the answers to error problems, and I'll writte these with some effort to explain how you can DIY, in future.
At least try to understand, errors pretty much tell you what's wrongHey Everyone, I'm having a similar issue. From what I've read, this is the way to go about getting some help.
My Error is:
Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(139): syntax error, unexpected TOKEN_VAR, expecting '{' or ';', near 'var'
Here is my ingamemenu.ws pastebin
Line 139 expecting '{' or ';', near 'var'
Look at Vanilla file in Notepad++, it gives you Line numbers
Starting at Vanilla line 136
Code:
event OnConfigUI()
{
var initDataObject : W3MenuInitData;
var commonIngameMenu : CR4CommonIngameMenu;
Your merged version starting at Line 137
Code:
event OnConfigUI()
var initDataObject : W3MenuInitData;
var commonIngameMenu : CR4CommonIngameMenu;
See the missing { that Vanilla had, and your merge doesn't, that's the error in this case.
In General Terms
The error messages usually tell you what the issue is, and though Vanilla is the first resort, Script Merger will tell you all the mods merged, if the Mod Makers not used comments to mark their edits.
You can select the merged file in Script merger, delete the one merged file
Select File > Options
Tick the first Option under the Merging Section
Review each merge in KDiff3 (even if auto solvable)
Then Remerge, and review the changes in KDiff3, because although Script Merger will Auto Merge 99% of things correctly, it isn't always correct, with the most common issue being mixing two mod edit blocks together, when the most likely correct method is first one block, then the second.
Be aware this most often happens around a conflict it asks you about, so always check the surrounding results of a conflict.
You can often fix the errors before you run the game.
It can seem daunting at first, but the more merges you check the better at fixing them you will get.
Error Messages are your friend, and whatever Line number it gives, you work up from that line to fix it.
Close brackets errors may need an open bracket adding, a long way up, but clicking on a closed bracket it Notepad++, gives you a nice and easy line to find where it should start.
Post automatically merged:
So line 2111 expecting { as aboveHello all, I have been having a similar problem and would greatly appreciate some help.
Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(2111): syntax error, unexpected TOKEN_FUNCTION, expecting '{' or ';', near 'function'
![]()
/***********************************************************************//** - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.pastebin.com
Listing from line 2109 we have
Code:
event /*flash*/ OnResetKeybinds():void
//---=== modFriendlyHUD ===---
function ShouldHideDLCIcons() : bool
{
return theGame.GetInGameConfigWrapper().GetVarValue('fhudMainMenu', 'fhudHideDLC');
}
//---=== modFriendlyHUD ===---
{
I had to reach line 2156 (see Why Missing lines are suspect?), not good, but that's another matter
Code:
//---=== modFriendlyHUD ===---
function ShouldHideDLCIcons() : bool
{
return theGame.GetInGameConfigWrapper().GetVarValue('fhudMainMenu', 'fhudHideDLC');
}
//---=== modFriendlyHUD ===---
event OnResetKeybinds():void
{
No idea how this happened, bad manual editing maybe, as Friendly HUD is the only Mod Edit involved it should be auto merged by Script Merger., it seems a poor attempt to merge Friendly HUD, or maybe an old version, seen a few references like this.
// Kinect unplugged for TTP#98732. Keeping code on offchance we bring it back
WTF Kinect ON PC?
Yes, we see code for both XB1, and PS4 on PC version, but more importantly, this is definitely a mod using old code, from a previous patch, or even the original release, as these Kinect references were removed by CDPR in a patch, and are not part of the current vanilla code.
Whatever mod this is from, either needs updating, or replacing with a similar mod made for a patch no earlier than v1.30, but ideally 1.31/1.32.
Why missing lines are suspect?
This code is immediately suspect, as mod edits should always add code lines, even if huge blocks of Vanilla code are technically removed.
A competent mod maker always comments any edit, to name the mod, and uses block comments to edit it out sections of Vanilla code they have replaced, or removed, and always leaves that Vanilla code in place, so other coders can see the what's been altered.
Examples
/* Mod Name - Begin - Slash Asterisk Starts a Block Comment
Huge
Block
Of
Vanilla
Code
// Mod Name -End - we start any comment with the double slash, but end the block with the reversed Asterisk Slash */
// Mod Name - Double slash starts all single line comments, even in a block, to distinguish a comment from Vanilla code
// Mod Name - Double slash means everything after it, on this line is a comment, and it's not read as code (even if it is code see next example)
This is code, and will be read as code // This is more code, but ignored because it comes after a comment marker // Mod Name comment last for code lines
/* Mod Name - Everything after the open block comment marker is treated as comments
Including code lines whether they are marked by comments or not
// Mod Name -until the close Block marker is reached */
// Mod Name - Begin - Use this to mark the start of a block of code added by the mod (some authors use + + + instead of begin)
Block
Of
New modded
Code
// Mod Name -End - Use this to mark the end of a block of code added by the mod (some authors use - - - instead of End)
Even if you never make a mod, and are just trying to merge them, the above commenting principles are used by most mod makers, and knowing them will help in reading code, and merging them.
Post automatically merged:
Open files in Notepad++ it's free. (Not windows Notepad, it's crap)Really hoping someone can help me out with this.
Error [mod0000_mergedfiles]game\gameplay\ability\playerabilitymanager.ws(1741): Found unexpected '}'
Error [mod0000_mergedfiles]game\gameplay\ability\playerabilitymanager.ws(4790): Found unexpected '}'
Error [mod0000_mergedfiles]game\gui\menus\mapmenu.ws(1347): Found unexpected '}'
Error [mod0000_mergedfiles]game\gui\menus\mapmenu.ws(1513): Found unexpected '}'
View attachment 11030288
Always [mod0000_mergedfiles] = <Path To Your Game>\Mods\mod0000_MergedFiles\Content\Scripts
So for first error file is;
<Path To Your Game>\Mods\mod0000_MergedFiles\Content\Scripts\game\gameplay\ability\playerabilitymanager.ws
We have two "unexpected" close curly brackets }, that means the matching open curly brackets { are missing.
With closed Bracket errors we start at the last one, so scroll to Line 4790, and click on the close curly bracket } on that line.
Notepad++ does it's magic now, and gives you a line to follow, at the top of which should be the open curly bracket {
Now to confirm our suspicions, we need to check Vanilla, and any mods indicated by nearby commented mod edits.
Repeat for the other four errors, which are all missing open curly brackets {
Not much I can do without at least a link to the merged file in question.
Post automatically merged:
Well forget Script Merger, error says it's with the modNewGamePlusPlus, not the Script Merger's mod0000_MergedFilesHi, I am having trouble installing some mods.
I am trying to install it with no knowledge of how to script merge other than using the script merger.
I was wondering if anyone could please help me install it.
Please have a look, any help would be appreciated.
You've not installed this mod correctly.
There's a Menu XML file that goes here
<Path To Your Game>\Bin\Config\R4Game\User_Config_Matrix\PC\modnewgameplusplus.xml
Best place to get help with a specific mod, is on the mods Nexus Page.
Mod Menu Limit Fix
Only thing to add, is be aware of the nine Submenu limit, and the mod we use to add more than nine Mod menus.
Community Patch - Menu Strings by Wasteland Ghost aka wghost81
Also read the Description page, but in short, for every Mod XML
Search for
Mods
Replace with Mods.subsection where subsection is the listed IDs, Like this
Mods.alchemy_and_equipment
Mods.camera
Mods.characters
Mods.combat
Mods.gameplay
Mods.quests_and_adventures
Mods.user_interface
Mods.visuals_and_graphics
Mods.miscellaneous
This gives us Nine categories, each of which can hold nine mod menus, giving us 81 in Total.
Also be aware the Categories are just for convenience, mod menus don't care where they are put.
Attachments
Last edited:


