Jump to content

Recommended Posts

Posted

I read that the Old Developer console trick won't work with the Enemy Within exe file. Has anyone found a way to unlock it?

 

And yes, I'm aware of the console bindings trick, I just want to know how to use the developer console for future reference.

Posted (edited)

Hex change for IsRetailGame check in XComEW.exe still works, though I've been unable to get Developer's Shell and Debug menus.

 

Search: 44 24 08 C7 00 01 00 00 00 C2 08 00 8B 4C 24 08 C7 01 01 00 00 00 C2 08 00 CC CC CC CC CC CC CC

Replace: 44 24 08 C7 00 00 00 00 00 C2 08 00 8B 4C 24 08 C7 01 00 00 00 00 C2 08 00 CC CC CC CC CC CC CC

Edited by Drakous79
  • 1 month later...
Posted (edited)

If I'm right, IsRetailGame check is used only in XComGame.upk, class XComTacticalController, function ToggleDebugCamera() in XCOM Enemy Within.

if(!class'Engine'.static.IsRetailGame() || class'Engine'.static.IsConsoleAllowed())

As you can see, there is OR IsConsoleAllowed, which is used to enable/disable console and developer's shell.

 

IsConsoleAllowed is native function returning false. Because we want it to return true, we can either expand and rewrite its entry in Engine.upk with PatcherGUI (details in UPK file format thread), or thanks to help of Capyvara and dreadylein, alter XComEW.exe:

// Rewrite the last 5 bytes with B8 01 00 00 00
// This is for EW Patch 1.
SF: 8B 44 24 04 FF 40 18 8B 48 18 80 39 41 75 1F 41 6A 00 89 48 18 8B 48 14 50 FF 15 94 E9 C4 01 8B 44 24 08 8B 0D 38 B1 C3 01 89 08 C2 08 00 8B 54 24 08 A1 38 B1 C3 01
RW: 8B 44 24 04 FF 40 18 8B 48 18 80 39 41 75 1F 41 6A 00 89 48 18 8B 48 14 50 FF 15 94 E9 C4 01 8B 44 24 08 8B 0D 38 B1 C3 01 89 08 C2 08 00 8B 54 24 08 B8 01 00 00 00

So far I tested both ways - started the game, typed exit into console, started again, loaded saved game and typed ToggleUnitFlags into console.

 

Known issues:

  • Buttons of Debug Menu (ToggleDebugMenu) aren't responding to keyboard or mouse input.
  • Tilde key does nothing. Edit: Got it working, now fine tuning it.

 

More info can be found in Nexus Wiki articles: Developer Console and XCOM Developer Shell.

Edited by Drakous79
  • 2 months later...
Posted

I saw that you updated the wiki page ( http://wiki.tesnexus.com/index.php/Developer_Console_-_XCOM:EU_2012) with a PatchGUI compatible chunk of code that modified Engine.upk to enable the developer console.

 

I went ahead and translated it into a UPKmodder-compatible format as well (for my own use), and posted the results back to the wiki. I wasn't able to find the exe-patch given above (which is what I was using in EW patch 1 for testing/debugging).

 

Wanted to give a big 'Thanks!' for figuring out how to enable the console for patch 2.

Posted

Thanks Amineri :)

 

It wouldn't be possible without a knowledge and an effort of other people (like ghost girl's post about function flags and Eliot's UE Explorer to name a few).

 

Do you think it is worth to update hex for XComEW.exe too?

Posted

IMHO, it wouldn't hurt to update the EXE hex change although I'll probably stick with the upk change now, but just because it's easier for me to work with the upks because I have better tools for them.

Posted (edited)

Did a little work with Drakous79 original code and turned it into all EW versions compatible mod:

DESCRIPTION=Enables Console and Developer's Shell for XCOM Enemy Within

UPK_FILE=Engine.upk

{ IsConsoleAllowed will be moved and expanded }
EXPAND_FUNCTION=Engine.IsConsoleAllowed:66

{ New virtual and physical size }
REL_OFFSET=0x28
MODDED_HEX=03 00 00 00 03 00 00 00

{ Return true }
REL_OFFSET=0x30
MODDED_HEX=04 27

{ Function's flags }
REL_OFFSET=0x36
MODDED_HEX=02 01 02 00
Drakous79, hope you don't mind. :wink: I reeeeally needed it right now. :smile: Edited by wghost81
Posted

Well done ghost :)

 

I see you don't have ReturnValue there. Isn't it needed?

Posted
As far as I can't tell, it doesn't needed to be used explicitly in the code. It's probably used internally by UE to store return value, like 'true' in this case.
  • 4 weeks later...
Posted (edited)

EU version, works with all patches:

DESCRIPTION=Enables Console and Developer's Shell for XCOM Enemy Unknown

UPK_FILE=Engine.upk

{ IsRetailGame will be moved and expanded }
EXPAND_FUNCTION=Engine.IsRetailGame:66

{ New virtual and physical size }
REL_OFFSET=0x28
MODDED_HEX=03 00 00 00 03 00 00 00

{ Return false }
REL_OFFSET=0x30
MODDED_HEX=04 28

{ Function's flags }
REL_OFFSET=0x36
MODDED_HEX=02 01 02 00
( Returning to modding/playing EU is like reuniting with an old friend. I'm able to rotate a hologlobe! I can see panic messages instantly! I don't need to wait till Interceptor returns to send Skyranger on mission! And I don't see orange. :smile: ) Edited by wghost81
  • Recently Browsing   0 members

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