Jump to: navigation, search

Hooks

Hooks are means of inserting code right into the XWINGALLIANCE.EXE, introduced by JeremyaFr. They enhance, add features to, or fix problems with the game.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11772

This article is incomplete, I'll let Jeremy do the explaining :D

Installation

If you have installed XWAUCP or DSUCP, you already have the hooks installed.

To obtain the most recent hooks, the easy way is to use XwaHooksSetup. Usage:

  1. Run XwaHooksSetup.exe.
  2. It will create a directory named "Hooks" and download the hooks from GitHub into this directory. To redownload the hooks, delete the directory "Hooks".
  3. It will extract the hooks into a directory named "Setup".
  4. Copy the content of the "Setup" directory in your XWA install directory.

See http://www.xwaupgrade.com/phpBB3/viewtopic.php?p=154911#p154911

xwa_hook_main

This is the main dll hook (dinput.dll) that is used to call other hooks.

Each hook is implemented in a separate dll. The name of the dll must begin with "hook_" or "Hook_".

You can find samples at https://github.com/JeremyAnsel/xwa_hooks/tree/master/Samples

xwa_hook_main_no_dinput

If you use a custom Dinput.dll, it will conflict with this hook. In this case, use xwa_hook_main_no_dinput instead of xwa_hook_main.

xwa_hook_32bpp

This hook enables 32-bit mode.

8-bit OPTs are converted to 32 bits and the game can load 32-bit OPTs. The game can load 32-bit DAT images. Existing DAT images are converted to 32 bits.

See https://www.xwaupgrade.com/phpBB3/viewtopic.php?f=33&t=12257


xwa_hook_backdrops

This hook adds starfield backdrops to skirmish mission and permits to replace .dat files for a given mission.

Suppose that the mission is "[MissionDir]\[Mission].tie".

To replace dat images, create a file named "[MissionDir]\[Mission]_Resdata.txt" or create a section named "[Resdata]" in "[MissionDir]\[Mission].ini" and list your new dat files.

The format of this file is the same as "Resdata.txt".

xwa_hook_countermeasures

This hook fixes countermeasures count when reloading.

xwa_hook_d3dinfos_textures

This hook increases the D3DTextures count limit. When there are more than 1624 textures, the game outputs "Not enough D3DTextures" and uses the last created texture. This hook fixes that.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=10&t=11274

The original D3DInfos count is 1624. By default, the dll will use a value of 10000. You can modify this value in hook_d3dinfos_textures.cfg (Size = value).

xwa_hook_engine_sound

This hook enables setting engine sound and weapon sound behavior for any craft.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11746

mission sounds

Suppose that the mission is "[MissionDir]\[Mission].tie".

To replace sounds for a given mission, create a file named "[MissionDir]\[Mission]_Sounds.txt" or create a section named "[Sounds]" in "[MissionDir]\[Mission].ini".

If a "Sounds.txt" file doesn't exist, no sound is replaced. The format is a line per sound: "Wave\SoundA.wav = Wave\NewSoundA.wav" See "Sounds.txt".

craft and weapon sounds

Suppose that the craft is "FlightModels\[Model].opt".

To define which sound is played, create a file named "FlightModels\[Model]Sound.txt" or create a section named "[Sound]" in "FlightModels\[Model].ini". The format is:

EngineSoundInterior = interior sound type

EngineSoundFlyBy = flyby sound type

WeaponSoundBehavior = behavior value

Use a value of 0 to not select a sound. For engine sounds, it means that no sound is played. For weapon sounds, it means that a default sound is played (based on weapon type).

Add a line whith "EngineSoundInterior = value". The value is between 0 and 7:

  • 0 means no sound
  • 1 means EngineIntXW
  • 2 means EngineIntYW
  • 3 means EngineIntAW
  • 4 means EngineIntTI
  • 5 means EngineIntAG
  • 6 means EngineIntCort
  • 7 means EngineIntFalc

Add a line with "EngineSoundFlyBy = value". The value is between 0 and 8, 11 and 18, 21 and 28:

  • 0 means no sound
  • 1 means FlyByXW or FlyByXW3D
  • 2 means FlyByYW or FlyByYW3D
  • 3 means FlyByAW or FlyByAW3D
  • 4 means FlyByTI or FlyByTI3D
  • 5 means FlyByAG or FlyByAG3D
  • 6 means FlyByCort or FlyByCort3D
  • 7 means FlyByCort or FlyByCort3D
  • 8 means custom (first unused/FlyBySlave) or custom3D (second unused/FlyBySlave3D)
  • 11 means FlyByXW
  • 12 means FlyByYW
  • 13 means FlyByAW
  • 14 means FlyByTI
  • 15 means FlyByAG
  • 16 means FlyByCort
  • 17 means FlyByCort
  • 18 means custom (first unused/FlyBySlave)
  • 21 means FlyByXW3D
  • 22 means FlyByYW3D
  • 23 means FlyByAW3D
  • 24 means FlyByTI3D
  • 25 means FlyByAG3D
  • 26 means FlyByCort3D
  • 27 means FlyByCort3D
  • 28 means custom3D (second unused/FlyBySlave3D)

Add a line with "WeaponSoundBehavior = value". The value is 0, CorellianTransport, TieFighter, Rebel, RebelTurbo, Empire, EmpireTurbo, Falcon, FalconTurbo, Ion or IonTurbo.

  • 0 means that a default sound is played.
  • CorellianTransport means that Laser and LaserTurbo are replaced with FalconLaser or FalconLaserTurbo.
  • TieFighter means that the open weapon (307) sound is EmpireLaserChChChhh or that laser sounds (RebelLaser, RebelLaserTurbo, EmpireLaser, EmpireLaserTurbo, IonCannon, IonCannonTurbo) are replaced with EmpireLaserChChChhh.
  • Rebel means that the open weapon (307) sound is RebelLaser or that RebelLaser and
  • RebelLaserTurbo are replaced with RebelLaser.
  • RebelTurbo means that the open weapon (307) sound is RebelLaserTurbo or that
  • RebelLaser and RebelLaserTurbo are replaced with RebelLaserTurbo.
  • Empire means that the open weapon (307) sound is EmpireLaser or that EmpireLaser and EmpireLaserTurbo are replaced with EmpireLaser.
  • EmpireTurbo means that the open weapon (307) sound is EmpireLaserTurbo or that EmpireLaser and EmpireLaserTurbo are replaced with EmpireLaserTurbo.
  • Falcon means that the open weapon (307) sound is FalconLaser or that RebelLaser, RebelLaserTurbo, EmpireLaser and EmpireLaserTurbo are replaced with FalconLaser.
  • FalconTurbo means that the open weapon (307) sound is FalconLaserTurbo or that RebelLaser, RebelLaserTurbo, EmpireLaser and EmpireLaserTurbo are replaced with FalconLaserTurbo.
  • Ion means that the open weapon (307) sound is IonCannon or that IonCannon and IonCannonTurbo are replaced with IonCannon.
  • IonTurbo means that the open weapon (307) sound is IonCannonTurbo or that IonCannon and IonCannonTurbo are replaced with IonCannonTurbo.

If the file does not exist, default values are used:

Interior sound:

  • type 1:
    • ModelIndex_001_0_0_Xwing
    • ModelIndex_004_0_3_Bwing
    • ModelIndex_014_0_13_Z_95
    • ModelIndex_015_0_14_R41
    • ModelIndex_031_0_30_SlaveOne
  • type 2:
    • ModelIndex_002_0_1_Ywing
    • ModelIndex_011_0_10_ToscanFighter
    • ModelIndex_023_0_22_CloakshapeFighter
  • type 3:
    • ModelIndex_003_0_2_Awing
    • ModelIndex_010_0_9_IrdFighter
    • ModelIndex_013_0_12_Twing
    • ModelIndex_027_0_26_Piggyback
  • type 4:
    • ModelIndex_005_0_4_TieFighter
    • ModelIndex_006_0_5_TieInterceptor
    • ModelIndex_007_0_6_TieBomber
    • ModelIndex_008_0_7_TieAdvanced
    • ModelIndex_009_0_8_TieDefender
  • type 5:
    • ModelIndex_012_0_11_MissileBoat
    • ModelIndex_016_0_15_AssaultGunboat
    • ModelIndex_024_0_23_RazorFighter
    • ModelIndex_025_0_24_PlanetaryFighter
    • ModelIndex_029_0_28_PreybirdFighter
  • type 6:
    • ModelIndex_017_0_16_SkiprayBlastBoat
    • ModelIndex_058_0_45_CorellianTransport2
    • ModelIndex_065_0_52_FamilyTransport
  • type 7:
    • ModelIndex_026_0_25_SupaFighter
    • ModelIndex_032_0_31_SlaveTwo
    • ModelIndex_059_0_46_MilleniumFalcon2

FlyBy sound:

  • type 1:
    • ModelIndex_001_0_0_Xwing
    • ModelIndex_004_0_3_Bwing
    • ModelIndex_014_0_13_Z_95
    • ModelIndex_015_0_14_R41
    • ModelIndex_031_0_30_SlaveOne
  • type 2:
    • ModelIndex_002_0_1_Ywing
    • ModelIndex_011_0_10_ToscanFighter
    • ModelIndex_023_0_22_CloakshapeFighter
  • type 3:
    • ModelIndex_003_0_2_Awing
    • ModelIndex_010_0_9_IrdFighter
    • ModelIndex_013_0_12_Twing
    • ModelIndex_027_0_26_Piggyback
  • type 4:
    • ModelIndex_005_0_4_TieFighter
    • ModelIndex_006_0_5_TieInterceptor
    • ModelIndex_007_0_6_TieBomber
    • ModelIndex_008_0_7_TieAdvanced
    • ModelIndex_009_0_8_TieDefender
  • type 5:
    • ModelIndex_012_0_11_MissileBoat
    • ModelIndex_016_0_15_AssaultGunboat
    • ModelIndex_024_0_23_RazorFighter
    • ModelIndex_025_0_24_PlanetaryFighter
    • ModelIndex_029_0_28_PreybirdFighter
    • ModelIndex_043_0_32_Tug
    • ModelIndex_044_0_33_CombatUtilityVehicle
    • ModelIndex_045_0_34_HeavyLifter
    • ModelIndex_050_0_37_Shuttle
    • ModelIndex_051_0_38_EscortShuttle
    • ModelIndex_052_0_39_StormtrooperTransport
    • ModelIndex_053_0_40_AssaultTransport
    • ModelIndex_054_0_41_EscortTransport
    • ModelIndex_055_0_42_SystemPatrolCraft
    • ModelIndex_056_0_43_ScoutCraft
  • type 6:
    • ModelIndex_017_0_16_SkiprayBlastBoat
    • ModelIndex_058_0_45_CorellianTransport2
    • ModelIndex_065_0_52_FamilyTransport
  • type 7:
    • ModelIndex_026_0_25_SupaFighter
    • ModelIndex_032_0_31_SlaveTwo
    • ModelIndex_059_0_46_MilleniumFalcon2

For the tie fighters (TieFighter, TieInterceptor, TieBomber, TieAdvanced, TieDefender, TieBizarro, TieBigGun, TieWarheads, TieBomb, TieBooster), laser sounds are replaced with "EmpireLaserChChChhh.wav".

For the Corellian transports (CorellianTransport2, FamilyTransport, MilleniumFalcon2), "LaserRebel" is replaced with "FalconLaser.wav" and "LaserRebelTurbo" is replaced with "FalconLaserTurbo.wav".

See EmptySound.txt and Examples\*Sound.txt.

xwa_hook_hangars

This hook permits to customize the hangars. The XWA's engine uses two hangar models, Hangar.opt and FamilyBase.opt. If you wanted to use a custom hangar, you had to replace one of them. You can now choose which hangar to use, customize the objects and the camera positions, for a specific craft or for a specific mission. You can also define which crafts appear in the craft selection menu.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11197

hook_hangars.cfg

hook_hangars.cfg is a config file.

The SelectionMode option determines how a hangar is selected. The possible values are:

  • ForceHangar
  • BasedOnModelIndex
  • BasedOnModelIndexAzzameenCampaign

The default value is BasedOnModelIndexAzzameenCampaign

When SelectionMode = ForceHangar:

hangar = Hangar

When SelectionMode = BasedOnModelIndex:

if mission type is family
 hangar = FamilyBase
else
 hangar = Hangar
endif

When SelectionMode = BasedOnModelIndexAzzameenCampaign:

if mission type is family and mission id < 7
 hangar = FamilyBase
else
 hangar = Hangar
endif

hangar files

Suppose that the mission is "[MissionDir]\[Mission].tie". Suppose that the arrival craft is "FlightModels\[Model].opt". Suppose that the player craft is "FlightModels\[Player].opt".

The possible involved files are:

  • "[MissionDir]\[Mission].ini"
  • "[MissionDir]\[Mission]_Hangar.opt"
  • "[MissionDir]\[Mission]_HangarObjects.txt"
  • "[MissionDir]\[Mission]_HangarCamera.txt"
  • "[MissionDir]\[Mission]_FamHangarCamera.txt"
  • "[MissionDir]\[Mission]_HangarMap.txt"
  • "[MissionDir]\[Mission]_FamHangarMap.txt"
  • "FlightModels\[Model].ini"
  • "FlightModels\[Model]Hangar.opt"
  • "FlightModels\[Model]HangarObjects.txt"
  • "FlightModels\[Model]HangarCamera.txt"
  • "FlightModels\[Model]FamHangarCamera.txt"
  • "FlightModels\[Model]HangarMap.txt"
  • "FlightModels\[Model]FamHangarMap.txt"
  • "FlightModels\Hangar.opt"
  • "FlightModels\HangarObjects.txt"
  • "FlightModels\HangarCamera.txt"
  • "FlightModels\FamHangarCamera.txt"
  • "FlightModels\HangarMap.txt"
  • "FlightModels\FamHangarMap.txt"
  • "FlightModels\[Player].ini"
  • "FlightModels\[Player]Camera.txt"
  • "FlightModels\[Player]Size.txt"


To use a custom hangar, name it "FlightModels\[Model]Hangar.opt" or "[MissionDir]\[Mission]_Hangar.opt". The dll searches a "Hangar.opt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_Hangar.opt"
  • "FlightModels\[Model]Hangar.opt"
  • "FlightModels\Hangar.opt"

To replace the objects, create a file named "FlightModels\[Model]HangarObjects.txt" or "[MissionDir]\[Mission]_HangarObjects.txt". Or create a section named "[HangarObjects]" in "FlightModels\[Model].ini" or "[MissionDir]\[Mission].ini". The dll searches a "HangarObjects.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_HangarObjects.txt"
  • "[MissionDir]\[Mission].ini", section "[HangarObjects]"
  • "FlightModels\[Model]HangarObjects.txt"
  • "FlightModels\[Model].ini", section "[HangarObjects]"
  • "FlightModels\HangarObjects.txt"

If a "HangarObjects.txt" file doesn't exist, no model is replaced. The format is a line per object: "FlightModels\ObjectA = FlightModels\NewObjA" The replacement of a base opt with an exterior opt is ignored: lines like "FlightModels\ObjectA.opt = FlightModels\ObjectAExterior.opt" are ignored. To remove an object, use an empty invisible opt. To not load the shuttle, set "LoadShuttle = 0". To set the shuttle model index, set "ShuttleModelIndex = value". value is an integer. The default value is 50 (Shuttle). To set the shuttle markings, set "ShuttleMarkings = value". value is an integer. The default value is 0. To not load the droids, set "LoadDroids = 0". To invert the hangar floor, set "IsHangarFloorInverted = 1" in "HangarObjects". When set to 0, the floor is below the player craft. When set to 1, the floor is above the player craft.

See "HangarObjects.txt".

Apply to hangar:

To set the position of the camera, create a file named "FlightModels\[Model]HangarCamera.txt" or "[MissionDir]\[Mission]_HangarCamera.txt". Or create a section named "[HangarCamera]" in "FlightModels\[Model].ini" or "[MissionDir]\[Mission].ini". The dll searches a "HangarCamera.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_HangarCamera.txt"
  • "[MissionDir]\[Mission].ini", section "[HangarCamera]"
  • "FlightModels\[Model]HangarCamera.txt"
  • "FlightModels\[Model].ini", section "[HangarCamera]"
  • "FlightModels\HangarCamera.txt"

If a "HangarCamera.txt" file doesn't exist, default values are used. Only the position for keys 1,2,3,6,9 can be set with a "HangarCamera.txt" file. The format is:

"Key1_X = value"
"Key1_Y = value"
"Key1_Z = value"

See "HangarCamera.txt".

Apply to family base:

To set the position of the camera, create a file named "FlightModels\[Model]FamHangarCamera.txt" or "[MissionDir]\[Mission]_FamHangarCamera.txt". Or create a section named "[FamHangarCamera]" in "FlightModels\[Model].ini" or "[MissionDir]\[Mission].ini". The dll searches a "FamHangarCamera.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_FamHangarCamera.txt"
  • "[MissionDir]\[Mission].ini", section "[FamHangarCamera]"
  • "FlightModels\[Model]FamHangarCamera.txt"
  • "FlightModels\[Model].ini", section "[FamHangarCamera]"
  • "FlightModels\FamHangarCamera.txt"

If a "FamHangarCamera.txt" file doesn't exist, default values are used. Only the position for keys 1,2,3,6,7,8,9 can be set with a "FamHangarCamera.txt" file. The format is:

"FamKey1_X = value"
"FamKey1_Y = value"
"FamKey1_Z = value"

See "FamHangarCamera.txt".

To set the position of the camera for key 7 (hangar) or key 5 (family base), create a file named "FlightModels\[Player]Camera.txt". Or create a section named "[Camera]" in "FlightModels\[Player].ini". If a such file file doesn't exist for a model, default values are used. The format is:

"X = value"
"Y = value"
"Z = value"
"FamX = value"
"FamY = value"
"FamZ = value"

See "PlayerCamera.txt".

Apply to hangar:

To set the hangar map, create a file named "FlightModels\[Model]HangarMap.txt" or "[MissionDir]\[Mission]_HangarMap.txt". Or create a section named "[HangarMap]" in "FlightModels\[Model].ini" or "[MissionDir]\[Mission].ini". The dll searches a "HangarMap.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_HangarMap.txt"
  • "[MissionDir]\[Mission].ini", section "[HangarMap]"
  • "FlightModels\[Model]HangarMap.txt"
  • "FlightModels\[Model].ini", section "[HangarMap]"
  • "FlightModels\HangarMap.txt"

If a "HangarMap.txt" file doesn't exist, default values are used.

The file must contain at least 4 object line. The format is : model index, position X, position Y, position Z, heading XY, heading Z. or : model index, markings, position X, position Y, position Z, heading XY, heading Z. The numbers can be written in decimal or hexadecimal (0x) notation. When position Z is set to 0x7FFFFFFF, this means that the object stands at the ground.

See "HangarMap.txt".

Apply to family base:

To set the family hangar map, create a file named "FlightModels\[Model]FamHangarMap.txt" or "[MissionDir]\[Mission]_FamHangarMap.txt". Or create a section named "[FamHangarMap]" in "FlightModels\[Model].ini" or "[MissionDir]\[Mission].ini". The dll searches a "FamHangarMap.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_FamHangarMap.txt"
  • "[MissionDir]\[Mission].ini", section "[FamHangarMap]"
  • "FlightModels\[Model]FamHangarMap.txt"
  • "FlightModels\[Model].ini", section "[FamHangarMap]"
  • "FlightModels\FamHangarMap.txt"

If a "FamHangarMap.txt" file doesn't exist, default values are used.

The file must contain at least 4 object line. The format is : model index, position X, position Y, position Z, heading XY, heading Z. or : model index, markings, position X, position Y, position Z, heading XY, heading Z. The numbers can be written in decimal or hexadecimal (0x) notation. When position Z is set to 0x7FFFFFFF, this means that the object stands at the ground.

See "FamHangarMap.txt".

To set the elevation of the craft with closed S-Foils, create a file named "FlightModels\[Player]Size.txt". Or create a section named "[Size]" in "FlightModels\[Player].ini". If a such file file doesn't exist for a model, default values are used: if the craft is BWing, elevation = 50, else elevation = model height / 2.

The format is:

"ClosedSFoilsElevation = value"

See "BWingSize.txt".

craft selection

To define the list of crafts that appear in the hangar crafts selection menu, create the following files (next to XWingAlliance.exe):

  • "CraftSelectionTransports.txt"
  • "CraftSelectionFighters.txt"
  • "CraftSelectionCrafts.txt"

If the files don't exist, default values are used. CraftSelectionTransports define the crafts that appear when the mission player craft is a transport. CraftSelectionFighters define the crafts that appear when the mission player craft is a fighter. CraftSelectionCrafts define the crafts that appear in the Proving Ground.

See "CraftSelectionTransports.txt", "CraftSelectionFighters.txt", "CraftSelectionCrafts.txt"

Hangar views

For Hangar: Key 0 is the cockpit view. Keys 1,2,3,6,9 are fixed views. Keys 4 and 5 are related to the hangar droids. Key 7 is related to the player model. Key 8 is related to the hangar roof crane.

For FamilyBase: Key 0 is the cockpit view. Keys 1,2,3,6,7,8,9 are fixed views. Key 4 is related to the work droid 1. Key 5 is related to the player model.

xwa_hook_hull_icon

This hook enables setting hull icon for any craft.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11761

To set the hull icon for a craft, open "HullIconList.txt" and change the corresponding line to the desired value. If the file does not exist, default values are used.

See HullIconList.txt.

xwa_hook_interdictor

This hook permits to enable interdictor feature for any craft.

Suppose that the craft is "FlightModels\[Model].opt".

To enable the interdictor feature, create a file named "FlightModels\[Model]Interdictor.txt" or create a section named "[Interdictor]" in "FlightModels\[Model].ini". The format is:

IsInterdictor = 1

or

IsInterdictor = 0

If the file does not exist, default values are used. By default, the ModelIndex 137 Interdictor2 and ModelIndex 141 ModStrikeCruiser are interdictor.

See Interdictor2Interdictor.txt and ModStrikeCruiserInterdictor.txt.

xwa_hook_lightmaps

This hook replaces a static buffer by a dynamic one in lightmaps loading.

xwa_hook_mission_objects

This hook permits to replace mission objects and to enable crafts turrets.

mission objects

Suppose that the mission is "[MissionDir]\[Mission].tie".

The possible involved files are:

  • "[MissionDir]\[Mission].ini"
  • "[MissionDir]\[Mission]_Objects.txt"
  • "FlightModels\Objects.txt"

To replace the objects, create a file named "[MissionDir]\[Mission]_Objects.txt" or create a section named "[Objects]" in "[MissionDir]\[Mission].ini". The dll searches a "Objects.txt" file in this order (from first to last):

  • "[MissionDir]\[Mission]_Objects.txt"
  • "[MissionDir]\[Mission].ini", section "[Objects]"
  • "FlightModels\Objects.txt"

If a "Objects.txt" file doesn't exist, no model is replaced. The format is a line per object: "FlightModels\ObjectA = FlightModels\NewObjA"

See "Objects.txt".

crafts turrets

The craft turrets are no longer limited to CorellianTransport2, MilleniumFalcon2, and FamilyTransport. You can now enable turrets for any craft.

Suppose that the player craft is "FlightModels\[Player].opt".

The possible involved files are:

  • "FlightModels\[Player]Gunner.opt"
  • "FlightModels\CorellianTransportGunner.opt"

To define a custom gunner opt, create a "[Player]Gunner.opt" file.

xwa_hook_mission_tie

This hook permits to override the data of mission files.

Suppose that the mission is "[MissionDir]\[Mission].tie".

To override the mission data, create a file named "[MissionDir]\[Mission].txt" or create a section named "[mission_tie]" in "[MissionDir]\[Mission].ini". The format is a line per replacement.

To replace the flight group markings, the format is: "fg", fg number, "markings", value.

To replace the flight group iff, the format is: "fg", fg number, "iff", value.

To replace the flight group pilot voice, the format is: "fg", fg number, "pilotvoice", value.

See "mission.txt".

xwa_hook_opt_limit

This hook removes the opt limit of 512 vertices per mesh.

The original vertices count limit is 512 per mesh. By default, the dll will use a value of 4096. You can modify this value in hook_opt_limit.cfg (Size = value).

The size of the execute buffer is increased from 0x10000 to 0x200000.

xwa_hook_pilot

This hook enables pilot meshes animation for any craft.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11695

Suppose that the craft is "FlightModels\[Model].opt". To define wich meshes are animated, create a file named "FlightModels\[Model]Pilot.txt" or create a section named "[Pilot]" in "FlightModels\[Model].ini". If the file does not exist, default values are used:

  • X-Wing (meshes 6 and 9)
  • Y-Wing (meshes 8 et 13)
  • A-Wing (meshes 4)
  • Corellian Transport 2 (meshes 19 et 17)
  • Millenium Falcon 2 (meshes 21 and 19)
  • Family Transport (meshes 13 and 9)

The format is a line per mesh:

mesh index, angle, speed, behavior

Speed must be a multiple of 2.

Behavior can be 0, 1, or 2:

  • 0 means constant rotation
  • 1 means rotation with random
  • 2 means rotation with random and pause

See *Pilot.txt.

xwa_hook_res1200

This hook replaces a static buffer with a dynamic one in initializing 2d buffer. It fixes a crash when resolution height > 1200 is used.

xwa_hook_resolution

This hook displays the screen resolution in the video options screen.

xwa_hook_sfoils

This hook enables S-Foils for any craft.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=9&t=11693

Suppose that the craft is "FlightModels\[Model].opt".

To create s-foils, create a file named "FlightModels\[Model]SFoils.txt" or create a section named "[SFoils]" in "FlightModels\[Model].ini". If the file does not exist, default values are used (S-Foils for XWing, BWing, and Shuttle).

The format is a line per mesh:

mesh index, angle, closing speed, opening speed.

See XWingSFoils.txt, BWingSFoils.txt, ShuttleSFoils.txt.

xwa_hook_shield

This hook permits to define shield recharge rates for any craft.

See https://www.xwaupgrade.com/phpBB3/viewtopic.php?f=33&t=12125

Suppose that the mission is "[MissionDir]\[Mission].tie". Suppose that the craft is "FlightModels\[Model].opt".

The possible involved files are:

  • "[MissionDir]\[Mission]_Shield.txt"
  • "[MissionDir]\[Mission].ini", section "[Shield]"
  • "FlightModels\[Model]Shield.txt"
  • "FlightModels\[Model].ini", section "[Shield]"

To define the recharge rate for a craft, create a file named "FlightModels\[Model]Shield.txt" or create a section named "[Shield]" in "FlightModels\[Model].ini". The format is:

UseGenerator = 0 to use RechargeRate or 1 to use PerGeneratorRechargeRate
PerGeneratorRechargeRate = per generator recharge value
RechargeRate =  recharge value

If the file does not exist, default values are used.

By default, the recharge rate is controlled as this: For starfighters the recharge rate is 20. For Interdictor, Victory Star Destroyer, Imperial Star Destroyer, and Super Star Destroyer, the recharge rate is 5 multiplied by the number of shield generators still alive. For other starships, the recharge rate is 5. For other crafts, the recharge rate is 0.

For player craft, if the rate is 0 then it is set to 20.

To define the recharge rate for a craft for a given mission, create a file named "[MissionDir]\[Mission]_Shield.txt" or create a section named "[Shield]" in "[MissionDir]\[Mission].ini". The format is a line per craft:

ModelIndex, UseGenerator, PerGeneratorRechargeRate, RechargeRate

xwa_hook_slam

This hook enables the SLAM system when the K key pressed.

See http://www.xwaupgrade.com/phpBB3/viewtopic.php?f=9&t=12050

Suppose that the craft is "FlightModels\[Model].opt".

To enable the SLAM feature, create a file named "FlightModels\[Model]Slam.txt" or create a section named "[Slam]" in "FlightModels\[Model].ini". The format is:

HasSlam = 1

or

HasSlam = 0

If the file does not exist, default values are used. By default, the Missile Boat has a SLAM system.

See MissileBoatSlam.txt.

xwa_hook_textures_tag

This hook set a tag to the textures. The tag can then be read from ddraw.dll.

The tag can be read from the CreateSurface method of the IDirectDraw interface. The dwReserved variable of the DDSURFACEDESC structure is set to a pointer to the tag string (const char*).

The format of the tag is:

  • for dat images: "dat,groupId,ImageId,mipmapLevel"
  • for opt textures:
    • "opt,optFileName,textureName,color,mipmapLevel" for color maps
    • "opt,optFileName,textureName,color-transparent,mipmapLevel" for transparent color maps
    • "opt,optFileName,textureName,light,mipmapLevel" for light maps

To help debugging, the hook can optionally write the tags to the debug ouput that can be read with DebugView.

xwa_hook_time

This hook reduces the CPU usage of the game. A side effect is that the framerate is a bit reduced.

See http://www.xwaupgrade.com/phpBB3008/viewtopic.php?f=10&t=11338

xwa_hook_weapon_color

This hook permits to define weapon color for any craft.

Suppose that the craft is "FlightModels\[Model].opt".

To define the color, create a file named "FlightModels\[Model]WeaponColor.txt" or create a section named "[WeaponColor]" in "FlightModels\[Model].ini". The format is:

WeaponColor = color marking value
WeaponColorXXX = color marking value
WeaponImpactColor_3100 = ARGB color
WeaponImpactColor_3200 = ARGB color
WeaponImpactColor_3300 = ARGB color
WeaponImpactColor_3400 = ARGB color
WeaponImpactColor_3500 = ARGB color
WeaponImpactColorXXX = ARGB color
EnergyBarColorLaserHigh = ARGB color
EnergyBarColorLaserLow = ARGB color
EnergyBarColorIonHigh = ARGB color
EnergyBarColorIonLow = ARGB color

The format of the color is ARGB: FF000000 is black, FFFF0000 is red, FF00FF00 is green, FF0000FF is blue.

WeaponColor defines the default value used for all weapons. XXX in WeaponColorXXX goes from 280 to 307. When present, this overrides the default value. You can define a different value for all weapons. The default value is 0.

The default impact colors are:

WeaponImpactColor_3100 = FF0000FF
WeaponImpactColor_3200 = FFFF0000
WeaponImpactColor_3300 = FF00FF00
WeaponImpactColor_3400 = FFFF00FF
WeaponImpactColor_3500 = FFFFFF00

XXX in WeaponImpactColorXXX goes from 280 to 307. When present, this overrides the default impact color. If it is set to 0, the default value will be used. You can define a different impact color for all weapons.

EnergyBarColorLaserHigh and EnergyBarColorLaserLow define the color of the laser energy bar. EnergyBarColorIonHigh and EnergyBarColorIonLow define the color of the ion energy bar.

You also need to add a flightgroup color/markings to the weapon OPTs.

See http://www.xwaupgrade.com/phpBB3/viewtopic.php?p=156215#p156215

xwa_hook_weapon_rate

This hook permits to define weapon decharge and recharge rates for any craft.

Suppose that the craft is "FlightModels\[Model].opt".

To define the decharge and recharge rates, create a file named "FlightModels\[Model]WeaponRate.txt" or create a section named "[WeaponRate]" in "FlightModels\[Model].ini". The format is:

DechargeRate = decharge value
RechargeRate = recharge value

If the file does not exist, default values are used.

By default, the decharge rate is controlled as this:

if the ship category is Starfighter,
  if the craft is TieFighter or TieBomber, the decharge rate is 3,
  else the decharge rate is 4.
else
  if the weapon sequence is < 4, the decharge rate is 3,
  else there is no decharge.

By default, the recharge rate is controlled as this:

if the craft is TieFighter or TieBomber, the recharge rate is 3 * PresetLaser,
else the recharge rate is 2 * PresetLaser.

See TieFighterWeaponRate.txt and TieBomberWeaponRate.txt.

xwa_hook_windowed

This hook enables windowed mode.

To set the window position and size, modify "hook_windowed.cfg":

X = left value
Y = top value
Width = width value
Height = height value

The minimum value for "Width" is 640. The minimum value for "Height" is 480.

When "Width" or "Height" is 0, default values are used: the window will be fullscreen.

xwa_hook_wingmen_voices

This hook enables setting wingmen voices for imperial IFF.

To choose an imperial wingman voice, set pilot voice to the desired value or set IFF to 1 (imperial).

For values IP1 to IP12, ISP1.LST to ISP12.LST will be loaded.

If IFF is set to 1 (imperial), random imperial voices will be loaded. Else random rebel voices will be loaded.