Jump to content

Starting year 2015


Drakous79

Recommended Posts

http://i.imgur.com/X6Lij.png

 

Altering start day requires changing 4 classes within XComSTrategyGame. Posting just parts of the code.

 

XComSTrategyGame.upk - classes XGGeoscape, XGStrategyAI

function InitNewGame()
{
 m_kDateTime.SetTime(0, 0, 0, 3, 1, 2015);
}

XComSTrategyGame.upk - class XGFundingCouncil

function CreateMission(TFCMission MissionData)
{
 kDateTime.SetTime(0, 0, 0, 3, 1, 2015);
}

Searched unpacked XComStrategyGame.upk for hex values 03 26 1D DF 07 (3 matches) and changed them to 03 26 1D DC 07. Haven't tested zeros in the function, can be time setting.

 

XComSTrategyGame.upk - class XGDateTime

function bool IsFirstDay()
{
 return m_iMonth == 3 && (m_iYear == 2015) && (m_iDay == 1);
}

Searched unpacked XComSTrategyGame.upk for complete copy pasted hex values from unpacked IsFirstDay.Function and changed DF 07 to DC 07.

 

After edits fired XSHAPE and tested in the game past the first month and it seems to work ok.

 

Well, not so great mod idea, but couldn't resist after seeing confusing year constant :)

 

Edit: I slacked. Correct function in XGFundingCouncil class is CreateMission, not InitNewGame.

Edited by Drakous79
Link to comment
Share on other sites

XComStrategyGame.upk > XGDateTime

 

function SetTime(int iHour, int iMinute, int iSecond, int iMonth, int iDay, int iYear)
{
m_fTime = float(iSecond + iMinute * 60 + iHour * 60 * 60);
m_iDay = iDay;
m_iMonth = iMonth;
m_iYear = iYear;
// End:0xa6 Loop:False
if(m_iMonth > 12)
{
	m_iMonth = Ceil(m_iMonth, 12) + 1;
	m_iYear += 1;
}
}

 

:)

Edited by BlackAlpha
Link to comment
Share on other sites

It's not hard, after done few times. And after setting all tools and stuff, it is just files and bytes juggling. Will be a lot easier later with XCOM Mod Manager. Will try to guide you so you can do it yourself.

 

1. Create some work directory.

 

2. Copy file from Steam\SteamApps\common\XCom-Enemy-Unknown\XComGame\CookedPCConsole\ to the work directory:

XComSTrategyGame.upk

3. THE MOST IMPORTANT PART is to backup files in Steam\SteamApps\common\XCom-Enemy-Unknown\XComGame\CookedPCConsole\:

XComStrategyGame.upk

XComStrategyGame.upk.uncompressed_size

I usually just rename them to name_BACKUP.extension, because it serves as backup and I don't have to delete name.uncompressed_size later in order to make the game load uncompressed upk.

 

4. Get Gildor's Unreal Package Decompressor listed under other tools, extract from zip to the work directory. Fire up command line, navigate to your work directory and type decompress -lzo XComStrategyGame.upk. Should decompress the file.

 

That's for preparation :)

 

5. Get some hex editor like HxD, install, run it, File | Open unpacked XComStrategyGame.upk from the work directory\unpacked.

 

6. Now it's time to change 2015 to 1999. Search | Replace or CTRL+R, switch Datatype to Hex-values, tick Search direction all and input:

Search for: 03 26 1D DF 07
Replace with: 03 26 1D CF 07

Click Replace all. Should return: Replaced 3 ocurrences.

 

Replace again:

Search for: 00 00 1D DF 07
Replace with: 00 00 1D CF 07

Click Replace all. Should return: Replaced 1 ocurrences.

 

Now FILE | Save as to Steam\SteamApps\common\XCom-Enemy-Unknown\XComGame\CookedPCConsole\XComStrategyGame.upk

 

7. Get XSHAPE and extract it to the game's root directory. My is S:\Steam\SteamApps\common\XCom-Enemy-Unknown\

Run XSHAPE from command line. I added pause at the end of XSHAPE.bat to see results, so no longer need to run it from cmd. XSHAPE should report 1 SHA hash(es) updated.

 

8. Remove (if you have backup) or rename XComStrategyGame.upk.uncompressed_size in Steam\SteamApps\common\XCom-Enemy-Unknown\XComGame\CookedPCConsole\

 

9. Run the game and verify the change. Good idea to start new game. If the game crashes, either editing upk failed or hash was not updated.

 

Date should be stored in save file. Redo steps 6-9, if starting new game after official patch that changed XComStrategyGame.upk. If the patch changed just XComGame.exe, run XSHAPE. Also can happen, that some tools alter the exe and would be needed to update SHA hash again (XSHAPE) ... well, should be obvious, if the game crashes after mod installation.

 

Let me know if it works for you. Guys are already working on XCOM Mod Manager to make mod distribution easier. But meanwhile, they have my thanks for tools they already gave us :thumbsup:

 

Edit: Typos

Edited by Drakous79
Link to comment
Share on other sites

The first month felt like usual - few abductions, 2 outsiders - and transition to the next month was okay.

 

You're right, UFO schedule is set monthly.

 

File XComSTrategyGame.upk, class XGstrategyAI

function FillUFOPool()
{
local int iMonth;

iMonth = GetMonth();
// End:0x53 Loop:False
if(iMonth >= 0)
{
	AddUFOToPool(MakeUFO(4, 1));
	AddUFOToPool(MakeUFO(4, 1));
}
// End:0xaa Loop:False
if(iMonth >= 1)

Edit: Also squads are done similar way.

 

File XComSTrategyGame.upk, class XGstrategyAI

function TPossibleAlienSquad GetPossibleAliens()
{
local int iMonth;
local TPossibleAlienSquad kSquad;

iMonth = GetMonth();
AddPossible(GetCommanderType(), 100, kSquad.arrPossibleCommanders);
// End:0xda Loop:False
if(iMonth <= 0)
{
	AddPossible(4, 100, kSquad.arrPossibleSoldiers);
	AddPossible(13, 100, kSquad.arrPossibleSecondaries);
	AddPossible(17, 100, kSquad.arrPossibleRoaming);
}
// End:0xdea
else
{
	// End:0x1c4 Loop:False
	if(iMonth <= 1)

Edited by Drakous79
Link to comment
Share on other sites

  • Recently Browsing   0 members

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