Amineri Posted April 10, 2013 Share Posted April 10, 2013 It is already possible to adjust alien stats by altering the DGC.ini embedded in the XcomGame.exe. The character base stats can be altered, as well as changing each type of game unit based upon difficulty (e.g. BalanceMods_Easy=(eType=eChar_Civilian, iDamage=0, ...) However, haven't you ever wanted to be able to configure the game to change an alien's stats DURING the game? By this, I mean that an alien will start off with a set of stats, and then after a certain number of days have passed in the strategy game, the alien's stats will upgrade. Well, this mod makes it possible. After the mod is applied, it is configured via the DGC.ini file embedded within the executable. 1) The BalanceMods_Easy and BalanceMods_Normal no longer adjust stats for Easy and Normal difficulty. Easy and Normal now default to "NO STAT ADJUSTMENTS". BalanceMods_Hard and BalanceMods_Classic will function as before.2) Whenever a new mission is started, the game updates each alien's stats.For each alien it does the following:a) Compare the number of days elapsed to the BalanceMods_Easy / iCritHit stat. If more days have passed then this number then the rest of the line's stat adjustments are applied to the alienb) Do the same for BalanceMods_Normal / iCritHitc) The two upgrades are cumulative. If both day counts are passed, both the Easy/Normal field adjustments are applied.d) if the iCritHit stat is 0, the upgrade line will never be applied. ---------------------------------------------------------------------------------------- Here is an example of how it works: BalanceMods_Easy=(eType=eChar_Sectoid, iDamage=1, iCritHit=90,iAim=10,iDefense=0,iHP=2, iMobility=0,iWill=0) This line will give all Sectoids +1 damage, +10 aim, and +2 HP after 90 days have elapsed. Want to make Chryssalids tougher in the late game?BalanceMods_Easy=(eType=eChar_Chryssalid, iDamage=4, iCritHit=120iAim=0,iDefense=20,iHP=6, iMobility=4,iWill=0) This line will give Chryssalids +4 damage, +20 defense, +6 HP, and +4 movement after 120 days (roughly beginning of 5th month) Here's how to combine the two sections to provide up to three tiers of difficulty: BalanceMods_Easy=(eType=eChar_Chryssalid, iDamage=4, iCritHit=120iAim=0,iDefense=20,iHP=6, iMobility=4,iWill=0) BalanceMods_Normal=(eType=eChar_Chryssalid, iDamage=2, iCritHit=240,iAim=0,iDefense=0,iHP=4, iMobility=2,iWill=0) This applies Chryssalid upgrade in two stages:After 120 days, they get +4 damage, +20 defense, +6 HP, and +4 movementAfter 240 days, they get an additional +2 damage, +4 HP, and +2 movement This means that after 240 days the cumulative upgrade would be +6 damage, +20 defense, +10 HP, and +6 movement. -------------------------------------------------------------------------------------------------- Applying this mod and then loading a saved game (in the middle of a mission) will not automatically adjust alien stats. However, changing difficulty up/down and then back to your current will force a refresh of alien stats in the current mission. Applying this mod and then accepting a mission that had been generated prior to the mod being applied may cause the Day-count to not be passed to the mission, and so alien stats will not be dynamically adjusted for that mission. JL might be working a better way to set the Day-count so that it updates every "Tick" in the strategy game. If this works, then I'll update the hex code for the strategy game code. This mod can also be used to dynamically adjust Civilian, Soldier, and SHIV units --- but where is the fun in that? :smile: ------------------------------------------------------------------------------------------------ The mod requires hex changes in three locations -- 1 in the XcomStrategyGame.upk to pass the Day-count to the tactical game, and 2 changes within XcomGame.upk to dynamically adjust the stats. 1) XcomStrategyGame.upk -- Sets the current Day-count in XGMission.GenerateOpName when a new mission is generated GenerateOpNameBefore total hex (header + function)60 37 00 00 AB 1F 00 00 00 00 00 00 5D 37 00 00 00 00 00 00 00 00 00 00 60 37 00 00 00 00 00 00 07 01 00 00 90 1B 00 00 86 01 00 00 06 01 00 00 49 02 00 28 15 07 22 00 9A 01 35 37 00 00 2C 08 16 04 01 27 37 00 00 06 7B 01 0F 00 5E 37 00 00 2E 71 FE FF FF 19 19 2E 94 FE FF FF 12 20 FD FE FF FF 0A 00 3A FB FF FF 00 1C 91 FD FF FF 16 09 00 09 FB FF FF 00 01 09 FB FF FF 13 00 A4 FA FF FF 00 1B B6 0D 00 00 00 00 00 00 1F 58 47 50 61 72 61 6D 00 16 07 F7 00 2D 00 60 37 00 00 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A 2C 2E 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A 2C 06 01 28 37 00 00 06 51 01 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A A7 2C 35 16 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A A7 2C 4C 16 01 28 37 00 00 04 12 20 8C FE FF FF 14 00 09 FA FF FF 00 1B 39 0D 00 00 00 00 00 00 01 26 37 00 00 4A 16 04 3A 5F 37 00 00 53 After total hex (header + function)60 37 00 00 AB 1F 00 00 00 00 00 00 5D 37 00 00 00 00 00 00 00 00 00 00 60 37 00 00 00 00 00 00 07 01 00 00 90 1B 00 00 66 01 00 00 06 01 00 00 49 02 00 28 15 07 22 00 9A 01 35 37 00 00 2C 08 16 04 01 27 37 00 00 06 5B 01 0F 00 5E 37 00 00 2E 71 FE FF FF 19 19 2E 94 FE FF FF 12 20 FD FE FF FF 0A 00 3A FB FF FF 00 1C 91 FD FF FF 16 09 00 09 FB FF FF 00 01 09 FB FF FF 13 00 A4 FA FF FF 00 1B B6 0D 00 00 00 00 00 00 1F 58 47 50 61 72 61 6D 00 16 1B CE 26 00 00 00 00 00 00 24 01 19 1B 4C 0E 00 00 00 00 00 00 16 0A 00 82 41 00 00 00 1B F2 0E 00 00 00 00 00 00 16 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0F 19 00 5E 37 00 00 09 00 EF F9 FF FF 00 01 EF F9 FF FF 1A A7 2C 35 16 01 29 37 00 00 0F 19 00 5E 37 00 00 09 00 EE F9 FF FF 00 01 EE F9 FF FF 1A A7 2C 4C 16 01 28 37 00 00 04 12 20 8C FE FF FF 14 00 09 FA FF FF 00 1B 39 0D 00 00 00 00 00 00 01 26 37 00 00 4A 16 04 3A 5F 37 00 00 53 2) XcomGame.upk -- change XGTacticalGameCore.ModifyStatsByDifficulty to apply stat changes based on Day-countoriginal:D1 77 00 00 50 55 00 00 00 00 00 00 BA 77 00 00 00 00 00 00 00 00 00 00 BB 77 00 00 00 00 00 00 27 05 00 00 A7 A6 00 00 07 0A 00 00 0F 06 00 00 05 66 76 00 00 00 01 66 76 00 00 0A 8E 02 25 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 06 04 0A 0A 0A 05 2C 02 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 06 04 0A 0A 86 07 2C 03 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 06 04 0A 0A 8A 07 26 0A FF FF A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 06 04 0A 04 0B 53 new:D1 77 00 00 50 55 00 00 00 00 00 00 BA 77 00 00 00 00 00 00 00 00 00 00 BB 77 00 00 00 00 00 00 27 05 00 00 A7 A6 00 00 EF 09 00 00 0F 06 00 00 07 84 02 9A 01 66 76 00 00 2C 02 16 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 85 0F 00 00 16 07 08 05 9A 01 66 76 00 00 2C 03 16 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 0D 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 84 0F 00 00 16 07 6B 07 97 1B C1 30 00 00 00 00 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 25 16 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 87 0F 00 00 16 07 CE 09 97 1B C1 30 00 00 00 00 00 00 35 77 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 25 16 A1 1A 26 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 76 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 02 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 75 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 03 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 73 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 07 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 72 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 25 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 74 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 00 16 A1 1A 2C 0C 35 CE 0D 00 00 D5 0D 00 00 00 01 48 BB 77 00 00 35 78 0E 00 00 7A 0E 00 00 00 00 10 35 D3 0D 00 00 D5 0D 00 00 00 00 48 BB 77 00 00 01 86 0F 00 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 0B 0B 0B 0B 0B 0B 0B 04 0B 53 Decompiled code for this function, for those that are interested:simulated function ModifyStatsByDifficulty(out TCharacter kCharacter){ // End:0x284 if(m_iDifficulty == 2) { kCharacter.aStats[1] += BalanceMods_Hard[kCharacter.iType].iAim; kCharacter.aStats[2] += BalanceMods_Hard[kCharacter.iType].iDefense; kCharacter.aStats[3] += BalanceMods_Hard[kCharacter.iType].iMobility; kCharacter.aStats[7] += BalanceMods_Hard[kCharacter.iType].iWill; kCharacter.aStats[13] += BalanceMods_Hard[kCharacter.iType].iCritHit; kCharacter.aStats[0] += BalanceMods_Hard[kCharacter.iType].iHP; kCharacter.aStats[12] += BalanceMods_Hard[kCharacter.iType].iDamage; } // End:0x508 if(m_iDifficulty == 3) { kCharacter.aStats[1] += BalanceMods_Classic[kCharacter.iType].iAim; kCharacter.aStats[2] += BalanceMods_Classic[kCharacter.iType].iDefense; kCharacter.aStats[3] += BalanceMods_Classic[kCharacter.iType].iMobility; kCharacter.aStats[7] += BalanceMods_Classic[kCharacter.iType].iWill; kCharacter.aStats[13] += BalanceMods_Classic[kCharacter.iType].iCritHit; kCharacter.aStats[0] += BalanceMods_Classic[kCharacter.iType].iHP; kCharacter.aStats[12] += BalanceMods_Classic[kCharacter.iType].iDamage; } // End:0x76B if((GenerateArmorFragments(BalanceMods_Easy[kCharacter.iType].iCritHit)) > 0) { kCharacter.aStats[1] += BalanceMods_Easy[kCharacter.iType].iAim; kCharacter.aStats[2] += BalanceMods_Easy[kCharacter.iType].iDefense; kCharacter.aStats[3] += BalanceMods_Easy[kCharacter.iType].iMobility; kCharacter.aStats[7] += BalanceMods_Easy[kCharacter.iType].iWill; kCharacter.aStats[0] += BalanceMods_Easy[kCharacter.iType].iHP; kCharacter.aStats[12] += BalanceMods_Easy[kCharacter.iType].iDamage; } // End:0x9CE if((GenerateArmorFragments(BalanceMods_Normal[kCharacter.iType].iCritHit)) > 0) { kCharacter.aStats[1] += BalanceMods_Normal[kCharacter.iType].iAim; kCharacter.aStats[2] += BalanceMods_Normal[kCharacter.iType].iDefense; kCharacter.aStats[3] += BalanceMods_Normal[kCharacter.iType].iMobility; kCharacter.aStats[7] += BalanceMods_Normal[kCharacter.iType].iWill; kCharacter.aStats[0] += BalanceMods_Normal[kCharacter.iType].iHP; kCharacter.aStats[12] += BalanceMods_Normal[kCharacter.iType].iDamage; } //return; } 3) XcomGame.upk -- re-write XGTacticalGameCore.GenerateArmorFragments as as a helper function to test the day count against a supplied value.original:01 78 00 00 50 55 00 00 00 00 00 00 E8 77 00 00 00 00 00 00 00 00 00 00 EB 77 00 00 00 00 00 00 FB 05 00 00 6C C1 00 00 EC 01 00 00 5C 01 00 00 0F 00 E9 77 00 00 25 04 00 E9 77 00 00 07 D7 01 19 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 0A 00 89 9C 00 00 00 2D 01 89 9C 00 00 05 EB 77 00 00 00 00 EB 77 00 00 0A A7 00 2C 05 0F 00 E9 77 00 00 2C 03 06 4A 01 0A BB 00 2C 06 0F 00 E9 77 00 00 2C 02 06 4A 01 0A CF 00 2C 07 0F 00 E9 77 00 00 2C 05 06 4A 01 0A E3 00 2C 08 0F 00 E9 77 00 00 2C 0A 06 4A 01 0A F7 00 2C 0A 0F 00 E9 77 00 00 2C 06 06 4A 01 0A 0B 01 2C 0B 0F 00 E9 77 00 00 2C 08 06 4A 01 0A 1F 01 2C 0F 0F 00 E9 77 00 00 2C 08 06 4A 01 0A 33 01 2C 10 0F 00 E9 77 00 00 2C 14 06 4A 01 0A 47 01 2C 11 0F 00 E9 77 00 00 2C 02 06 4A 01 0A FF FF 07 5B 01 9A 00 E9 77 00 00 25 16 04 25 A1 00 E9 77 00 00 93 12 20 BC 4D 00 00 33 00 6B 4D 00 00 00 1C 6E 4D 00 00 00 E9 77 00 00 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 91 00 E9 77 00 00 2C 02 16 16 16 07 D7 01 98 00 E9 77 00 00 25 16 0F 00 E9 77 00 00 26 04 00 E9 77 00 00 04 3A EA 77 00 00 53 new :01 78 00 00 50 55 00 00 00 00 00 00 E8 77 00 00 00 00 00 00 00 00 00 00 EB 77 00 00 00 00 00 00 FB 05 00 00 6C C1 00 00 A8 01 00 00 5C 01 00 00 07 11 00 9A 00 EB 77 00 00 25 16 04 25 07 E2 00 77 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 2A 16 07 E2 00 97 19 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 0C 00 CF 9D 00 00 00 1B 3E 67 00 00 00 00 00 00 26 16 00 EB 77 00 00 16 04 26 04 25 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53 And here is the decompiled code for those that are interested:simulated function int GenerateArmorFragments(int iCharType){ local int iFragments; // End:0x11 if(iCharType == 0) { return 0; } // End:0xE2 if(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle != none) { // End:0xE2 if(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle.STAT_GetStat(1) > iCharType) { return 1; } } return 0; //return; } For the sake of completeness, here is the entire listing of BalanceMods that are affected by this Mod:(they are all set to the zero default case -- no stat adjustments, and iCritHit = 0 so nothing will be applied)BalanceMods_Easy=(eType=eChar_None, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Civilian, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Soldier, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Tank, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Sectoid, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Floater, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Thinman, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Muton, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Cyberdisc, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_SectoidCommander, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_FloaterHeavy, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_MutonElite, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Ethereal, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Chryssalid, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Zombie, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_MutonBerserker, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Sectopod, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Drone, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_Outsider, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_EtherealUber, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Easy=(eType=eChar_BattleScanner, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0) BalanceMods_Normal=(eType=eChar_None, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Civilian, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Soldier, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Tank, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Sectoid, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Floater, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Thinman, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Muton, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Cyberdisc, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_SectoidCommander, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_FloaterHeavy, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_MutonElite, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Ethereal, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Chryssalid, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Zombie, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_MutonBerserker, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Sectopod, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Drone, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_Outsider, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_EtherealUber, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0)BalanceMods_Normal=(eType=eChar_BattleScanner, iDamage=0, iCritHit=0,iAim=0,iDefense=0,iHP=0, iMobility=0,iWill=0) Link to comment Share on other sites More sharing options...
johnnylump Posted April 11, 2013 Share Posted April 11, 2013 Well done, and congrats. Link to comment Share on other sites More sharing options...
anUser Posted April 12, 2013 Share Posted April 12, 2013 Excellent, and pretty compact for what it does. I've noticed iWill is unused - at least I don't plan to use it. Any chances to make it set regeneration rate? Honestly I don't recall what was the final shape of your regeneration mod, if it wasn't ini set this may be a good place. Otherwise ¿compatibility? Link to comment Share on other sites More sharing options...
Amineri Posted April 12, 2013 Author Share Posted April 12, 2013 Excellent, and pretty compact for what it does. I've noticed iWill is unused - at least I don't plan to use it. Any chances to make it set regeneration rate? Honestly I don't recall what was the final shape of your regeneration mod, if it wasn't ini set this may be a good place. Otherwise ¿compatibility? Since the needed new conditional statements in the ModifyStatsForDifficulty based on time passed were larger than the previous switch/case construction, I didn't have enough room to set all seven variables and use a different variable for the time. However, dropping the assignments for the seventh variable freed up enough room, so that the 7th could be used as the time trigger variable (thus allowing each unit's upgrade time to be configured separately). I debated with myself about which of the 7 variables was "least important" to upgrade. The variable in question are : iDamage, iCritHit, iAim, iDefense, iHP, iMobility,iWill I grouped them thus:Group 1 : Enable aliens to kill better: iDamage, iAim, iCritHit Group 2: Enable aliens to survive damage better: iDefense, iHP Remaining were iMobility and iWill. IMobility provides a unique capability, useful for both attack and defense, and particularly for melee units, so I thought it should be kept. I seriously considered not keeping iWill. Aliens don't take panic tests, after all. However, iWill is used for psionics -- both on attack and defense. In the later game, many aliens are too easy to MindFray or even Mind Control. Since the iWill stat is the only one that provides defense against psionics, I thought it important to leave it in Since there were three stats that enabled aliens to do more damage, I decided to use one of those -- and iCritHit is the least consistent way for aliens to deal damage. ------------------------------------------------------ Regarding the regeneration. My early attempt at regeneration had the unfortunate side effect of putting nearly everyone on the map under the effect of Holo Targetting. I believe the current version of regeneration going into Long War is hard coded into XGUnit.UpdateEquipment function called from XGUnit.BeginTurn (it only goes through and updates the overheat variables for all weapons). I never did create a version that updated regen based on time / DGC.ini config. The feedback I got prompted me to think a bit more about what exactly I was attempting to do. Is it preferable to turn iWill into regeneration amount? Should another variable be used? These are the things I wrestle with, andI can't predict all of the uses to which people will put the mod (nor do I want to) ^_^. There is a variable in the TCharacter structure that I am fairly confident is not being used -- the aStats[4] element, which is eStat_Strength. Additionally, I am hopeful that the eStat_Psi (5) and eStat_PsiDefense (6) are not being used. Everywhere I see contested will tests for Psionics is just based on Will vs Will. Definitely the BalanceMod_XXX entries are the easiest access way to set these various stats. If I can get some sort of consensus about which of the "standard seven" don't need to be used for upgrading variables (and if there are two freed), then I can use those two to set the Strength and Psi stats of units. Then DR and Regeneration per unit can be pulled from the character stats. Here are the options:1) Keep as defined in first post2) Change iWill to set regeneration (this could be for the classic/impossible difficulty as well as the time-based upgrades)3) Do (2), and also free another variable and use it to set DR4) Use iWill to set regen, iCritHit to set DR, and some other non-alien-type config variable (like the FundingAmount for Sweden and Ireland) to set the upgrade times, which would be common for all units5) Do something more difficult to manipulate, such as byte-packing the DR and regen on top of iWill (e.g. var iWill = 65536*(DR) + 256*(regen) + Will) 6) Something more off-the-wall, such as using the Elerium and Alloys fields in the BalanceItem DGC.ini entries for corpses to import the regen and DR data.7) Something even zanier (still TBD) As you see I have lots of ideas, and they haven't settled yet. I guess I could list the requirements as I see them:1) Ability to enter starting Regen and DR amounts for each alien2) Ability upgrade Regen and DR amounts for each alien, at least once, and preferably twice3) Ability to modify via DGC.ini rather than hex upk changes I definitely have not forgotten about setting the DR and regen through the DGC.ini. I guess I just thought that this tied up nicely as a little standalone modlet (and only requires three hex changes, to boot!) Link to comment Share on other sites More sharing options...
johnnylump Posted April 12, 2013 Share Posted April 12, 2013 (edited) Working off Amineri's template and ideas, I've got a hard coded regeneration function that only requires editing a single function (the useless UpdateEquipment). It's already called from an existing function, so it's good to go. (It does require you also employ Aminieri's change to GenerateOpName() to get the day value into the tactical game. It has limits: Essentially there's space to give four aliens regeneration abilities, and one time-related conditional for some or all of them. AND two of the aliens need to have the same regeneration-per-turn because of space limitations. To wit:- Outsiders, 3-5 Regen/turn- Muton Elite: 4-6 Regen/turn- if Day > 180, Chyrsallids and Thin Men Regen 4-6 per turn You can easily change the day value, the alien type, and the regeneration values. You can also easily change the randomizer (currently 0 to 2) I can post the hex here, if you like. Edited April 12, 2013 by johnnylump Link to comment Share on other sites More sharing options...
anUser Posted April 12, 2013 Share Posted April 12, 2013 (edited) Rather than the hex code I'd like to see the decompiled function for this hard-coded regeneration mod, if you'd pleaseCan you guys plz post the decompiled GenerateOpName function? I understand an optimal solution would be if all this tweaks could be set in the ini. Looking at the code in ModifyStatsByDifficulty it seems you could save 6 bytes making the iCritHit check an implicit cast to bool, it should work without conversion, but that ptobably won't solve the space issues. Maybe we could get rid of an(other) entire level of difficulty, and just leave Classic as default (no stats adjustment) plus Impossible (using ini stats adjustment). It could be done so one of those stats now unused from Classic sets when first and second changes applies to that alien and DR + regeneration, and thus keeping all the original stats for every alien. In the end ppl who want to make aliens thoughter already play Classic or Impossible, so the only difference is that there wouldn't be any difficulty level below. Do you think that's possible? Edited April 12, 2013 by anUser Link to comment Share on other sites More sharing options...
johnnylump Posted April 12, 2013 Share Posted April 12, 2013 function UpdateEquipment() { local XGInventory kInventory; local XGWeapon kWeapon; local int I; I = 0; // End:0x2A if(GetPawnType() == 43) { I = 3; } // End:0x49 if(GetPawnType() == 33) { I = 4; } // End:0xE6 if(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle.STAT_GetStat(1) >= 180) { // End:0xE6 if((GetPawnType() == 39) || (GetPawnType() == 35)) { I = 4; } } // End:0x12A if(I > 0) { SetUnitHP(Min(((GetUnitHP()) + I) + Rand(3), GetUnitMaxHP())); } //return; } Regen code Link to comment Share on other sites More sharing options...
anUser Posted April 12, 2013 Share Posted April 12, 2013 Thanks! That long check is scarying, but I've just found a very similar call :) I'll give it a try soon. Btw it seems that with a Switch GetPawnType you could add more aliens... just in case you wanted to add more Link to comment Share on other sites More sharing options...
Amineri Posted April 12, 2013 Author Share Posted April 12, 2013 Rather than the hex code I'd like to see the decompiled function for this hard-coded regeneration mod, if you'd pleaseCan you guys plz post the decompiled GenerateOpName function? Sure thing! The GenerateOpName change is actually very small. It's kind of jujitsu-like hex-code change, using the minimal amount of change to get the game to do something. protected function string GenerateOpName(optional bool bTutorial){ local XGParamTag kTag; bTutorial = false; // End:0x22 if(m_iMissionType == 8) { return m_strOpAvenger; } // End:0x15B else { kTag = XGParamTag(XComEngine(class'Engine'.static.GetEngine()).LocalizeContext.FindTag("XGParam")); STAT_SetStat(1, Game().GetDays()); kTag.StrValue0 = m_aFirstOpName[Rand(53)]; kTag.StrValue1 = m_aSecondOpName[Rand(76)]; return class'XComLocalizer'.static.ExpandString(m_strOpRandom); } //return ReturnValue; } The only change from the original was (a) removing a small segment of code relating to automatically picking the mission name for CONTROLLED missions (b) add in a call to the existing function: STAT_SetStat(1, Game().GetDays()); This hooks into the Recap Stats that the game manages (they are the stats that show up at the end of the game). The game already shuttles the recap stats back and forth from strategy to tactical -- some recap stats are generated in the tactical game (e.g. how many one shot kills you've made), while some are in strategy (e.g. how long until first lab is built). RecapStat 1 -IS- the number of days elapsed. Normally it is only set at the very end of the game, using the exact same call as here. I simply keep updating the Recap stat earlier (every time a mission is generated, which causes a name to be generated, in this case). This makes the RecapStat be a non-zero number, and it is available via the existing functions to get/set/add-to RecapStats available in the tactical game. This is a very simple way to get the day-count over to the tactical game -- I almost cried when I found it. But it's a little subtle -- it uses a lot of existing game functionality to make it work. Link to comment Share on other sites More sharing options...
Amineri Posted April 12, 2013 Author Share Posted April 12, 2013 Maybe we could get rid of an(other) entire level of difficulty, and just leave Classic as default (no stats adjustment) plus Impossible (using ini stats adjustment). It could be done so one of those stats now unused from Classic sets when first and second changes applies to that alien and DR + regeneration, and thus keeping all the original stats for every alien. In the end ppl who want to make aliens thoughter already play Classic or Impossible, so the only difference is that there wouldn't be any difficulty level below. Do you think that's possible? This is definitely possible. The modder could directly edit the Characters=(iType=eChar_Thinman,HP=4,Offense= ...lines to make their desired stats for Classic, which would also apply to Normal and Easy. The other 'cheats' for Easy and Normal would still apply. This would allow one delta difficulty to be applied via the BalanceMods_Classic set of data. (as you can see in ModifyStatsByDifficulty, the BalanceMods_Classic is the hardest difficult (i.e. Impossible), and BalanceMods_Hard is the 2nd hardest (i.e. Classic) ) This would free up two things:1) 7 integer values per unit-type in the DGC.ini2) approximately 1/4 of the hex code in ModifyStatsByDifficulty The list of values desired would be:for each of regen / DR:1) starting amount2) Day / delta pairs Using a straightforward approach, I could have a starting amount, and one dynamic upgrade possible for each of DR/regen, for each unit-type. Alternative, if I byte-pack them in, I could have ... well .... a LOT of them in theory. Day can go over 255, so requires 2 bytes, but DR and Regen need only 1 byte. There are 28 bytes (7*4), 2 are used for starting amount, leaving 26. Each Day/delta pair requires 3 bytes, so up to 8 such pairs could be squeezed in -- allowing 4 upgrades each for DR/regen (though it would be a mess). If I limit to two values per integer, then one integer could byte-pack both the starting regen/DR, and the remaining six integers could each hold a byte-packed Day/delta pair, thus allowing three upgrade points. The downside to byte-packing is two-fold:1) It requires a bit more work to modify the DGC.ini file2) It requires more hex bytes to extract each value -- an extra 4 bytes, specifically (this might be more of an issue with the space limitations in ModifyStatsByDifficulty) To byte-pack a day/delta pair, I'd specify something like:Value = 256*DayCount + DR/regen amount An example with numbers:Suppose you wanted regen 3 applied after 180 days. The value to set would be 180*256 + 3 = 46083.This is much more clear in hex code -- 256 = 0x100 in hex. The desired value is 180 = 0xB4 in hex. Then the value to set would be B4*100+3 = B403. However, the DGC.ini data is entered in decimal :smile: To extract byte-packed data (especially with only two values it's more straightfoward).To get the low byte: value = 0xFF & input_integer. The & operator is the Bitwise AND (9C is the hex code for it) (see http://en.wikipedia.org/wiki/Bitwise_operation if you're not familiar)To get the high byte: value = input_integer >> 8. The >> operator is the Bitshift left (95 is the hex code for it) Each of the low-byte/high-byte operations adds 4 hex code file-bytes to retrieve the value (operator, execution, and 2 for the integer byte). ------------------------------------------------------------- Here is how I would organize it for byte-packed:starting stats:iHP = 256*starting_regen + starting_DR dynamic regen upgrades:iDamage= 256*day1_delta + delta_regen1iCritHit= 256*day2_delta + delta_regen2iAim= 256*day3_delta + delta_regen3 dynamic DR upgrades:iDamage= 256*day1_delta+ delta_DR1iCritHit= 256*day2_delta+ delta_DR2iAim= 256*day3_delta + delta_DR3 ----------------------------------------------------------- Here is how I would organize it for "regular" (i.e. non-byte-packed) regen:iDamage= starting_regeniCritHit= day_delta_regeniAim= delta_regen DR:iDefense= starting_DRiHP= day_delta_DRiMobility= delta_DR ----------------------------------------------------------- Anyhow ... three upgrade possibilities is better than one, but is it enough better to justify the extra complication of byte-packing? Feedback, please! Link to comment Share on other sites More sharing options...
Recommended Posts