Page 1 of 2

XCOM: Enemy Within

Posted: Wed Mar 29, 2017 9:34 am
by STN
Here's an initial table that should cover most of the tactical games.

Credits: Csimbi

The table includes a number of AOB scripts. AOB scripts might work with various game versions (or crash them).
You should enable the scripts only when you actually need them; turn them off for the rest of the time.

The first script includes:
- Infinite moves; obvious.
- Min. health; obvious.
- Min. offense; obvious.
- Min. defense; obvious.
- Min. will; obvious.
- Min. grenades; obvious.
- Min. Meld turns; keeps the turn counter at a minimum level. -1 means infinite.
- Min. stuns; obvious.
- Min. rockets; obvious.
Some of these are enabled by default - edit the script to change them to your liking.
You might need to flip once forth and back between team members so the UI of the currently selected soldier updates.

Intended usage for the "Soldier patcher" script:
1. Enable script.
2. Set up variables as desired (enable/disable Boolean values and change minimum values).
3. Switch back to game.
4. Go to Barracks -> View Soldiers and click on any soldier in the list.
5. Press and hold both CTRL and ALT when you click on the left/right arrow (the buttons that flip the page to the previous/next soldier).
6. The soldier you flip to while holding CTRL and ALT will be checked and patched if needed. Again: not the current one, the one you're about to switch to!
If you want all soldiers patched, just rapidly click through the whole list while holding CTRL and ALT.
As of update #6 and #7 soldier stats are included as well (see change log at the bottom), so the following two lines are more or less obsolete:
The table exposes a variable called 'pLastPatchedSoldier'; you can use the address in the data dissect window with reversed structures like, for example, this one. (My table does not come with any structures on purpose; I'm sure that a team of creative people out there will dig stuff out much faster than I possibly could alone.) If you don't know how to use the exposed address, just ignore it (or read tutorials on structures and the data dissect window).
If you have a nice dissected structure, post it, PM me and I'll link it here. Please consider colour-coding the values in your structure(s) for easy browsing and readability. Or, include a number of smaller structures (with related things) instead of a big one. Or do both. Wink

The object script exposes:
- Panic levels of each nation.

The resource script exposes:
- Money.
- Engineers.
- Scientists.
- Elerium.
- Alien Alloys.
- Weapon Fragments.
- Meld.
- +smoreidontwannatypeup.

Thanks to all of you who have contributed! (see change log below)

Update #1:
Added Min. Meld turns for the tactical phase.
Added a second script, which is a fixed version of the script I made earlier for the first XCOM game (the offsets were off, other than that, it works perfectly). Recovery time is missing (and is commented out) for now as I have no wounded soldier yet. If you know the offset, please let me know.

Update #2:
Added resource script.
Money, engineer and scientists were easy once I traced the money back to its parent array. Meld took some time as it does not seem to be part of any specific structure - I had to do a lot of pointer scans to eliminate false positives. Meld is sitting with a bunch of other variables that are mostly 0 or 100. For Meld, I picked the shortest possible pointer route with the same base address as money and scientists. If, for some reason it causes a crash (or other weird stuff), please let me know what you did when it happened.

Update #3:
It seems that the resource script has been reading into uninitialized memory on loading a game/mission, causing crashes.
Replaced resource script with a pointer grabber and exposed values via table entries instead, thus eliminating the crashes.

Update #4:
My resources (well, the items) disappeared; it seems I did pick the wrong pointer in update #2. I replaced it with another one, this one works better I hope.
Also, I exposed a bunch of items using pointers, not just resources.
I also found the recovery time, however setting the remaining time to 1 screwed up my augmentations, so until further testing it'll remain disabled.
Lastly, I got some abilities and more grenade types, so the tactical script will now patch those, too.

If you are willing to expand the pointerlist for items, the address you need to put into the dissect window is: [[[pArray]+598]+1f4] - enable the resource script to grab pArray.

Update #5:
Fixed recovery time in the soldier patcher; now your soldiers will be instantly healed.

Update #6:
Merged in the panic levels and the last selected soldier stats from lampuiho's post here and added the Psy abilities that were missing.
Thanks lampuiho!

Update #7:
Fixed an incorrect table entry - reported by Emmote here - thanks a lot!
Noone was complaining about the resource script v2 not working (other than crashes, which is now fixed), so I made that the resource script from now on.
At the same time, the old resource script was renamed to "object array script" and I moved the resources from under it to the new resource script.
Merged in additional soldier stats and resources from ilidan371's table here - and rearranged them a bit - thank you for you work as well!

Update #8:
pArray -> pMoneyObject "Replace all" also replaced Panic pointers - reported by ilidan371 here - thanks a lot!
Added 'Rocketeer' heavy ability.

Update #9:
Merged in construction time and medal offsets from ilidan371's post here - thank you for continued support! I think it's time to give you +1 rep. Wink

Update #10:
I added a second table for those playing v1.0.0.4964.
The hooks had to be updated (maybe an offset if I recall correctly); it seems they added a number of checks that trigger game exit and other fancy crap when the game is modified. I guess checking the whole image (it's 27 megs) would be quite taxing, so they check only certain points for modifications - guess which points? Anyway, since they do not check the whole image, I just moved the hooks elsewhere for now. In the future, we might have to disable these checks instead (or reroute them).
Added Foundry upgrade speeds (and I can't remember what else).

Update #11:
Updated v1.0.0.4964 table.
Tactical script: more grenades, battle scanner.
Soldier patcher script: more abilities exposed for easy patching (bPatch*).
Object array script: PSI labs queue
Resource script: Engineering queue (added only the first 5, but you can add more if you need them, just add +0x80 to the offsets.)

I am done with the game, so don't expect any more updates (well, from me, at least).

Those of you having problems with the panic level pointers, have a look at ilidan371's post here.

-----------
Credits: ilidan371
For those having trouble adjusting pointers for the panic levels, you can just use this table instead.

I've included 2 versions of the panic level pointers. If the 1st set don't show the right values, use the alternate. In my experience, one of them will always work, but I might be wrong.

Re: XCOM: Enemy Within

Posted: Tue May 02, 2017 1:45 pm
by RabbaDabba
None of the options under the tactical script seem to work, I enable it and they just automatically become gods regardless of what settings I input

Re: XCOM: Enemy Within

Posted: Wed May 03, 2017 1:57 pm
by RabbaDabba
Back again, I see now that you say many options are enabled by default and we need to edit your scripts to change them, how do I do that? Can I maybe get one that doesnt enable anything by default?

Re: XCOM: Enemy Within

Posted: Sat Sep 09, 2017 5:06 am
by symmas
I can't quite figure out how to make the resource script work. All the others appear to work just fine, however the resource script doesn't seem to do anything. None of the values fill in, they all remain question marks. Is there some trick to get it to work?

XCOM: Enemy Within

Posted: Wed May 09, 2018 12:16 pm
by lemaun
no work

Re: XCOM: Enemy Within

Posted: Fri Apr 24, 2020 3:25 pm
by asdfen
is there a table that works with steam's current version?

XCOM: Enemy Within

Posted: Thu May 28, 2020 4:29 pm
by beskkov
Some of it works, but is it easy to fix the stuff that dosent work?

Re: XCOM: Enemy Within

Posted: Wed Aug 12, 2020 8:12 am
by CompactDisc
beskkov wrote:
Thu May 28, 2020 4:29 pm
Some of it works, but is it easy to fix the stuff that dosent work?
I tried and failed miserably :P
The resource script is a bit of an enigma for me.
The code changes pointers constantly, but I don't know how to find the right one.

Re: XCOM: Enemy Within

Posted: Sun Jan 31, 2021 7:45 pm
by B0mak
Anyone can update this fine table?

Re: XCOM: Enemy Within

Posted: Sun Jan 31, 2021 11:26 pm
by sbryzl
I updated it and added some things.

Re: XCOM: Enemy Within

Posted: Mon May 31, 2021 2:04 pm
by drakkanis
Resource table doesn't work :(

Re: XCOM: Enemy Within

Posted: Mon Dec 27, 2021 7:33 pm
by Jaysynca
Nvm its working, thanks.

Re: XCOM: Enemy Within

Posted: Mon Jan 24, 2022 6:40 pm
by Contralto
I can't seem to figure out the soldier patcher. It says "Use CTRL+ALT in Barracks", which I go to the Barracks, select a unit, hit CTRL+ALT and...nothing happens. The pointer directs to 00000000 and all of the pointers for everything lists as just "??".

What am I missing?

Re: XCOM: Enemy Within

Posted: Tue Jan 25, 2022 9:00 pm
by sbryzl
Contralto wrote:
Mon Jan 24, 2022 6:40 pm
It says "Use CTRL+ALT in Barracks", which I go to the Barracks, select a unit, hit CTRL+ALT and...nothing happens.
I think you need to hold down CTRL and ALT while cycling through the soldiers.

Re: XCOM: Enemy Within

Posted: Wed Jan 26, 2022 4:12 pm
by Contralto
sbryzl wrote:
Tue Jan 25, 2022 9:00 pm
Contralto wrote:
Mon Jan 24, 2022 6:40 pm
It says "Use CTRL+ALT in Barracks", which I go to the Barracks, select a unit, hit CTRL+ALT and...nothing happens.
I think you need to hold down CTRL and ALT while cycling through the soldiers.
That's what I needed! Thank you, now all my soldiers can be Psi Ops! :D