Jump to content

TechTree rework mod to add as a 2nd Wave option


Dethraker

Recommended Posts

I think I know the problem. I had a very similar problem with JumpStart with trying to get interceptors working properly - it took me hours to figure out what was going wrong.

 

The bug here is that your mutator is hooking too early, during BuildTechs, but during BuildTechs the lab facility hasn't yet been attached to the HQ. This is why you are getting the "accessed None 'm_kLabs' warning.

 

BuildTechs is called from XGTechTree.Init(). XGTechTree is a member of XGFacility_Labs, which is set up in XGHeadquarters.CreateFacilities(). But the way that it does this initialization is by Spawning the facility into a local variable, calling Init() on that facility, and *then* assigning it to the facilities array. So at the point where XGTechTree is building the techs, the lab isn't hooked up to the HQ. Your mutator then fires and tries to find the XGTechTree object via the labs in the HQ, but the labs aren't there yet.

 

A couple of options: Defer the mutator until some time later after the original tech tree has been built, or instead of looking up the tech tree instance through the labs you can look it up with something like:

 

 

local XGTechTree kTechTree;
foreach AllActors(class'XGTechTree',kTechTree)
{
   BuildAltTechs(kTechTree);
   break;
}
Link to comment
Share on other sites

I haven't read the whole thread, so maybe I'm missing something, but is there a reason for you trying to build the alternate tech tree using a completely separate function? Wouldn't it be easier just to mod the existing BuildTechs function to set them up based on the second wave option setting?

 

The log file error means your m_kLabs variable is undefined for some reason so your tech tree isn't being built at all.

Link to comment
Share on other sites

The best option, IMO, would be to replace XGTechTree with it's child class and override BuildAltTechs function. XGTechTree is spawned in one place inside Labs class and is easy to replace.

 

SpazmoJones, he wants to make it ini configurable.

Edited by wghost81
Link to comment
Share on other sites

Hey Spazma,

 

Basically this project accomplishes several things, it's not just a rearrange of the research tech order. As wghost stated I'm going to make my mutator ini configurable to insert different data depending on research, foundry projects, etc. What is shown is actually just me trying to see a result inside the game, I am also adding foundry projects, reworking the time, cost, etc. for a good portion of the research as well as the new foundry projects.

 

I also hope to be able to use the separate ini to change damage values for weapons if x tech has been researched. Rather than using an ini patcher I figured I could set it up to have a mutator that can use new data access new data for the game thus not having to worry about a lengthy process for anyone that downloads my mod to make the changes in the related DGC.ini, and .int files. It's a work in progress :D.

 

@tracktwo & wghost,

 

Thanks again, I think I found what you're referring to:

 

 

 

function Init(bool bLoadingFromSave)
{
    m_kTree = Spawn(class'XGTechTree');
    m_kTree.Init();
    BaseInit();
    UpdateLabBonus();
    // End:0x74
    if(m_arrProgress.Length == 0)
    {
        m_arrProgress.Add(76);
    }
    // End:0x91
    if(m_arrTimeSpent.Length == 0)
    {
        m_arrTimeSpent.Add(76);
    }
    // End:0xAE
    if(m_arrCredits.Length == 0)
    {
        m_arrCredits.Add(10);
    }
    // End:0xCB
    if(m_arrMusingTracker.Length == 0)
    {
        m_arrMusingTracker.Add(8);
    }
    //return;    
}

 

 

 

I'd like to implement as much as possible through my mutator, but it does seem like that would be an easy HEX change.

Link to comment
Share on other sites

  • 1 month later...

Long overdo update on my own progress with my mod. Been spending allot of time figuring out how the code works in XCom, something many of you have been a huge help with. I just wish I had started modding this game back with the rest of you, ah well.

 

So my mod is working in game, the values are changing based on the ini information input but I'm running into a couple of problems right now that I'm trying to work out. Mainly the issue is finding a way to get the stat changes to show up in the weapon/armor cards under XComGame.XGItemCards, otherwise the changes are made but you have no way to tell inside the game(weapon hit values are from x-y so they vary a bit anyway especially with LW adding defense).

 

Other than that not really a whole lot to talk about, want to make sure the in-game info is updated before I make my first release.

Link to comment
Share on other sites

Ok, so I've finally put out an initial beta release for my mod, it adds some things that can be configured through simple .ini edits and modifies the gameplay by reworking Research and Foundry Techs. More details on the mod page:

 

http://www.nexusmods.com/xcom/mods/641/?

 

I'm gonna try working on a UI mutator next so that anyone using mutators can make easy changes to the XGItemCards in order to have those changes reflected, will start a new thread for that once I familiarize myself with the classes and assets I will need to work with/modify. I will probably release the UI mutator as a separate mod once I get a good handle on it in case others have no desire to dl my mod along with it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...