Maclimes Posted March 8, 2016 Share Posted March 8, 2016 Here's what I have so far: First real mod, I'm attempting to re-skin the Sectoid (NOT create a NEW enemy; only change the existing Sectoid skin). My mod is named Villainous Visual Variety (or VVV). In the UDE, I created a new package called "VVV_Package". Inside is a group named "Sectoid" (I intend to later do other enemies in the same mod). Inside that group are the relevant textures, materials, mesh, and archetype, all properly linked together. (The Sectoid skin has been made vibrant blue with yellow spots, just for bug-testing purposes). The Archetype's name is "ARC_GameUnit_Sectoid" (just like the base game). The built-in model viewer shows the Sectoid mesh correctly with the correct skin and material, so I know everything at this stage is correct. I save this file into my Content folder for the mod. In ModBuddy, I add the UPK to my mod. Then I make the following edits: In Config, I add this to XComEngine.INI: [Engine.Engine] +ModClassOverrides=(BaseGameClass="X2Character_DefaultCharacters", ModClass="X2Character_VVVCharacters") In my SRC >VVV > Classes, I add the following file: "X2Characteer_VVVCharacters.uc", with the following content: class X2Character_VVVCharacters extends X2Character config(GameData_CharacterStats); static function X2CharacterTemplate CreateTemplate_Sectoid() { local X2CharacterTemplate CharTemplate; CharTemplate.strPawnArchetypes.AddItem("VVV_Package.Sectoid.ARC_GameUnit_Sectoid"); return CharTemplate; } Everything I've read seems to tell me that these two files, written this way, should redefine that one variable for the Sectoid's Archetype definition (to match the one I created). But in game, the Sectoid is still his usual pinky-grey self. (I also made a minor edit to force all Gatecrasher enemies to be Sectoids, so it's easy to test). The UPK package appears to be linking correctly internally, so I know the problem isn't *within* the package. My thinking is it's one of these three: The mod doesn't actually know "VVV_Package" exists. So when it's referenced (in CharTemplate.strPawnArchetypes.AddItem), it doesn't find it. Although I would think this would throw out an error...? The ClassOverrides in XComEngine.ini is incorrect. (So it's not even really processing X2Characteer_VVVCharacters.uc). The declaration in X2Characteer_VVVCharacters.uc is incorrect, so it's not applying the new Archetype. I'm wondering if I need to "declare" the VVV_Package at some point? Tell the game to look for that UPK? It is added to the Content folder in ModBuddy. Is that all I need to do? My big suspicion is that it's actually the third bullet, the X2Characteer_VVVCharacters.uc that is the problem, but I don't know enough about classes and templates at this stage to determine. I appreciate any help you might have. Thanks! Link to comment Share on other sites More sharing options...
Solariz Posted March 8, 2016 Share Posted March 8, 2016 (edited) Are you missing the CreateTemplates() function and the other lines from CreateTemplate_Sectoid, or did you simply not post it? I see your problem now. +ModClassOverrides=(BaseGameClass="X2Character_DefaultCharacters", ModClass="X2Character_VVVCharacters")You can not override / extend static functions.The game will still execute everything from DefaultCharacters and since you did not implement a CreateTemplates() function no characters are added.You might use X2CharacterTemplateManager though, if you want to overwrite the textures or create other variants more dynamically. Edited March 9, 2016 by Solariz Link to comment Share on other sites More sharing options...
Maclimes Posted March 9, 2016 Author Share Posted March 9, 2016 I was missing them completely. I'm very new to this, and didn't understand what was needed. However, when I added in those lines, it failed to Build. It seems to be this part: static function array<X2DataTemplate> CreateTemplates() { // ... Templates.AddItem(CreateTemplate_Sectoid()); // ... return Templates; }Without this, it builds successfully (although it doesn't actually work...). Link to comment Share on other sites More sharing options...
Solariz Posted March 9, 2016 Share Posted March 9, 2016 I lost a line when copy-pasteing the source code :pinch: Add this line after the { local array<X2DataTemplate> Templates; Link to comment Share on other sites More sharing options...
davidlallen Posted March 9, 2016 Share Posted March 9, 2016 You can not override / extend static functions. You can, but you have to do so carefully.http://forums.nexusmods.com/index.php?/topic/3825825-how-can-this-change-cause-that-bug/page-3&do=findComment&comment=35403650 Link to comment Share on other sites More sharing options...
Maclimes Posted March 9, 2016 Author Share Posted March 9, 2016 IT WORKED! Thank you so much, Solariz! Note: I got a red screen error: "Rejected template name already in use: Sectoid", but it worked. This tells me that it loaded my mod FIRST, established the Sectoid, then attempted to load the base game template. So yeah, LOTS of potential for incompatibility. Link to comment Share on other sites More sharing options...
Recommended Posts