Jump to content

Restart Mission in Pause Menu


Drakous79

Recommended Posts

If you need to restart any mission (even on ironman), then you're at the right place. It is nice feature (with disabled developer's console) for testing or making video/screenshots. I used it for Mechanized Warfare pics and abused it to revive a soldier, who was shot through a wall (but since it happened, I grenade that wall as a part of my strategy). Also it's an alternative for save/load play style. Here is the background in case somebody finds it usefull.

 

Edit: ToolBoks mod at nexusmods

 

By default, restart option is allowed in the first and the last (final) mission, while not playing ironman. Changing it required to modify two conditions.

 

http://i.imgur.com/8mUwA0U.jpg

 

XComGame.upk, class UIPauseMenu - adds the option into the menu

simulated function BuildMenu()
{
...
    if((((kMPGRI == none) && !m_bIsIronman) && XComPresentationLayer(controllerRef.m_Pres) != none) && (XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).m_kDesc.m_iMissionType == 8) || XGBattle_SP(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle).m_kDesc.m_bIsFirstMission)
    {
        m_optRestart = ++ iCurrent;
        AS_AddOption(m_optRestart, m_sRestartLevel, 0);
    }
    else
    {
        m_optRestart = -1;
    }
...
}


// Removed ironman, the first and the last mission from the condition. Also added 0B tokens and 27 dummy variable calls to get the right memory size.


if((kMPGRI == none) && XComPresentationLayer(controllerRef.m_Pres) != none)


HEX [356266] Patch 4
--------------------
SF: 07 AD 03 82 82 82 72 00 85 20 00 00 2A 16 18 0D 00 81 2D 01 44 20 00 00 16 16 18 2B 00 77 2E D8 69 00 00 19 01 6D 02 00 00 09 00 A5 55 00 00 00 01 A5 55 00 00 2A 16 16 18 15 01 84 9A 19 19 2E 33 9F 00 00 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 09 00 A3 9C 00 00 00 01 A3 9C 00 00 09 00 B0 9F 00 00 00 01 B0 9F 00 00 2C 08 16 18 87 00 19 19 2E 33 9F 00 00 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 09 00 A3 9C 00 00 00 01 A3 9C 00 00 0A 00 A9 9F 00 00 00 2D 01 A9 9F 00 00 16 16 0F 01 1E 20 00 00 A5 00 86 20 00 00 16 1B 5A 05 00 00 00 00 00 00 01 1E 20 00 00 01 2C 20 00 00 25 16 06 BC 03 0F 01 1E 20 00 00 1D FF FF FF FF
RW: 07 83 02 82 72 00 85 20 00 00 2A 16 18 2B 00 77 2E D8 69 00 00 19 01 6D 02 00 00 09 00 A5 55 00 00 00 01 A5 55 00 00 2A 16 16 0F 01 1E 20 00 00 A5 00 86 20 00 00 16 1B 5A 05 00 00 00 00 00 00 01 1E 20 00 00 01 2C 20 00 00 25 16 06 92 02 0F 01 1E 20 00 00 1D FF FF FF FF 0B 0B 0B 0B 0B 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 00 86 20 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

Offset 5425914 - RW

XComGame.upk, class UIPauseMenu - controls popup window

simulated function OnUAccept()
{
...
    switch(m_iCurrentSelection)
    {
        case m_optRestart:
            if(((XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle != none) && WorldInfo.NetMode == NM_Standalone) && !m_bIsIronman)
            {
                RestartMissionDialogue();
            }
            break;
...
}


// Replaced !m_bIsIronman with m_optRestart > 0.


if(((XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle != none) && WorldInfo.NetMode == NM_Standalone) && m_optRestart > 0)


HEX [356266] Patch 4
--------------------
SF: 0A E7 02 01 1E 20 00 00 07 E4 02 82 82 77 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 2A 16 18 27 00 9A 38 3A 19 01 E9 F9 FF FF 09 00 AB FE FF FF 00 01 AB FE FF FF 38 3A 24 00 16 16 18 0D 00 81 2D 01 44 20 00 00 16 16
RW: 0A E7 02 01 1E 20 00 00 07 E4 02 82 82 77 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 2A 16 18 27 00 9A 38 3A 19 01 E9 F9 FF FF 09 00 AB FE FF FF 00 01 AB FE FF FF 38 3A 24 00 16 16 18 0D 00 97 01 1E 20 00 00 25 16 16

Offset 5420082 - 97 01 1E 20 00 00 25
Edited by Drakous79
Link to comment
Share on other sites

  • 8 years later...
  • Recently Browsing   0 members

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