Requires accompanying GameDir change.
Removed ItemFlag as an xml tag and added bitmask flags as their own individual tags. Makes modding easier when the flags can be modified without math in the xml files
Bloodcat lair had a few cats with CLOSE PATROL orders, resulting them to move only 15 tiles from their starting point, allowing them to be picked off from afar with scoped rifles.
Some bloodcats during ambushes could have ubInsertionDirection with values > 100, which then causes endless looping in pathfinding algorithms as valid direction values range from 0 to 7
UseCreatureMusic( HostileZombiesPresent() ); was overriding the music mode set in PrepareCreaturesForBattle() when encountering crepitus or being in the creature caves, resulting in regular tense and battle music being played.
- If we have a sector already loaded (eg. Drassen airport)
- Squad in a different sector encounters enemies and goes to autoresolve
- After pressing DONE in autoresolve screen -> we miss calling the TrashWorld() function in CheckAndHandleUnloadingOfCurrentWorld() due to battle sector not being the same as loaded sector.
- Selected sector gets reset from Drassen airport to invalid values by same function
- Now we have the loaded sector's whole inventory existing in gWorldItems
- Enter any other sector in tactical mode and the gWorldItems gets added into its sector inventory in EnterSector()
Because the TrashItems() work in a way where it only sets gWorldItems elements to not existing if it finds them in a loaded map's structure data, we will pretty much always have that original bugged out set of items present in gWorlItems and they will constantly be added to sector inventories from then on once the bug has been triggered.
The more detailed error message that used to go only to Livelog.txt is now also displayed in the ingame error screen, providing more helpful error message to players when making bug reports/asking for help
Requires accompanying gameDir change.
MercOpinions.xml now only contains opinions that are not 0. A new tag with fields "id" and "modifier" are used instead of old ones that had 255 <Opinion%d> $value$ </Opinion%d> tags for all profiles.
Loading time of MercOpinions.xml went down from ~4.047 s to 0.011 s due to this change with default 1.13 VFS config.
A small cmd utility tool for converting existing MercOpinions.xml data into the new format is available at https://github.com/Asdow/JA2-ConvertXMLData/tree/master
Fix illegal array access when creating an IMP and the help texts are referenced.
With the missing comma, the array length was 5 and it's supposed to be 6.
This check was preventing enemies from retreating into another sector if tactical AI retreat was enabled, leading into AI deadlock every time AI_ACTION_RUNAWAY was the decision.
If "Battle B" music file is found, use it instead of tensor B for the second original battle music. Allows us to replace either the enemy present or battle version of the same track instead of always both when "tensor B" is replaced.
Additional music can be added by placing sound files into Dataa/Music folder following this naming convention
musicmode_runningNumber.fileformat, so for example:
Mainmenu_001.mp3
Mainmenu_002.ogg
Laptop_002.ogg
Tactical_003.wav
*****************************************************************
Different musicmodes are
Mainmenu_ <-- Mainmenu music
Laptop_ <-- Laptop music
Tactical_ <-- Tactical with nothing special going on
Enemy_ <-- Tactical, enemy present
Battle_ <-- Tactical, enemy present and visible
Victory_ <-- Tactical, battle victory
Death_ <-- Tactical, battle defeat
Creepy_ <-- Tactical, creatures present
CreepyBattle_ <-- Tactical, creatures present and visible
Music files can be .mp3, .ogg or .wav formats and 100 songs in each category is supported.
The running numbering starts from 000
*****************************************************************
A few filenames are treated in a special way to facilitate easy replacement of original music.
To replace original music, insert the following named files into this folder
"menumix1" <-- Mainmenu music
"marimbad 2" <-- Laptop music
"nothing A" <-- Tactical with nothing special going on
"nothing B"
"nothing C"
"nothing D"
"tensor A" <-- Tactical, enemy present
"tensor B"
"tensor C"
"triumph"
"death"
"battle A" <-- Tactical, enemy present and visible
"tensor B" <-- This file is also used as battle music
"creepy" <-- Tactical, creatures present
"creature battle" <-- Tactical, creatures present and visible
* User center insertion point for merc arrival
instead of initial arrival gridno that is meant only for the very first helidrop arrival at the start of a game.
* Prevent possible nullptr dereference
There was a bug in a provided save where a merc's group had persistent flag set, even though the assignment was DRILL_MILITIA, which should never have a persistent group. When the code was calling RemoveGroup instead of RemovePlayerFromGroup at this point, it would crash the game with an assertion error in CancelEmptyPersistentGroupMovement() as the group in fact was not empty! Now we're removing the merc first and then checking if the group is empty and if so, attempt to delete it.
Call PruneWorldItems() before sectorinfo gets written to the save file.
Resetting the SF_ITEM_TEMP_FILE_EXISTS would not transfer correctly into the save file.
Not used anywhere in the code.
Moved ChompSlash from FileCat.cpp to image.cpp, as the only two references besides ones in filecat.cpp for the function were in there. The references are inside an #ifdef 0 block so they are not compiled currently, but this should prevent them from not working IF we ever enable them
instead of old custom code from container.cpp
* Removed initialize and shutdown event manager calls from Init.cpp as they were only used to create and destroy the old HLIST globals
* Moved code from Event Manager.cpp to Event Pump.cpp as the event queue system is only used in said file.
* Removed now useless event manager.cpp and .h files
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY
* Add direction utility function
We have a lot of places in the code that calculate direction based on center cell coordinates, but lack a utility function for it similar to other direction methods.
* Use utility function for calculating direction
* Use ConvertGridNoToCenterCellXY
* Use utility function for direction
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY
* Use ConvertGridNoToCenterCellXY instead of CenterX & CenterY
* Remove CenterX & CenterY functions
Use ConvertGridNoToCenterCellXY instead
* Remove CenterX & CenterY calls from UB configuration
* Address review feedback
* Remove duplicate function
ConvertGridNoToCenterCellXY and ConvertMapPosToWorldTileCenter do the exact same thing
* Use PythSpacesAway instead of GetRangeFromGridNoDiff
Both functions calculate the same thing
* Remove GetRangeFromGridNoDiff
* Remove calls to abs()
The values end up being squared anyways making these unnecessary
GetToHitBonus() expects BOOLEAN for fProneStance argument, with no comparison to ANIM_PRONE, the ubEndHeight ends up adding bipod bonuses to *all* stances
Old 720p resolution had character inventory drawn over the message box so messages were hidden when inventory is up. New widescreen UI is similar to all the other higher resolutions where this is not the case anymore.
When using mousewheel to switch between pages in features screen, the HandleHighLightedText() function sometimes would retain valid bHighlight index, but toggle_box_array[bHighlight] == -1, which is used to access z113FeaturesToggleText[] and would later trigger Assertion in gprintfdirty() with pFontString == NULL
In widescreen strategic UI, team panel sort buttons would be hidden when transferring items to and fro merc inventory via CTRL + left click
Exit inventory panel button should always be disabled in widescreen UI