Script Compilation Error with modded game

+
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.
Hey 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
At least try to understand, errors pretty much tell you what's wrong
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:

Hello 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'

So line 2111 expecting { as above
Listing from line 2109 we have
Code:
    event /*flash*/ OnResetKeybinds():void
    //---=== modFriendlyHUD ===---
    function ShouldHideDLCIcons() : bool
    {
        return theGame.GetInGameConfigWrapper().GetVarValue('fhudMainMenu', 'fhudHideDLC');
    }
    //---=== modFriendlyHUD ===---

    {
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

Code:
    //---=== modFriendlyHUD ===---
    function ShouldHideDLCIcons() : bool
    {
        return theGame.GetInGameConfigWrapper().GetVarValue('fhudMainMenu', 'fhudHideDLC');
    }
    //---=== modFriendlyHUD ===---

    event  OnResetKeybinds():void
    {
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.
Post automatically merged:

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
Open files in Notepad++ it's free. (Not windows Notepad, it's crap)
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:

Hi, 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.
Well forget Script Merger, error says it's with the modNewGamePlusPlus, not the Script Merger's mod0000_MergedFiles
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

  • TW3 Witcher Script [WS] - Dark.zip
    1.3 KB · Views: 237
Last edited:
Hi all, got a rather annoying script compile error:

Error [mod0000_mergedfiles]game\player\playerwitcher.ws(694): syntax error, unexpected TOKEN_IDENT, expecting TOKEN_FUNCTION, near 'SSS_FixEquippedMutagens'


Another pair of eyes looking over this would be great - my knowledge of W3 modding isn't great, I confess ...

Thanks in advance (y)
 
Hi all, got a rather annoying script compile error:

Error [mod0000_mergedfiles]game\player\playerwitcher.ws(694): syntax error, unexpected TOKEN_IDENT, expecting TOKEN_FUNCTION, near 'SSS_FixEquippedMutagens'


Another pair of eyes looking over this would be great - my knowledge of W3 modding isn't great, I confess ...

Thanks in advance (y)
What exactly is the mods, and versions you are using that change slots.
I see what appears to be SSS (Slots Slots Slots) v5.0 (Balanced, Ultimate, and Casual are just different config settings, actual mod is the same).
Comparing it to that indicates huge deletion changes (Code should be commented out, never deleted)
Also added lines marked as SSS edits (//zur13 modSSS mutTabs), so I'm thinking one of the older versions maybe?

The error message states at line 694 unexpected TOKEN_IDENT, expecting TOKEN_FUNCTION, near 'SSS_FixEquippedMutagens

Starting at line 692 your merge patch shows
Code:
}
        muts = SSS_Patch_MutagenStacking(muts); //zur13 modSSS mutTabs
        } SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs
    }
We see two edits attributed to the SSS mod, but when I look at the SSS v5.0 code, for the line in your merge
Line 694 = } SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs

I have to go to here, meaning 104 lines of code are deleted from your merge
Line 798 = } SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs

it gets worse, SSS v 5.0 matches Vanilla (in the region) except for this one line.
Vanilla Line 798 = }

The full SSS v5.0 code explains what was expected from line 780
Code:
    private function FixEquippedMutagens()
    {
        var item : SItemUniqueId;
        if( GetItemEquippedOnSlot( EES_SkillMutagen1, item ) )
        {
            inv.SetItemStackable( item, false );
        }
        if( GetItemEquippedOnSlot( EES_SkillMutagen2, item ) )
        {
            inv.SetItemStackable( item, false );
        }
        if( GetItemEquippedOnSlot( EES_SkillMutagen3, item ) )
        {
            inv.SetItemStackable( item, false );
        }
        if( GetItemEquippedOnSlot( EES_SkillMutagen4, item ) )
        {
            inv.SetItemStackable( item, false );
        } SSS_FixEquippedMutagens(); //zur13 modSSS mutTabs
    }

Details of error
unexpected TOKEN_IDENT, (your code)
muts = SSS_Patch_MutagenStacking(muts); //zur13 modSSS mutTabs

expecting TOKEN_FUNCTION, near 'SSS_FixEquippedMutagens (Vanilla, and SSS v5.0) Line 780
private function FixEquippedMutagens()
This is completely missing from your merge patch, but so are over a 100 lines of Vanilla code.

So beyond explaining why the error occurs, and without knowing why, all the lines of Vanilla code were removed, I can't just say inserting that line will work.

My advice, without more info, is remove current SSS version, install SSS v5.0, and remerge.

{EDIT}
In fact though this is a great mod, it's substantial changes make it a real beast to merge successfully, and most heavily modded guides avoid it.
I used it way back when it was first released, but things were much simpler before the B&W DLC.
On my return this year, when I was less capable when dealing with script error's, I ditched it for
Extra Skill Slots and Mutations, and also use More Quick Slots And Quick Inventory (A must have for me), which is easier to merge.
I'm still under level 10, so not seen a reason to try to get SSS working yet, but could probably get it done now I've a better understanding of merging.
 
Last edited:
Why are you editing scripts directly in content0 in the first place?
Those are the game's original scripts; if you edit them, you cannot easily reverse the edits unless you make note of what and where you changed.

Looking at those errors, what I would do is download a fresh, unmodified copy of content0 (delete the current folder and then use Steam/GOG to redownload) and confine any modding to the Mods folder.

You can always make a copy of script files in content0 and place them in a new mod file, which you can then freely edit without messing up the base scripts.

(I may be missing something here, in which case my bad, but I have personally made the mistake of making edits in content0/scripts -- and then been forced to d/l some of the script folders fresh after messing up.)

Pls can u help me? Im literally tired of searchs ways to resolve all conlficts, after 20000 tries i get only one problem. I searched during 1 hour what to do with this problem but idk.

By the way thank you for all the effort in helping all the people who come looking for solutions
 

Attachments

  • dfgadsgasdgadsgadsgadsg.PNG
    dfgadsgasdgadsgadsgadsg.PNG
    104.6 KB · Views: 126
Error [mod0000_mergedfiles]game\gameplay\items\spells\ignientity.ws(637): Unexpected end of file found after '{' at line 31
Can anyone help me with this?
Thanks.
Post automatically merged:

Error [mod0000_mergedfiles]game\gameplay\items\spells\ignientity.ws(637): Unexpected end of file found after '{' at line 31
Can anyone help with this? Thanks.
 
Hey guys,

I just downloaded Witcher 3 GoTY as I finally wanted to play through Blood & Wine DLC.
As I wanted to make my experience as cool as possible mods were added - with AutoLoot the errors started.

Thanks to Script Merger I was able to combine all my mods but now this error shows up at the start:
Error [mod0000_mergedfiles]game\gameplay\containers\container.ws(1133): Unexpected end of file found after '{' at line 11

I really do not know where I need to add a } - can you help me please? :)

Thanks in advance!

Push :)
 
Hello
I have a problem the scipt compilation keep telling me
"Error [mod0000_mergedfiles]game\player\r4player.ws(15640): Unexpected end of file found after '{' at line 7"
mod used are :
better loot
dark soul style combat
god mod
critical slow motion
Magic Spells for Signs and Weapons.
thanks for your answer.
 

Attachments

  • r4Player.txt
    855.3 KB · Views: 194
Hi guys, i got this error while trying to start the game:
Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(2197): Unexpected end of file found after '{' at line 65

Here is my ingamemenu.ws file:https://pastebin.com/8x0Cf5GN

I hope someone can help me with this.
 
Hello evreyone. I need Yours help. My patience is finished.
Help mi with this: Error [mod0000_mergedfiles]game\player\playerwitcher.ws(2885): syntax error, unexpected TOKEN_IF, expecting TOKEN_FUNCTION, near 'if'
and Error [mod0000_mergedfiles]game\gameplay\items\spells\quenentity.ws(883): syntax error, unexpected TOKEN_IDENT, expecting TOKEN_FUNCTION, near 'caster'
Here is code 1: https://pastebin.com/3PTgGs9p
Here is code 2: https://pastebin.com/m5ntnJrH

Please, help.
 
Last edited:
Hello
Please help me

Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(794): Found unexpected '}'
Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(2167): Found unexpected '}'
Error [mod0000_mergedfiles]game\player\r4player.ws(15690): Found unexpected '}'

 
Hey guys I have the same issue
Error [mod0000_mergedfiles]game\player\playerwitcher.ws(11114): Unexpected end of file found after '{' at line 11

Except line 11 is the start of the class :(, and I have been struggling to find where I am missing the }, any help would be appreciated.
Thanks in advance
 
Hello everyone, I can't start the game because of this error:

Error [mod0000_mergedfiles]game\gui\main_menu\ingamemenu.ws(2209): Unexpected end of file found after '{' at line 65

This make me crazy

Pleas help me!!!!!!!!


thanks all for the help
 
Last edited:
Hello everyone, I'm a fan of the Witcher 3! Brand new on the forum I am happy to join the community.

Small request for help, I have conflicts with the immersive cam mods when I want to install it. And I'm really stuck :(
 
Hello everyone, I'm a fan of the Witcher 3! Brand new on the forum I am happy to join the community.

Small request for help, I have conflicts with the immersive cam mods when I want to install it. And I'm really stuck :(

You may want to post your mod list / load order / merge list to Pastebin as people have done above. I'm sure someone can give you an answer.
 
Okay SigiFey, I discovered pabestin. How do I get all this information and paste it into pabestin? Thank you.
 
Okay SigiFey, I discovered pabestin. How do I get all this information and paste it into pabestin? Thank you.

When you merge your files using one of the modding utilities, it will create a log somewhere. (I'm not really the person to ask about this -- I've only ever used one mod with TW3. :) )

If that all sounds like something you're unfamiliar with, I'd start reading here:
 
Top Bottom