Jump to content

Long War upk changes


johnnylump

Recommended Posts

A lot of these were discovered by Drakous79 and BlackAlpha; but here's the updated code fixes after the Jan 7 2013 update -- a lot of things have changed.

 

These are unique code strings, so search and replace in the right files should do the trick.

 

XComGameStrategy.upk

Reduce base abductions per attempt from 3 to 1:

XGStrategyAI.GetNumAbductionSites

2C 03 04 3A 4B

to

2C 01 04 3A 4B

 

Second byte is key variable.

 

Allow abductions even with satellite coverage

XGStrategyAI.DetermineBestAbductionTargets

ef 00 07 c0 00 19 00 88

to

ef 00 06 c0 00 19 00 88

 

XGStrategyAI.AIAddNewObjectives

Change number of Abductions per month

0F 00 47 42 00 00 26 0F 00 48 42 00 00 26

to

0F 00 48 42 00 00 2C 04 0F 00 47 42 00 00

 

Key variable is the 04 -- you'll get that number of abductions plus 1.

 

Randomize abduction dates over month

XGStrategyAI.AddNewAbductions

(Position F0 x E)

4E 42 00 00 A7 2C 08

to

4E 42 00 00 A7 2C 1C

 

This is important if you have more than two abductions; otherwise they'll all be stacked in the first eight days of the month.

 

Monthly Terror Mission (instead of every other month), starting in April

XGStrategyAI.AIAddNewObjectives

0c 42 00 00 2c 02 0f

to

0c 42 00 00 2c 01 0f

 

 

Make UFO_LIMIT in defaultgamecore.ini set the actual number of UFOs encountered per month, rather than just the maximum (above abductor and terror missions)

XGStrategyAI.AIAddNewObjectives

(Position 1B x 8)

07 58 02 97 00

to

07 58 02 96 00

 

Force build times for all items (times set in DefaultGameCore.ini)

1d ff ff ff ff 07 52 00 84

to

1d ff ff ff ff 07 52 00 82

 

All difficulties Small Scout stats

24 04 1d dc 05 00 00 2c 14 1d 20 03 00 00 25 2c 07

to

24 04 1d ac 0d 00 00 2c 28 1d 20 03 00 00 25 2c 07

 

This makes a very fast small scout that is somewhat more difficult to shoot down.

 

Impossible Large Scout

24 05 1d 08 07 00 00 2c 16 1d 40 06 00 00 2c 02 2c 07

try

24 05 1d 80 0c 00 00 2c 23 1d D0 07 00 00 2c 02 2c 07

 

This makes a faster, more durable large scout.

 

Impossible Abductor

24 06 1d d0 07 00 00 2c 11 1d 98 08 00 00 2c 0d 2c 03

to

24 06 1d d0 07 00 00 2c 11 1d 80 0c 00 00 2c 0d 2c 03

This makes a much more durable abductor.

 

These aren't changed, but here are the code strings if you want to make changes.

 

Impossible Supply

24 07 1d c4 09 00 00 2c 19 1d 60 09 00 00 2c 24 2c 04

 

Impossible Battleship

24 08 1d b8 0b 00 00 2c 28 1d 54 0b 00 00 2c 34 2c 14

 

Impossible Overseer

24 09 1d ac 0d 00 00 2c 41 1d c4 09 00 00 2c 34 2c 19

 

format

24 uu 1d vv vv vv vv 2c ww 1d xx xx xx xx 2c yy 2c zz

uu - ship class id

vv vv vv vv - speed on map -- affects how long you have to intercept

ww - speed of escape during combat

xx -- armor

yy -- ?

zz -- ? AP

 

XGStrategyAI.DetermineAbductionSquad

Increase aliens in abduction missions (Search and Replace in this order)

 

Mission Difficulty 3 (Highest panic)

2c 04 0f 00 ec 43 00 00 2c 0a

to

2c 06 0f 00 ec 43 00 00 2c 10

(6 pods, 16-18 aliens)

 

Mission Difficulty 2

2c 04 0f 00 ec 43 00 00 2c 08

to

2c 05 0f 00 ec 43 00 00 2c 0d

(5 pods, 13-15 aliens)

 

Mission Difficulty 1

2c 03 0f 00 ec 43 00 00 2c 06

to

2c 04 0f 00 ec 43 00 00 2c 0a

(4 pods, 10-12 aliens)

 

Mission Difficulty 0 (Lowest Panic)

2c 02 0f 00 ec 43 00 00 2c 04

to

2c 03 0f 00 ec 43 00 00 2c 06

(3 pods, 6-8 aliens)

 

Byte after First 2c is Number of pods (p)

Byte after Second 2c is Number of aliens (a)

a must be <= (p * 3) - 2. Impossible difficulty adds two more aliens to all abductions.

 

Determine Abduction Award / Determine Random Abduction Reward

Cap soldier reward at sergeant and allows corporals

26 16 2c 03 2c 05

to

26 16 2c 02 2c 03

 

Slow alien progression by months

XGStrategyAI.GetPossibleAliens

March and April aliens use bit code that can't be edited cleanly

41 44 00 00 2c 02: May Aliens (Mutons)

41 44 00 00 2c 03: June Aliens (Cyberdisc, tougher Mutons)

41 44 00 00 2c 04: July Aliens (Muton Berserkers)

41 44 00 00 2c 05: August Aliens (Heavy Floaters)

41 44 00 00 2c 06: September aliens (Muton Elite?)

Else statement handles rest (Sectopod?)

 

The last byte is the month (02 through 06) in which a certain probability set for all aliens' appearances is used. For example, uf you changed the 06 to 07, that set won't be used until October, delaying certain aliens from showing up.

 

XGStrategyAI.BuildObjectives

Allow abduction to go forward even if preceding large scout in destroyed

24 05 27 16

to

24 05 28 16

 

Send Supply Barge to Precede Terror Missions instead of battleship\

24 06 2c 09 24 08

to

24 06 2c 09 24 07

Edited by johnnylump
Link to comment
Share on other sites

  • 3 weeks later...

To be able to enter situation room at game start

XComStrategyGame.XGFacility_SituationRoom.InitNewGame

1b c4 23 00 00 00 00 00 00 27 16 04 0b 53
to
1b c4 23 00 00 00 00 00 00 28 16 04 0b 53

 

Nerf research credits from alien capture

XGTechTree.BuildResearchCredits

24 01 2c 32 25 16 (Sectoid/Laser) - unchanged
24 02 2c 32 26 16 to 24 02 2c 19 26 16 (Muton/Plasma) 
24 03 2c 19 2c 02 to 24 03 2c 14 2c 02 (Muton Elite/All Weapons)
24 04 2c 32 2c 03 (Floater / Basic Armor) - unchanged
24 05 2c 32 2c 04 to 24 05 2c 19 2c 04 (Berseker / All Armor)
24 06 2c 32 2c 05 to 24 06 2c 19 2c 05 (Thin Man / UFO Tech)
24 07 2c 32 2c 06 to 24 07 2c 19 2c 06 (Heavy Floater / Flight)
24 08 2c 32 2c 07 to 24 08 2c 19 2c 07 (Sectoid Commander Psionics)
24 09 2c 32 2c 08 to 24 09 2c 14 2c 08 (Ethereal / All tech)

 

Correct bug in vanilla preventing more outsiders from appearing at greater difficulties

XGStrategyAI.GetNumOutsiderse

2c 00 99 19
to
2c 00 98 19

 

Set abductors, supply ships and battleships to have 3 outsiders when landed

XGStrategyAI.DetermineAbductorSquad

XGStrategyAI.DetermineSupplySquad

XGStrategyAI.DetermineBattleshipSquad

24 01 24 12 2c 02
to
24 01 24 12 2c 03

 

Add one more group of aliens to abductors that are shot down; two more if it is landed; also set command crew to three outsiders

XGStrategyAI.DetermineAbductorSquad


1c 44 00 00 ab 1f 00 00 00 00 00 00 16 44 00 00 
00 00 00 00 00 00 00 00 1c 44 00 00 00 00 00 00 
ce 0a 00 00 47 49 01 00 7d 01 00 00 1d 01 00 00 
55 00 19 44 00 00 03 00 24 02 16 55 00 19 44 00 
00 03 00 24 00 16 55 00 19 44 00 00 03 00 24 00 
16 07 49 00 2d 00 1c 44 00 00 55 00 19 44 00 00 
03 00 24 00 16 0f 00 18 44 00 00 90 36 00 19 44 
00 00 2c 03 16 1b 24 22 00 00 00 00 00 00 00 18 
44 00 00 00 19 44 00 00 16 07 0d 01 9a 38 3a 1b 
b9 0e 00 00 00 00 00 00 16 38 3a 24 12 16 07 d2 
00 2d 00 1c 44 00 00 55 35 e4 ff ff ff 84 fa ff 
ff 00 00 00 1a 44 00 00 11 00 1b 82 04 00 00 00 
00 00 00 24 01 24 12 2c 02 16 16 06 0a 01 55 35 
e4 ff ff ff 84 fa ff ff 00 00 00 1a 44 00 00 19 
00 1b 82 04 00 00 00 00 00 00 24 01 24 12 1b d4 
0f 00 00 00 00 00 00 16 16 16 06 2f 01 a1 00 18
44 00 00 92 2c 02 a7 2c 02 16 16 16 55 00 19 44 
00 00 03 00 24 01 16 1b 09 08 00 00 00 00 00 00 
00 19 44 00 00 00 18 44 00 00 00 1a 44 00 00 4a 
16 1b 3e 06 00 00 00 00 00 00 00 1a 44 00 00 16 
04 00 1a 44 00 00 04 3a 1b 44 00 00 53 00 00 00 
02 00 82 00 c3 07 00 00 00 00 00 00

to

1c 44 00 00 ab 1f 00 00 00 00 00 00 16 44 00 00 
00 00 00 00 00 00 00 00 1c 44 00 00 00 00 00 00 
ce 0a 00 00 47 49 01 00 75 01 00 00 1d 01 00 00 
55 00 19 44 00 00 03 00 24 02 16 55 00 19 44 00 
00 03 00 24 00 16 55 00 19 44 00 00 03 00 24 00 
16 55 00 19 44 00 00 03 00 24 00 16 0b 0b 0b 0b 
0b 0b 0b 0b 0b 0b 0b 07 89 00 2d 00 1c 44 00 00 
55 00 19 44 00 00 03 00 24 02 16 55 00 19 44 00 
00 03 00 24 00 16 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 
0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0f 00 18 
44 00 00 90 36 00 19 44 00 00 2c 03 16 1b 24 22 
00 00 00 00 00 00 00 18 44 00 00 00 19 44 00 00 
16 07 05 01 9a 38 3a 1b b9 0e 00 00 00 00 00 00 
16 38 3a 24 12 16 55 35 e4 ff ff ff 84 fa ff ff 
00 00 00 1a 44 00 00 11 00 1b 82 04 00 00 00 00 
00 00 24 01 24 12 2c 03 16 16 06 27 01 a1 00 18 
44 00 00 92 2c 02 a7 2c 02 16 16 16 55 00 19 44 
00 00 03 00 24 01 16 1b 09 08 00 00 00 00 00 00 
00 19 44 00 00 00 18 44 00 00 00 1a 44 00 00 4a 
16 1b 3e 06 00 00 00 00 00 00 00 1a 44 00 00 16 
04 00 1a 44 00 00 04 3a 1b 44 00 00 53 00 00 00 
02 00 82 00 c3 07 00 00 00 00 00 00

 

Nerf arc throwers

Reduce Arc Thrower Charge to 1

XGUnit.UpdateItemCharges

24 50 16 2c 02 16 16 04 0b 53
to
24 50 16 2c 01 16 16 04 0b 53

 

Set interceptor maintenance to 1/4 base interceptor cost (instead of default 1/2)

XGFacility_Hangar.GetCraftMaintenanceCost

2c 69 4a 16 16 2c 02 16
to
2c 69 4a 16 16 2c 04 16

 

Set hit point threshold for UFOs to be destroyed instead of shot down to -600

XGInterceptionEngagement.UpdateEngagementResult

ea 33 00 00 24 01 06 e0 01 07
to
ea 33 00 00 24 02 06 e0 01 07

1d f6 ff ff ff 16
to
1d a8 fd ff ff 16

 

Rewrite of XComStrategyGame.XGWorld.AddInitialPanic

* Either my memory is wrong, or it appears that some change in vanilla now prevents initial panic in any country from exceeding two total panic blocks, no matter what you set in the starting panic variables in DFC.ini. Too easy, in my view, especially as the mod has disabled a number of cheap ways for the aliens to add panic.

 

This is a substitution for the entire function (2f 47 00 00 ab 1f is unchanged, so you can search for it with that). It makes initial panic on easy always 0 (I needed the bytes). For all other difficulties, it reads the matching starting panic variable from DFC.ini and will add a random (0-3) amount of panic to a number of countries equal to that variable (hereafter x), so you'll get countries with a range of 1 to 4 panic blocks from the get-go.

 

If you don't like countries starting with 4 panic, the important code is a7 24 04, toward the end. Changing the 04 to 03 will start x countries with 1 to 3 panic blocks. (Alternately, you can code something like 1 + random (2), which will give x countries 2 or 3 panic blocks, but you'll need to include some additional coding).

 

2f 47 00 00 ab 1f 00 00 00 00 00 00 2a 47 00 00 00 00 00 00 00 00 00 00 2f 47 00 00 00 00 00 00 b7 01 00 00 dc 3d 00 00 cd 01 00 00 49 01 00 00 05 43 41 00 00 00 19 1b 4c 0e 00 00 00 00 00 00 16 0a 00 43 41 00 00 00 1b f6 0e 00 00 00 00 00 00 16 0a 3c 00 25 0f 00 2e 47 00 00 25 06 ce 00 0a 6b 00 26 0f 00 2e 47 00 00 12 20 6d fe ff ff 09 00 b7 fb ff ff 00 02 b7 fb ff ff 06 ce 00 0a 9b 00 2c 02 0f 00 2e 47 00 00 12 20 6d fe ff ff 09 00 b8 fb ff ff 00 02 b8 fb ff ff 06 ce 00 0a cb 00 2c 03 0f 00 2e 47 00 00 12 20 6d fe ff ff 09 00 ba fb ff ff 00 02 ba fb ff ff 06 ce 00 0a ff ff 58 01 ef 46 00 00 00 2c 47 00 00 00 4a 1e 01 07 1d 01 19 00 2c 47 00 00 0a 00 47 24 00 00 00 1b 40 14 00 00 00 00 00 00 16 55 00 2d 47 00 00 0a 00 00 2c 47 00 00 16 31 30 0f 00 2f 47 00 00 25 07 ca 01 96 00 2f 47 00 00 00 2e 47 00 00 16 07 54 01 9a 36 00 2d 47 00 00 25 16 06 ca 01 0f 00 2c 47 00 00 10 a7 36 00 2d 47 00 00 16 00 2d 47 00 00 19 00 2c 47 00 00 0c 00 00 00 00 00 00 1b b3 00 00 00 00 00 00 00 a7 24 04 16 4a 16 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 0b 56 00 2d 47 00 00 0a 00 00 2c 47 00 00 16 a5 00 2f 47 00 00 16 06 2a 01 04 0b 53 00 00 00 02 00 02 00 9f 00 00 00 00 00 00 00

Edited by johnnylump
Link to comment
Share on other sites

  • 2 weeks later...

Very nice! I like situation room the most :)

 

Nerf arc throwers

XComGame.XGTacticalGameCore

 

Lower Max HP for successful stun from 3 to 2
fa 10 00 00 02 00 00 00 33
to
fa 10 00 00 02 00 00 00 32

Lower Max HP for successful stun with arc thrower foundry project from 6 to 4
fb 10 00 00 02 00 00 00 36
to
fb 10 00 00 02 00 00 00 34

Lower Base Stun chance from 70 to 40
fc 10 00 00 03 00 00 00 37
to
fc 10 00 00 03 00 00 00 34

I think these constants are in XGTacticalGameCoreNativeBase and aren't working for me. I've tried STUN_MAX_CHANCE = 99, but max chance with one HP left was 95.

const STUN_BASE_CHANCE = 70;
const STUN_I_HP_THRESHHOLD = 3;
const STUN_II_HP_THRESHHOLD = 6;	// tried 9
const STUN_MAX_CHANCE = 95;		// tried 99
const STUN_MIN_CHANCE = 1;

Link to comment
Share on other sites

Very nice! I like situation room the most :)

 

Nerf arc throwers

XComGame.XGTacticalGameCore

 

Lower Max HP for successful stun from 3 to 2
fa 10 00 00 02 00 00 00 33
to
fa 10 00 00 02 00 00 00 32

Lower Max HP for successful stun with arc thrower foundry project from 6 to 4
fb 10 00 00 02 00 00 00 36
to
fb 10 00 00 02 00 00 00 34

Lower Base Stun chance from 70 to 40
fc 10 00 00 03 00 00 00 37
to
fc 10 00 00 03 00 00 00 34

I think these constants are in XGTacticalGameCoreNativeBase and aren't working for me. I've tried STUN_MAX_CHANCE = 99, but max chance with one HP left was 95.

const STUN_BASE_CHANCE = 70;
const STUN_I_HP_THRESHHOLD = 3;
const STUN_II_HP_THRESHHOLD = 6;	// tried 9
const STUN_MAX_CHANCE = 95;		// tried 99
const STUN_MIN_CHANCE = 1;

 

You're right; posted those without testing. The settings do nothing.

 

Update: The function is called CalcStunChance, another native simulated function in XGTacticalGameCoreNativeBase, which I have no idea how to find or edit.

 

Update: I'm nerfing arc throwers for now by reducing their charges to 1 (code is above, and I actually did test it this time). Some players on Long War said with so many missions they could spam captures. I'd prefer a lowered chance to hit to make it a riskier play, and may look to modify the functions referred to in Drak's post below (thanks for outpoint!)

Edited by johnnylump
Link to comment
Share on other sites

Thanks 4 the codes guys.

OST is required to be built in any difficulties.

XComStratygyGame.XGBase.GenerateTiles

 

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();

}

то

m_arrTiles[TileIndex(3, 1)].iTileState = 1;

SetFacility(9, 2, 1);

// This is an implied JumpToken;

goto J0x4bc;

Game().GetDifficulty() <= 1;

SetFacility(12, 0, 1);

Game().m_arrFacilityUnlocks[12] = 1;

J0x4bc:

 

UpdateTiles();

}

 

 

C8230000000000002C092C02261607BC

to

C8230000000000002C092C02261606BC

Tested. Works fine.

Edited by sakhalin20000
Link to comment
Share on other sites

  • 2 weeks later...

Some Long War version 1.05 changes include some significant rescripting. Instead of copy pasting long ugly hex strings here, I'll just note I have replacement hex available for the following functions -- just PM me and I'll figure out a way to get you the hex:

XComStrategyGame.XGInterceptionEngagement.UpdateWeapons
- Randomizes air combat weapon damage over a range
- Provides +2% to hit for each interceptor kill

XComStrategyGame.XGStrategyAI.DetermineTerrorSquad
- Adds more aliens to missions taking place after a certain month

-XComStrategyGame.XGStrategyAI.DetermineAbductorSquad
- Adds more aliens to abductor missions

-XComStrategyGame.XGWorld.AddInitialPanic
- Randomizes panic between 1 and 4 blocks in a number of countries specificed in DGC.ini

 

Update: I put the hex for all four these functions in a zip file under "miscellaneous" on the mod page. They aren't commented or anything; I'll just say you'll already need to know how to work with upk files to get them implemented.

Edited by johnnylump
Link to comment
Share on other sites

  • 3 weeks later...

Some new (simple) upk changes in LW 1.06:

 

These are all in XComStrategyGame

 

 

Randomize survivors on small scouts; Instead of consistent 5 aliens, the count will be 4-9, including commander
XGStrategyAI.DetermineSmallScoutSquad
a0 00 0a 44 00 00 38 3f 2c 02 16
to
a2 00 0a 44 00 00 a7 2c 06 16 16
XGFundingCouncil.BuildRequest
Change a bunch of instances in which cash is rewarded for council "quest" item sales to rewarding scientists. (The algorithm to generate cash rewards gives too much money in my mod)
1b 6e 06 00 00 00 00 00 00 00 dc 01 00 00 24 01
to
1b 6e 06 00 00 00 00 00 00 00 dc 01 00 00 24 04

 

This will perform 37 changes.

 

Reduce alloy reward from alien base mission to 50 alloys (instead of 75)

XGStrategyAI.CreateAlienBase

 

00 2c 4b 0f 10
to
00 2c 32 0f 10

 

Make Alien Base Squad tougher
XGStrategyAI.DetermineAlienBaseSquad
2 muton packs of 3 instead of 2 drone packs of 2
24 00 24 11 2c 02
to
24 00 24 07 2c 03

3 sectoid commanders instead of 1
24 01 24 09 26
to
26 24 09 24 03
***
Swap interceptor consumables
Sectoids = Boost
Floaters = Aim
Cyberdisks = Dodge
XGItemTree.BuildItems
XGFacility_Engineering.GetItemProjectCost
Require Floater Autopsy (Tech 44, Body 146) for Hit Consumable (135) instead of Sectoid
2c 05 24 2b 4a 4a 2c 2f
to
2c 05 24 2c 4a 4a 2c 2f
9a 38 3a 00 28 2a 00 00 38 3a 24 85
to
9a 38 3a 00 28 2a 00 00 38 3a 24 ff (this is a temporary setting to handle swaps)
Require Cyberdisk Autopsy (Tech 49, Body 152) for Dodge Consumable (133) instead of Floater
2c 05 24 2c 4a 4a 2c 14
to
2c 05 24 31 4a 4a 2c 14
9a 38 3a 00 28 2a 00 00 38 3a 24 86
to
9a 38 3a 00 28 2a 00 00 38 3a 24 85
Require Sectoid (Tech 43, Body 144) for Boost Consumable (134) instead of Cyberdisk
2c 0a 24 31 4a 4a 2c 3a
to
2c 0a 24 2b 4a 4a 2c 3a
9a 38 3a 00 28 2a 00 00 38 3a 24 87
to
9a 38 3a 00 28 2a 00 00 38 3a 24 86
Finish floater corpse requirements swap
9a 38 3a 00 28 2a 00 00 38 3a 24 ff
to
9a 38 3a 00 28 2a 00 00 38 3a 24 87
****
XComGame >> XGTacticalGameCore >> TryStunned()
Reduce arc thrower to-hit chance by roughly half, so a 95 percent chance becomes a 50 percent chance
e2 82 00 00 16 1e 00 00 c8 42 16
to
e2 82 00 00 16 1e 00 00 3e 43 16
The to-hit chance does not appear correctly on the screen, however, and I cannot find a way to update it. Instead, I prevent the arc thrower to-hit from appearing on screen at all with the following change:
XComGame >> XGAbility_Targeted >> GetShotSummary()
00 24 09 16 16 16 18 1d
to
00 24 24 16 16 16 18 1d

 

Randomize Explosives Damage
XcomGame >> XGTacticalGameCore >> CalcOverallDamage
07 9F 00 1B 8C 71 00 00 00 00 00 00 00 F3 76 00 00 2C 09 16 04 00 EE 76 00 00
to
07 9F 00 9A 00 F3 76 00 00 2C 08 16 04 00 EE 76 00 00 0B 0B 0B 0B 0B 0B 0B 0B
Edited by johnnylump
Link to comment
Share on other sites

  • 4 weeks later...

To increase numbers of aliens in large scout in XGStrategyAI.DetermineLargeScoutSquad :

 

Instead of :

 

0f 00 11 44 00 00 2c 0a

 

Change to :

 

0f 00 11 44 00 00 2c 14

 

So that, instead of 10 Aliens, you will have 20.

 

Hope its help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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