Jump to content

Modding XCOM under Linux


wghost81

Recommended Posts

We have ways. :laugh: Thanks for heads up, I will look into it. It's seems easier to make a mod with UPKUtils than alternative.

 

ANyways I found another way to to get excavated 1st chamber to the right on 1st level.

 

COuld you please look at the code here if you see a way to restrict steam vents to 4th level? Two pairs of eyes are better than one.

 

function GenerateTiles()
{
    local int X, Y;
    local array<int> arrDeepRockTiles;
    local int iNumSteamVents, iTile, I;

    iNumSteamVents = 1 + Rand(class'XGTacticalGameCore'.default.NUM_STARTING_STEAM_VENTS);
    m_arrTiles.Add(5 * 7);
    m_arrFacilities.Add(5 * 7);
    Y = 0;
    J0x5a:

    // End:0x333 Loop:True
    if(Y < 5)
    {
        X = 0;
        J0x75:

        // End:0x325 Loop:True
        if(X < 7)
        {
            // End:0xd3 Loop:False
            if(Y == 0)
            {
                m_arrTiles[TileIndex(X, Y)].iType = 3;
            }
            // End:0x291
            else
            {
                // End:0x181 Loop:False
                if(Y == 1)
                {
                    m_arrTiles[TileIndex(X, Y)].iType = 3;
                    // End:0x17e Loop:False
                    if(X > 7 / 2 && (Roll(75)))
                    {
                        m_arrTiles[TileIndex(X, Y)].iType = 0;
                    }
                }
                // End:0x291
                else
                {
                    // End:0x1df Loop:False
                    if(IsAccessLocation(X, Y))
                    {
                        m_arrTiles[TileIndex(X, Y)].iType = 3;
                    }
                    // End:0x291
                    else
                    {
                        // End:0x22d Loop:False
                        if(Roll(20))
                        {
                            m_arrTiles[TileIndex(X, Y)].iType = 2;
                        }
                        // End:0x291
                        else
                        {
                            m_arrTiles[TileIndex(X, Y)].iType = 0;
                            arrDeepRockTiles.AddItem(TileIndex(X, Y));
                        }
                    }
                }
            }
            m_arrTiles[TileIndex(X, Y)].X = X;
            m_arrTiles[TileIndex(X, Y)].Y = Y;
            ++ X;
            // This is an implied JumpToken; Continue!
            goto J0x75;
        }
        ++ Y;
        // This is an implied JumpToken; Continue!
        goto J0x5a;
    }
    I = 0;
    J0x33e:

    // End:0x3e0 Loop:True
    if(I < iNumSteamVents)
    {
        iTile = Rand(arrDeepRockTiles.Length);
        m_arrTiles[arrDeepRockTiles[iTile]].iType = 1;
        m_arrSteamTiles.AddItem(arrDeepRockTiles[iTile]);
        arrDeepRockTiles.Remove(iTile, 1);
        ++ I;
        // This is an implied JumpToken; Continue!
        goto J0x33e;
    }
    SetFacility(1, 0, 0);
    SetFacility(3, 2, 0);
    SetFacility(2, 4, 0);
    SetFacility(4, 6, 0);
    SetFacility(6, 3, 1);
    m_arrTiles[TileIndex(3, 1)].iTileState = 1;
    SetFacility(9, 2, 1);
    // End:0x4bc Loop:False
    if(Game().GetDifficulty() <= 1)
    {
        SetFacility(12, 0, 1);
        Game().m_arrFacilityUnlocks[12] = 1;
    }
    UpdateTiles();
}

 

Link to comment
Share on other sites

  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

As far as I can see, steam vents are placed on "deep rock tiles", taken randomly from arrDeepRockTiles. So, if you'll change main loop to generate deep rock tiles on 4th level only, steam vents will appear on 4th level only too.
Link to comment
Share on other sites

I'm trying to install The Revenge of the Sleeves mod by ignoring the UPK stuff* and just dropping in the ini file, but everytime I open the game the file gets reset, even when I set it to read-only.

 

*If I'm reading right, the only reason to use the UPK modding part is to add even more armor settings, and isn't required to use the mod. I could be wrong...

Edited by RPGmaster94
Link to comment
Share on other sites

RPGmaster94, game is re-downloading XComGameCore.ini file each time you run it. You need to disable "phoning home" by blocking Firaxis' servers: http://wiki.tesnexus.com/index.php/Basic_Guide_to_installing_mods#Linux_Differences

 

OK, so I after adding both things to my hosts and host.deny files and turning off updating in Steam, and then rebooting my computer, I'm still getting the files reset everytime I open the game. :(

I am just supposed to be copying the XComContent.ini to ~/.local/share/feral-interactive/XCOM/XEW/WritableFiles right?

Link to comment
Share on other sites

What ~/.local/share/feral-interactive/XCOM/XEW/Logs/Launch.log says? It should say "error downloading..." or "error resolving..."

 

Try to remove all the files from WritableFiles folder, make changes to defaultcontent and run the game. Then open newly created by the game XComContent.ini and see if your changes are present.

Link to comment
Share on other sites

Try to remove all the files from WritableFiles folder, make changes to defaultcontent and run the game. Then open newly created by the game XComContent.ini and see if your changes are present.

 

 

That did it!

 

I made a zipped up backup of the Writable files and then deleted them, and then I replaced the defaultcontent.ini with the XComContent.ini from the mod. And now my Gene modded soldiers are nice and fully clothed! Thank you so much. :D

Link to comment
Share on other sites

I've tried making a SIMPLE SCRIPT HOWEVER IT FAILS AT FINDING AN OBJECT:

 

Searching for object named XGBase.GenerateTiles.Function ...
Can't find object named XGBase.GenerateTiles.Function
Execution stopped at #4 command named OBJECT.

Correct name for object is XGBase.GenerateTiles

Edited by Amphibious
Link to comment
Share on other sites

As far as I can see, steam vents are placed on "deep rock tiles", taken randomly from arrDeepRockTiles. So, if you'll change main loop to generate deep rock tiles on 4th level only, steam vents will appear on 4th level only too.

 

Yes but this would unearth all the other tiles, right? COuld I simply avoid it by changing:

 

{

m_arrTiles[TileIndex(X, Y)].iType = 0;

arrDeepRockTiles.AddItem(TileIndex(X, Y));

}

 

to

 

{

m_arrTiles[TileIndex(X, Y)].iType = 0;

arrDeepRockTiles.AddItem(TileIndex(X, 4));

}

 

So simply it isnt added to Array of Deep Rock TIles. I hope that array isn't used for anything else though,

 

However it will be tricky to find a non-number value. Any hints on how to do it?

Edited by Amphibious
Link to comment
Share on other sites

Amphibious, you can try to ignore arrDeepRockTiles completely and rewrite steam vents generation code from the scratch.

 

If you simply replace Y with 4, you could end up having two or more tiles with the same X and Y. Anyway, replacing local variable with constant number will shift memory offsets and will require jump tokens fix. IMO, in this case rewriting the whole function is easier.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...