Six interceptors mod - XCOM:EU 2012

From Nexus Mods Wiki
Jump to: navigation, search
'Screenshot of Launch Window with Six Interceptors'

Overview

This mod allows the player to create and launch up to six interceptors per continent. The officially released version of the game limits this number to four.

Game Version Compatibility

This mod is compatible with Patch 4 ( Changelist: 356266 ).

Known Issues

  1. Launch window with a single interceptor will be displayed slightly below screen center (vertically), while any other number is vertically centered.
  2. In order to fit six interceptors into the launch window, the sprites were moved closer together. Mouse-over of a launch sprite causes the window to "expand", overlapping the surrounding windows slightly.
  3. The incorrect number of interceptor icons is displayed on the Situation Room map if 5 or more interceptors are in a hangar.

Programs and Tools

UE Explorer, JPEXS Flash Decompiler, and HxD Hex Editor were used in the creation and installation of this mod.

See Modding Tools - XCOM:EU 2012 for links.

'Ship list interface with six interceptors'

Details

This mod expands the Hangers/Shiplist UI to allow up to six interceptors to be stored at each continent. This includes hiring, building, and transferring interceptors. This change was primarily accomplished though the editing of the XComStrategyGame.upk.

It also modifies the UFO Alert / Launch Ship UI to allow the display of up to six interceptors to launch against a UFO. This change was primarily accomplished by editing the Actionscript files embedded into Command1.upk. See Flash SWF Editing for general guidance on how this was accomplished.

UPK File Changes

The number maximum number of interceptors was implicitly defined by hard-coded loop limits and conditional checks in twelve distinct locations in the XComStrategyGame.upk file. Each of these changes is only 1 byte (changing an 04 value to 06). Additional hex code surrounding the change has been included in order to uniquely identify the location.

No particular installation order is required for these hex changes.

XGFacility_Hangar changes

	XGFacility_Hanger.GetAvailableBay
	2b 00 00 2c 04 16 07 (Offset !2933720)
	to
	2b 00 00 2c 06 16 07
	 
	XGFacility_Hangar.GetFreeHangerSpots
	04 93 2c 04 35 (Offset !2943678)
	to
	04 93 2c 06 35
 
	XGFacility_Hangar.GetTotalInterceptorCapacity
	2c 04 04 90 2c 04 (Offset !2943880)
	to
	2c 06 04 90 2c 06

XGOutpost change

	XGOutPost.GetFreeHangerSpots
	04 2c 04 04 3a (Offset !3527278)
	to
	04 2c 06 04 3a

XGHangarUI change

	XGHangarUI.OnChooseCraft
	2c 04 16 18 15 (Offset !3163337)
	to
	2c 06 16 18 15

UIShiplist changes

	UIShipList.UpdateData
	38 53 2c 04 16 1F 29 00 (Offset !2237827)
	to
	38 53 2c 06 16 1F 29 00
	
	2c 04 16 07 84 0a (Offset !2239414)
	to
	2c 06 16 07 84 0a

	UIShipList.HangarSlotAvailable
	01 D0 31 00 00 2C 04 16 04 (Offset !2242946)
	to
	01 D0 31 00 00 2C 06 16 04

	UIShipList.OnTransferInterceptor
	01 D0 31 00 00 2C 04 16 16 14 2D (Offset !2244993)
	to
	01 D0 31 00 00 2C 06 16 16 14 2D 

	UIShipList.AlterSelection
	2C 04 16 0F 01 A5 11 (Offset !2234536)
	to
	2C 06 16 0F 01 A5 11

	A8 11 00 00 2C 04 16 18 49 (Offset !2234756)
	to
	A8 11 00 00 2C 06 16 18 49

	UIShipList.OnMouseEvent
	DF 11 00 00 2C 04 16 18 28 00 9A 01 (Offset !2236015)
	to
	DF 11 00 00 2C 06 16 18 28 00 9A 01

Development Notes for UPK changes

Actionscript File Changes

The Actionscript code changes are related to enabling more than six interceptors to show in the "Launch" windows that appears to allow selection of an interceptor with which to engage a UFO in the Geoscape.

UI Development Notes

RadarContactAlert changes

There are three changes to the script in Package::RadarContactAlert. These changes allow for the automatic centering of the multi-ship selection sprite, which changes height depending up on the number of available ships.

Change MAX_NUM_INTERCEPTORS constant from 4 to 6

body: 
96 09 00 04 01 08 0f 07 04 00 00 00 (Offset: !45631942)
to
96 09 00 04 01 08 0f 07 06 00 00 00

Change SHIP_HEIGHT_OFFSET constant from 40 to 48

body:
96 09 00 04 01 08 1a 07 28 00 00 00 (Offset: !45631981)
to
96 09 00 04 01 08 1a 07 30 00 00 00 

Change offset calculation code in ActivateShipList

from:
      this.shipListMC._y=RadarContactAlert.MAX_NUM_INTERCEPTORS/this.numInterceptors*this.shipListDefaultHeight/RadarContactAlert.MAX_NUM_INTERCEPTORS-RadarContactAlert.SHIP_HEIGHT_OFFSET*0.5;
to:
      this.shipListMC._y=(1.0-this.numInterceptors/RadarContactAlert.MAX_NUM_INTERCEPTORS)*this.shipListDefaultHeight*0.5+RadarContactAlert.SHIP_HEIGHT_OFFSET;

Command1.upk >> RadarContactAlert.ActivateShipList
original:
(Offset: !45629096)
96 04 00 04 01 08 08 4e 96 04 00 08 0b 08 01 1c 96 02 00 08 0f 4e 96 04 00 04 01 08 16 4e 0d 96 04 00 04 01 08 0c 4e 96 02 00 08 01 1c 96 02 00 08 0f 4e 0d 0c 96 02 00 08 01 1c 96 02 00 08 1a 4e 96 09 00 06 00 00 e0 3f 00 00 00 00 0c 0b 4f
new: 96 04 00 04 01 08 08 4e 96 0b 00 08 0b 06 00 00 f0 3f 00 00 00 00 96 04 00 04 01 08 16 4e 96 02 00 08 01 1c 96 02 00 08 0f 4e 0d 0b 96 04 00 04 01 08 0c 4e 0c 96 09 00 06 00 00 e0 3f 00 00 00 00 0c 96 02 00 08 01 1c 96 02 00 08 1a 4e 0a 4f

Sprite changes

This changes the definition of the sprite itself, by adding two additional "sub-sprites" to the original sprite (which contained four). To free up enough space to add the required hex code, some default text strings in nearby sections of the code were shortened.

Due to the complexity of this change, it will be described on its own dedicated page:

Actionscript Sprite Changes

Localization Changes

None required.

ToolBoks Custom Mod

The following text can be used to create a Custom Mod file to install the change with ToolBoks. Version 1.21 or greater is required.

MOD_NAME=Six interceptors mod
AUTHOR=amineri
DESCRIPTION=This mod allows the player to create and launch up to six interceptors per continent.

This mod requires ToolBoks v1.21 or greater to install.

Version: 1.0

Compatible with XCOM Enemy Unknown versions:
 - Patch 4 ( Changelist: 356266 )

UPK_FILE=XComStrategyGame.upk
OFFSET=2933720
[MODDED_HEX]
2b 00 00 2c 06 16 07

UPK_FILE=XComStrategyGame.upk
OFFSET=2943678
[MODDED_HEX]
04 93 2c 06 35

UPK_FILE=XComStrategyGame.upk
OFFSET=2943880
[MODDED_HEX]
2c 06 04 90 2c 06

UPK_FILE=XComStrategyGame.upk
OFFSET=3527278
[MODDED_HEX]
04 2c 06 04 3a

UPK_FILE=XComStrategyGame.upk
OFFSET=3163337
[MODDED_HEX]
2c 06 16 18 15


UPK_FILE=XComStrategyGame.upk
OFFSET=2237827
[MODDED_HEX]
38 53 2c 06 16 1F 29 00

UPK_FILE=XComStrategyGame.upk
OFFSET=2239414
[MODDED_HEX]
2c 06 16 07 84 0a

UPK_FILE=XComStrategyGame.upk
OFFSET=2242946
[MODDED_HEX]
01 D0 31 00 00 2C 06 16 04

UPK_FILE=XComStrategyGame.upk
OFFSET=2244993
[MODDED_HEX]
01 D0 31 00 00 2C 06 16 16 14 2D

UPK_FILE=XComStrategyGame.upk
OFFSET=2234536
[MODDED_HEX]
2C 06 16 0F 01 A5 11

UPK_FILE=XComStrategyGame.upk
OFFSET=2234756
[MODDED_HEX]
A8 11 00 00 2C 06 16 18 49

UPK_FILE=XComStrategyGame.upk
OFFSET=2236015
[MODDED_HEX]
DF 11 00 00 2C 06 16 18 28 00 9A 01

UPK_FILE=Command1.upk
OFFSET=45631942
[MODDED_HEX]
96 09 00 04 01 08 0f 07 06 00 00 00

UPK_FILE=Command1.upk
OFFSET=45631981
[MODDED_HEX]
96 09 00 04 01 08 1a 07 30 00 00 00

UPK_FILE=Command1.upk
OFFSET=45629096
[MODDED_HEX]
96 04 00 04 01 08 08 4e 96 0b 00 08 0b 06 00 00 f0 3f 00 00 00 00 96 04 00 04 01 08 16 4e 96 02 00 08 01 1c 96 02 00 08 0f 4e 0d 0b 96 04 00 04 01 08 0c 4e 0c 96 09 00 06 00 00 e0 3f 00 00 00 00 0c 96 02 00 08 01 1c 96 02 00 08 1a 4e 0a 4f

UPK_FILE=Command1.upk
OFFSET=45254606
[MODDED_HEX]
FF 14 29 00 00 00 DA 00 75 62 FE 8A 14 42 51 D8 75 64 9E 83 94 5C 51 70 01 00 01 14 00 A0 02 00 03 FF D1 38 FF 01 25 D5 92 14 5D F0 47 8C 00 7F 09 92 00 00 00 DB 00 77 FB 0C C2 FF B0 23 F0 ED 33 1F 00 90 01 FF D1 38 FF 00 00 00 00 00 00 00 28 00 00 3C 70 20 61 6C 69 67 6E 3D 22 6C 65 66 74 22 3E 3C 66 6F 6E 74 20 66 61 63 65 3D 22 24 54 69 74 6C 65 46 6F 6E 74 22 20 73 69 7A 65 3D 22 32 30 22 20 63 6F 6C 6F 72 3D 22 23 66 66 64 31 33 38 22 20 6C 65 74 74 65 72 53 70 61 63 69 6E 67 3D 22 30 2E 30 22 20 6B 65 72 6E 69 6E 67 3D 22 30 22 3E 4C 41 55 4E 43 48 3C 2F 66 6F 6E 74 3E 3C 2F 70 3E 00 BF 12 0C 00 00 00 DB 00 48 00 00 00 00 00 00 00 00 00 FF 14 27 00 00 00 DC 00 75 62 5E 87 0B 94 2E 60 75 62 7E 86 8B 96 2E 58 01 00 01 02 00 00 00 80 80 80 FF 01 25 D5 89 8B 97 F0 47 E8 00 7F 09 2E 00 00 00 DD 00 77 FB 0B F0 FF B0 15 50 ED 31 1F 00 90 01 80 80 80 FF 00 00 00 00 00 00 00 28 00 00 49 4E 54 45 52 43 45 50 54 4F 52 20 30 33 35 00 BF 12 0C 00 00 00 DD 00 48 00 00 00 00 00 00 00 00 00 7F 09 2A 00 00 00 DE 00 77 FB 0B ED 7F B0 12 28 ED 31 4B 00 90 01 80 80 80 FF 00 00 00 00 00 00 00 28 00 00 57 65 61 70 6F 6E 20 4E 61 6D 65 00 BF 12 0C 00 00 00 DE 00 48 00 00 00 00 00 00 00 00 00 7F 09 9D 00 00 00 DF 00 77 FB 0B ED 7F B0 12 28 ED 33 4B 00 90 01 80 80 80 FF 00 00 00 00 00 00 00 28 00 00 3C 70 20 61 6C 69 67 6E 3D 22 6C 65 66 74 22 3E 3C 66 6F 6E 74 20 66 61 63 65 3D 22 24 4E 6F 72 6D 61 6C 46 6F 6E 74 22 20 73 69 7A 65 3D 22 32 30 22 20 63 6F 6C 6F 72 3D 22 23 38 30 38 30 38 30 22 20 6C 65 74 74 65 72 53 70 61 63 69 6E 67 3D 22 30 2E 30 30 30 30 30 30 22 20 6B 65 72 6E 69 6E 67 3D 22 30 22 3E 53 68 69 70 20 53 74 61 74 75 73 3C 2F 66 6F 6E 74 3E 3C 2F 70 3E 00 BF 12 0C 00 00 00 DF 00 48 00 00 00 00 00 00 00 00 00 7F 09 92 00 00 00 E0 00 77 FB 0C C2 FF B0 23 F0 ED 33 1F 00 90 01 FF D1 38 FF 00 00 00 00 00 00 00 28 00 00 3C 70 20 61 6C 69 67 6E 3D 22 6C 65 66 74 22 3E 3C 66 6F 6E 74 20 66 61 63 65 3D 22 24 54 69 74 6C 65 46 6F 6E 74 22 20 73 69 7A 65 3D 22 32 30 22 20 63 6F 6C 6F 72 3D 22 23 66 66 64 31 33 38 22 20 6C 65 74 74 65 72 53 70 61 63 69 6E 67 3D 22 30 2E 30 22 20 6B 65 72 6E 69 6E 67 3D 22 30 22 3E 4C 41 55 4E 43 48 3C 2F 66 6F 6E 74 3E 3C 2F 70 3E 00 BF 12 0C 00 00 00 E0 00 48 00 00 00 00 00 00 00 00 00 FF 09 E3 02 00 00 E1 00 35 00 FF 0A 07 00 00 00 6E 6F 72 6D 61 6C 00 86 06 06 03 00 C6 00 00 86 06 06 04 00 C7 00 00 BF 06 0F 00 00 00 26 05 00 C8 00 1D 57 D8 67 80 6E 61 6D 65 00 BF 06 11 00 00 00 26 06 00 C9 00 1D 57 B8 C9 00 77 65 61 70 6F 6E 00 BF 06 11 00 00 00 26 07 00 CA 00 1D 57 B9 03 00 73 74 61 74 75 73 00 BF 06 18 00 00 00 26 08 00 CD 00 C5 5A 3E AD 1F 3A 53 10 E6 40 73 68 69 70 49 63 6F 6E 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 3F 03 02 00 00 00 07 00 40 00 02 07 05 00 02 07 06 00 02 07 07 00 FF 0A 09 00 00 00 64 69 73 61 62 6C 65 64 00 85 06 03 04 00 CE 00 BF 06 11 00 00 00 36 05 00 CF 00 1D 57 D8 67 80 0E 00 6E 61 6D 65 00 BF 06 13 00 00 00 36 06 00 D0 00 1D 57 B8 C9 00 0E 00 77 65 61 70 6F 6E 00 BF 06 13 00 00 00 36 07 00 D1 00 1D 57 B9 03 00 0E 00 73 74 61 74 75 73 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 3F 03 02 00 00 00 07 00 40 00 02 07 05 00 02 07 06 00 02 07 07 00 02 07 08 00 FF 0A 09 00 00 00 73 65 6C 65 63 74 65 64 00 85 06 03 03 00 D2 00 85 06 03 04 00 D3 00 BF 06 11 00 00 00 36 05 00 D4 00 1D 57 D8 67 80 1A 00 6E 61 6D 65 00 BF 06 13 00 00 00 36 06 00 D5 00 1D 57 B8 C9 00 1A 00 77 65 61 70 6F 6E 00 BF 06 13 00 00 00 36 07 00 D6 00 1D 57 B9 03 00 1A 00 73 74 61 74 75 73 00 BF 06 1A 00 00 00 36 08 00 D9 00 C5 5A 3E AD 1F 3A 53 10 E6 40 1A 00 73 68 69 70 49 63 6F 6E 00 86 06 06 0A 00 DA 00 00 BF 06 13 00 00 00 36 0B 00 DB 00 1D 68 59 4F C0 1A 00 6C 61 75 6E 63 68 00 BF 06 18 00 00 00 36 0C 00 3C 00 1D 5F 89 6B 80 1A 00 62 74 6E 48 65 6C 70 49 63 6F 6E 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 3F 03 02 00 00 00 07 00 40 00 02 07 05 00 02 07 06 00 02 07 07 00 02 07 0A 00 02 07 0B 00 FF 0A 12 00 00 00 73 65 6C 65 63 74 65 64 5F 64 69 73 61 62 6C 65 64 00 85 06 03 04 00 DC 00 BF 06 11 00 00 00 36 05 00 DD 00 1D 57 D8 67 80 26 00 6E 61 6D 65 00 BF 06 13 00 00 00 36 06 00 DE 00 1D 57 B8 C9 00 26 00 77 65 61 70 6F 6E 00 BF 06 13 00 00 00 36 07 00 DF 00 1D 57 B9 03 00 26 00 73 74 61 74 75 73 00 BF 06 13 00 00 00 36 0A 00 E0 00 1D 68 59 4F C0 26 00 6C 61 75 6E 63 68 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 40 00 3F 03 02 00 00 00 07 00 40 00 00 00 FF 09 8C 00 00 00 E2 00 01 00 BF 06 10 00 00 00 26 42 00 E1 00 1C DC 0F 71 80 73 68 69 70 30 00 BF 06 10 00 00 00 26 35 00 E1 00 1C DC 08 8D E0 73 68 69 70 31 00 BF 06 10 00 00 00 26 28 00 E1 00 1C DC 09 AA 40 73 68 69 70 32 00 BF 06 10 00 00 00 26 1B 00 E1 00 1C DC 0A C6 A0 73 68 69 70 33 00 BF 06 10 00 00 00 26 0E 00 E1 00 1C DC 0B E3 00 73 68 69 70 34 00 BF 06 10 00 00 00 26 01 00 E1 00 1E 6E 05 3F D8 73 68 69 70 35 00 40 00 00 00



References

Referred to by this article:

That refer to this article: