﻿Xenonauts Fix Pack (XFP) by Policenaut/pedr0/ペドロ

-------
REQUIREMENTS: 
X:CE and the following mods included with X:CE - Lore+, Extended Weapon Descriptions for Fighters, Khall's Tundra Tileset, Khall's More Portraits, The Random Map Packs, Restored Community Map Pack and Skitso's Ultimate Megamix Map Pack 2000.

The Tropical and Swamp Tileset has some tile fixes applied to it but is not required to use the Xenonauts Fix Pack. The other map packs have mapping fixes which is why they're required to be installed (or you will end up with weird maps with invisible graphics).

MOD LOAD ORDER:
Put the Xenonauts Fix Pack at the top of your mod load order (at least above the mods listed above). If you use any big mods or total conversions you should put them above the Xenonauts Fix Pack.

SAVE COMPATABILITY:
All changes except the research tree edits and "Extended Weapon Descriptions for Fighters" mod fixes are compatible with old saves. The research tree edits and "Extended Weapon Descriptions for Fighters" mod fixes won't properly apply to a game in progress but you can still play. Map and tile fixes won't show up if you load a ground combat save after installing the Xenonauts Fix Pack, but should apply the next time you enter ground combat.

MOD COMPATABILITY:
Should be compatible with most mods but if a mod edits the research requirements for the explosives and weapons research trees, then the one with higher priority in the mod load order will overwrite the other. If you use a big mod/total conversion, then put the Xenonauts Fix Pack below them in the mod loader. If you happen to use a soldier face replacer that doesn't use the vanilla artstyle, you should manually delete the [soldierimages] folder in [ mods/Xenonauts Fix Pack/ ] to disable the Khall's More Portraits fix. If you use a main menu background replacer then manually delete the [backgrounds] folder in [ mods/Xenonauts Fix Pack/ ].

If any future map packs are released and made with the old system for creating buildings, they won't have the new fixes applied to them. All current map packs are covered by the Xenonauts Fix Pack (Khall's Tundra Tileset, The Random Map Packs, Restored Community Map Pack, Skitso's Ultimate Megamix Map Pack 2000 and Tropical and Swamp Tileset).

INSTALLATION:
- Download and install the latest version of Xenonauts: Community Edition and activate the required mods.
- Put XFP at the top of your mod list.
- Clear your internal scripts folder. For example: [C:\Documents and Settings\USERNAME\Application Data\Goldhawk Interactive\Xenonauts\internal\scripts\] or [C:\Program\Steam\SteamApps\common\Xenonauts\assets\mods\internal\scripts\]. Simply delete the scripts folder there. Simply delete the scripts folder there.
- Play!

-------
-DETAILS-

Note on building destruction:
To collapse a building you will need to destroy around 50% of the walls on the first floor. Collapsing a building causes the whole building to collapse, it's not possible to collapse individual parts of a building. It's also not possible to collapse the upper floors by themself as well, due to limitations with the collapse system. There is a bug related to ground tiles (tiles that you can walk on) on upper floors collapsing, that will sometimes cause a weird state to occur which makes flying units entering the tiles of the collapsed ground tiles become "invisible". You can still see their shadow and the unit is treated as visible and they will become visible again when touching another ground tile. However, since flying units cannot attack while in the air it doesn't really affect gameplay. It has been reported to sometimes happen with ground level ground tiles, but I haven't experienced that myself during my testing.

If you happen to encounter any buildings that won't collapse then please PM me with some screenshots and details on the official Xenonauts forum (my username is Policenaut). I tried to find all instances where a prop with the isCollapsibleTile="1" setting is located near or inside a building, which can cause the collapse system to break, because the game only allows you to collapse an area once.

Note on roof destruction:
Ground tile based roofs are not destructible because ground tiles don't support proper destruction. Non ground tile roof tiles are also indestructible (as in vanilla) to keep consistency and avoid situations with floating roof parts. Both roof types can be collapsed by destroying the walls of the first floor.

Note on some multi-level props:
Certain multi-level props have in some cases been made indestructible (still damageable, but they won't get completely destroyed) because of the collapse system not being designed to be compatible with them or to avoid instances which bugged the collapsing of buildings. Some examples include radio towers, oil towers, radar towers and shipping containers (which should now all be walkable on top). Lamp posts and traffic lights have been changed into 1-level props and are fully destructible. 

Note for mappers:
Buildings need to use unique wall tiles for the ground level that have the isCollapsibleTile="1" setting on their default and damaged states (as well as open for doors). I've created firstlevel_ variants of most walls (except some special "walls" that are used only for certain 1 story buildings - nissenhuts, shedwood etc. The walls on the upper floors of buildings will need to use special destruction graphics so we don't end up with floating roofs etc. Study the wall tile spectres and building submap files in the fixpack for more details. Be wary of placing props with isCollapsibleTile="1" inside/near buildings as they can bug the collapse system, which is why I've disabled the isCollapsibleTile="1" setting on certain props and made them indestructible.

Ground tiles that are used on upper levels need to have their damage overlays disabled as well. This can be done by setting the HP value to 0 in all states for the ground tiles you use. If you don't do this you end up with invisible ground tiles that still block LOS but appear invisible, whenever ground tiles on upper levels receive damage.

If you happen to create a new set of stairs then follow this template for both the lower, upper and support stair tile spectres: 
default - hp="240", damaged - hp="999999999", destroyed - hp="0"
This will fix the bug that the default stairs template had, which made it impossible to use the stairs in its damaged state. The 999999999 hp for the damaged state is to make it practically indestructible (since we don't want destructible stairs trapping units on upper floors) while bypassing the stairs bug. It might be possible to destroy the lower part of the stairs with vehicles so drive into stairways at your own risk.

-------
Special thanks to Antoine Potten for creating antrenamer2, Don Ho and the Notepad++ team for creating Notepad++ and to the Krita team for creating Krita. 
All three great, free tools that helped a lot when creating the Xenonauts Fix Pack.

-------
CHANGELOG:
1.0
- Fixed the missing orientation data on certain bookshelves so you can stand near them
- Adjusted the sortpoint data on certain bookshelves so they render behind units instead of in front of them
- Fixed two windows in the wooden farmhouse set in the Restored Community Map Pack that started floating in the air after breaking them
- Added destruction to the wooden farmhouse set in the Restored Community Map Pack
- Made it possible to stand next to toilet sinks
- Fixed the graphical layering issues with bookshelves and fridges next to open doors in house_small_LR and house_small_UD submaps in the town tileset
- Made it possible to walk on flowerbeds without stone planters and removed their cover value

1.1
- Changed traffic lights to be crushable and fixed faulty orientation and sortpoint data
- Made wall junk piles and shrubs in the middleeast tileset crushable and edited the destruction sound of the wall junk piles
- Made the shrubs copied from the middleeast tileset in the Restored Community Map Pack/X:CE also crushable
- Made the undamaged round haybales in the farm tileset crushable 
- Added new destruction sounds for all rocks
- Made all the rock_cover_*x* variations not crushable
- Fixed the pathScore and isCover setting for benches, litter bins and fruit stands so they are actually crushable and don't fade out on mouse over
- Fixed the pivot data for FenceNE1_hole destroyed state
- Fixed destruction on some tree_2tall variations in various map packs and also made all tree_2tall variations crushable
- Made tree_1 and tree_2 in Skitso's Ultimate Megamix Map Pack 2000 crushable
- Removed some trees in industrial_medium_longroad map in Skitso's Ultimate Megamix Map Pack 2000 which had floating treetops upon destruction

1.2
- Fixed misspelling in Lore+ Xenopedia entries
- Removed destroyed state graphics for warehouse metal doors, hangar upper walls and windows in the desert tileset to get rid off floating rubble when destroying the tall multi level hangars on desert maps
- Changed destruction sound for hangar windows
- Edited hangar submaps in the desert tileset which had wall_base on upper levels instead of wall_upper

1.3
- Made all roof tiles destructible (certain ones that use the "ground tile" system were untouched to not cause issues)
- Made all roof tiles collapsible to fix instances where you destroy all walls of a building but the roof somehow ends up floating in the air
- Changed some roofs that were passable but were supposed to be unpassable into unpassable
- Changed visiblity and cover values on some copied roofs in map packs that didn't match the originals
- Added collapsible setting to some parts of nissen huts (arctic, desert and tundra) that were missing it
- Added destroyed state graphics to some trees that were missing it and fixed faulty pivot data

1.35
- Adjusted the HP value of the bus in the town/industrial/desert tilesets from 1800HP to 360HP like the bus in the soviettown tileset - no more busses that are stronger than tanks!

1.36
- Fixed wooden farmhouse bug with invisible walls that could occur with some mod load orders
- Fixed pivot data on some copied walls/doors/windows in the farm tileset

1.37
- Fixed the ammo count in the description for laser, plasma and MAG pistols
- Edited Lore+ requirements for alien class analysis to require the respective autopsy/disassembly first
- Improved the graphics of the med10 and nor32 male faces in Khall's More Portraits

1.4
- Fixed the TU% cost for the Rocket Launcher description - description said it was 50% but it's actually 60%
- Fixed the size of the gibbed gore inventory graphics for aliens and xenonauts
- Made the Plasma Explosives research require Alenium Explosives research and Fusion Explosives research require Plasma Explosives research - this should fix the rare possibility of bugging the explosives upgrade system if skipping the prior tier of explosives
- Made the Advanced Plasmas research require Advanced Lasers research and Advanced MAGs research require the Advanced Plasmas research to fix a similar situation to above
- Made MAG weaponry research require Plasma weaponry research due to adjustments above
- Modmerge improvements in sounds_gc.xml
- Fixed missing graphics for Xenonauts when carrying shields and alien grenades together
- Fixed a small animation bug in the main menu background
- Made Valkyrie drop pods indestructible and improved the pivot values (especially the vehicle variant)
- Made the Valkyrie drop pod flares indestructible and turned them into light sources
- Adjusted the Valkyrie drop pod landing site to cover the entire deployment area and moved the flares to mark out the entire "dropship" tile area used when aborting a mission
- Reverted some submap building changes for hangars on desert maps
- Made the walls on the first level of buildings unique to avoid a bug that would cause problems with the collapse system
- Edited the destruction graphics for walls on upper levels to avoid floating graphics
- Created unique building variants of certain multi-level props without the isCollapsibleTile setting to avoid a bug that would cause problems with the collapse system
- Reverted isCollapsibleTile="1" additions to roof tiles
- Fixed collision settings for the roof of nissen huts
- Edited a lot of non ground tile roof tiles to block LOS and bullets
- Disabled the ground tile damage overlays for ground tiles used in buildings - ground tiles on upper levels cannot use the damage overlays and become invisible, so the whole system has been disabled for all ground tiles used on the upper levels inside buildings
- Added footstep sounds to ground tiles that were missing them
- Fixed the collision setting for the upper part of scrap stairs in Skitso's Ultimate Megamix Map Pack 2000
- Added destruction graphics and removed the vaultable setting for wall heaters
- Added improved med10 and nor32 male faces for the Sentinel Armour in the Better Armour Graphics mod (this mod is not required and will not cause issues if not installed)
- Fixed the pivot value on two workshop toolchests destroyed/damage state
- Added missing .xml spectre files for all the "decals" in the Restored Community Map Pack so they're destructible
- Improved the pivot value of the air control tower windows in the desert tileset
- Improved the look of building destruction rubble tiles
- Increased the building destruction smoke dissipation chance
- Fixed the ReplaceItem() bug associated with the fighter plane missiles/torpedoes in the "Extended Weapon Descriptions for Fighters" mod, which caused the stats to be wrong in the Xenopedia entry after unlocking a higher tier of missiles/torpedoes
- Fixed the description and Xenopedia artwork of the fusion missile in "Extended Weapon Descriptions for Fighters" mod
- Added "ground tiles" to shipping containers that were missing them - also made shipping containers indestructible due to the collapse system not being suitable for them
- Removed isCollapsibleTile="1" setting from tree_3tall tree tops, palm tops, as well as the tree markers and tree/palm tops in the Tropical and Swamp Tileset
- Fixed all stairs so that they're useable in their damaged state as well
- Many mapping fixes to the various map packs and vanilla as well
- Many tile fixes to the various map packs and vanilla as well

1.41
- Removed the TransparentWithUnit="1" setting from barn walls in the Farm tileset + copies in the Town and Tundra tilesets - old tile setting that is no longer needed and causes issues with the automatic transparency system
- Added a missing wall piece to a building in the Farm tileset
- Improved the destruction sound of concrete barriers