Obelixdk Posted May 18, 2016 Share Posted May 18, 2016 (edited) I am trying to make a small additional mod pack containing DLC icons only (so i can easy add DLC icons to all my mods) but it fails to build every time with a "Error, Script vs. class name mismatch (UISL_ObelixDkDLCIconPack/UIScreenListener_UICustomize)" this is my Screenlistner // ********* FIRAXIS SOURCE CODE ******************// FILE: UIScreenListener_UICustomize// AUTHOR: Brit Steiner//// PURPOSE: Adding DLC icons to the item lists.////---------------------------------------------------------------------------------------// Copyright © 2009-2016 Firaxis Games, Inc. All rights reserved.//---------------------------------------------------------------------------------------class UIScreenListener_UICustomize extends UIScreenListener;// This event is triggered after a screen is initializedevent OnInit(UIScreen Screen){UICustomize(Screen).CustomizeManager.SubscribeToGetIconsForBodyPart(GetIconsForBodyPart);}// This event is triggered when a screen is removed/*event OnRemoved(UIScreen Screen){local UICustomize CustomizeScreen;CustomizeScreen = UICustomize(Screen);if( CustomizeScreen != none ){if( CustomizeScreen.CustomizeManager != None ){CustomizeScreen.CustomizeManager.UnsubscribeToGetIconsForBodyPart(GetIconsForBodyPart);}}}*/ function string GetIconsForBodyPart(X2BodyPartTemplate BodyPart){if( BodyPart.DLCName == 'PredatorOutfits' ){return class'UIUtilities_Text'.static.InjectImage("img:///UILibrary_ObelixDkDLCIconPack.PredatorMod.PredatorOutfits_Icon", 26, 26, -4) $ " ";}else{if( BodyPart.DLCName == 'KF2' ){return class'UIUtilities_Text'.static.InjectImage("img:///UILibrary_ObelixDkDLCIconPack.KF2.KF2_Icon", 26, 26, -4) $ " ";}return "";} and this is my X2DownloadableContentInfo //---------------------------------------------------------------------------------------// FILE: XComDownloadableContentInfo_ObelixDkDLCIconpack.uc // // Use the X2DownloadableContentInfo class to specify unique mod behavior when the// player creates a new campaign or loads a saved game.// //---------------------------------------------------------------------------------------// Copyright © 2016 Firaxis Games, Inc. All rights reserved.//---------------------------------------------------------------------------------------class X2DownloadableContentInfo_ObelixDkDLCIconPack extends X2DownloadableContentInfo;/// <summary>/// This method is run if the player loads a saved game that was created prior to this DLC / Mod being installed, and allows the/// DLC / Mod to perform custom processing in response. This will only be called once the first time a player loads a save that was/// create without the content installed. Subsequent saves will record that the content was installed./// </summary>static event OnLoadedSavedGame(){}/// <summary>/// Called when the player starts a new campaign while this DLC / Mod is installed/// </summary>static event InstallNewCampaign(XComGameState StartState){} and finally this is my error log --------------------ObelixDkDLCIconPack - Release-------------------- Analyzing... C:\Program Files (x86)\Steam\steamapps\common\XCOM 2 SDK\binaries\..\Development\Src\ObelixDkDLCIconpack\Classes\UISL_ObelixDkDLCIconPack.uc : Error, Script vs. class name mismatch (UISL_ObelixDkDLCIconPack/UIScreenListener_UICustomize) C:\Program Files (x86)\Steam\steamapps\common\XCOM 2 SDK\binaries\..\Development\Src\ObelixDkDLCIconpack\Classes\UISL_ObelixDkDLCIconPack.uc : Error, Script vs. class name mismatch (UISL_ObelixDkDLCIconPack/UIScreenListener_UICustomize) C:\Program Files (x86)\Steam\steamapps\common\XCOM 2 SDK\Development\Src\ObelixDkDLCIconpack\Classes\UIScreenListener_UICustomize.uc(49) : Error, Unexpected end of file at end of Class Compile aborted due to errors. Warning/Error Summary --------------------- C:\Program Files (x86)\Steam\steamapps\common\XCOM 2 SDK\binaries\..\Development\Src\ObelixDkDLCIconpack\Classes\UISL_ObelixDkDLCIconPack.uc : Error, Script vs. class name mismatch (UISL_ObelixDkDLCIconPack/UIScreenListener_UICustomize) C:\Program Files (x86)\Steam\steamapps\common\XCOM 2 SDK\Development\Src\ObelixDkDLCIconpack\Classes\UIScreenListener_UICustomize.uc(49) : Error, Unexpected end of file at end of Class Failure - 3 error(s), 0 warning(s) (2 Unique Errors, 0 Unique Warnings) Execution of commandlet took: 16.38 secondsDone building project "ObelixDk DLC Icon pack.x2proj" -- FAILED. I was talking with Zyxpsilon to see if he could help, but we couldnt find the error, although he did help me with what i needed to do if there was more than one option (if then / else) I used the same script for the PredatorOutfits mods DLC icon and there it worked fine.. Hope someone smarter than me is able to figure out what the problem with this is.. if you want to take a look at the entire thing it can be downloaded from my dropbox here : https://www.dropbox.com/s/ur43133u3kkmsu3/ObelixDk%20DLC%20Icon%20pack.rar?dl=0 Thanx in advance guys :) Edited May 18, 2016 by Obelixdk Link to comment Share on other sites More sharing options...
AuroraDelta Posted May 18, 2016 Share Posted May 18, 2016 (edited) Your first error is that in your screenlistener "class UIScreenListener_UICustomize extends UIScreenListener" Is not the name of the file you are using. Whatever that file is named must be what you put where UIScreenListener_UICustomize is. You need one more } at the end of your Screen Listener as well (This is why indenting each section of code by bracket is very helpful). Edited May 18, 2016 by AuroraDelta Link to comment Share on other sites More sharing options...
Obelixdk Posted May 18, 2016 Author Share Posted May 18, 2016 Seems like that did the trick.. thank you very much :) Link to comment Share on other sites More sharing options...
Zyxpsilon Posted May 18, 2016 Share Posted May 18, 2016 Gee.. both of these hints are exactly what i was suggesting in our chat yesterday evening! ;)Funny how a slightly indented Bracket can do to a conditional loop (( or two! )).And -- UIScreenListener_UICustomize class name was also mentionned.Glad everything if fine now. ;) Link to comment Share on other sites More sharing options...
Obelixdk Posted May 19, 2016 Author Share Posted May 19, 2016 (edited) yeah i guess i misunderstood what you meant Zyx. Like i said i am VERY new in this stuff, so mistakes WILL happen :) Sorry man :) Edited May 19, 2016 by Obelixdk Link to comment Share on other sites More sharing options...
Obelixdk Posted May 19, 2016 Author Share Posted May 19, 2016 I got my small script working and now i can add DLC icons easy to all my mods.. even voicepacks :) Thanx for the help to you two :)http://i.imgur.com/CyQdHh5.jpg Link to comment Share on other sites More sharing options...
Zyxpsilon Posted May 19, 2016 Share Posted May 19, 2016 Eureka!!! :ninja: :laugh: Link to comment Share on other sites More sharing options...
Recommended Posts