Battletech

Add topics here with methods, analysis, code snippets, mods etc. for a certain game that normally won't make it in the Tables or Requests sections.
EnterpriseNL
Fearless Donors
Fearless Donors
Posts: 124
Joined: Fri Sep 01, 2017 1:35 pm
Reputation: 8

Battletech

Post by EnterpriseNL » Wed May 02, 2018 9:43 pm

[QUOTE="Tetnacious, post: 44347, member: 16879"]To enable debug widget without editing assemblies.



Just edit BattleTech_DataStreamingAssetsdatadebugsettings.json



add

[CODE=json]"testToolsEnabled": true,[/CODE]



Now you can start campaign in debug mode. Which allows you to skip missions, and bring up the debug widget with Ctrl + Shift + Minus.[/QUOTE]





Let me guess, only with a new campaign? tried this with current save and no debug widget, im using gog version

Tetnacious
Noobzor
Noobzor
Posts: 6
Joined: Wed May 02, 2018 7:54 pm
Reputation: 0

Battletech

Post by Tetnacious » Wed May 02, 2018 9:48 pm

No, for existing campaign you'll need to use the assembly hack to force the game to load in debug. But it let's you skip missions, so if you're not too far ahead....

EnterpriseNL
Fearless Donors
Fearless Donors
Posts: 124
Joined: Fri Sep 01, 2017 1:35 pm
Reputation: 8

Battletech

Post by EnterpriseNL » Wed May 02, 2018 11:13 pm

I also did the assembly hack, but no debug widget

Tetnacious
Noobzor
Noobzor
Posts: 6
Joined: Wed May 02, 2018 7:54 pm
Reputation: 0

Battletech

Post by Tetnacious » Thu May 03, 2018 12:52 am

Changing [ICODE]_OnFirstPlayInit(bool skipCampaign, bool allowDebug)[/ICODE] will only work for new campaigns.

Add the MSIL for [ICODE]this.AllowDebug = true;[/ICODE] in [ICODE]_OnInit(GameInstance game)[/ICODE], it's called both for new games and for loaded saves.



The MSIL for the assignment goes:

[CODE]

ldarg.0

ldc.i4.1

stfld bool BattleTech.SimGameState::AllowDebug

[/CODE]



* Tip, dotPeek is extremely useful for poking around assemblies, because it supports VS style code navigation, it's very easy to walk through the code.

[automerge]1525309134[/automerge]

Seems people also found reg keys [URL]https://fearlessrevolution.com/threads/battletech.6603/page-6#post-44348[/URL]
Last edited by Tetnacious on Thu May 03, 2018 12:58 am, edited 2 times in total.

EnterpriseNL
Fearless Donors
Fearless Donors
Posts: 124
Joined: Fri Sep 01, 2017 1:35 pm
Reputation: 8

Battletech

Post by EnterpriseNL » Thu May 03, 2018 1:02 am

[QUOTE="Tetnacious, post: 44393, member: 16879"]Changing [ICODE]_OnFirstPlayInit(bool skipCampaign, bool allowDebug)[/ICODE] will only work for new campaigns.

Add the MSIL for [ICODE]this.AllowDebug = true;[/ICODE] in [ICODE]_OnInit(GameInstance game)[/ICODE], it's called both for new games and for loaded saves.



The MSIL for the assignment goes:

[CODE]

ldarg.0

ldc.i4.1

stfld bool BattleTech.SimGameState::AllowDebug

[/CODE]



* Tip, dotPeek is extremely useful for poking around assemblies, because it supports VS style code navigation, it's very easy to walk through the code.

[automerge]1525309134[/automerge]

Seems people also found reg keys [URL]https://fearlessrevolution.com/threads/battletech.6603/page-6#post-44348[/URL][/QUOTE]



So I need to retrace the steps from

[URL]https://fearlessrevolution.com/threads/battletech.6563/post-44204[/URL]



But add it in _onit instead of onfirstplayinit?





EDIT: It seems not, so some instructions would be nice
Last edited by EnterpriseNL on Thu May 03, 2018 1:12 am, edited 1 time in total.

quidproquo
What is cheating?
What is cheating?
Posts: 4
Joined: Wed May 02, 2018 3:19 am
Reputation: 0

Battletech

Post by quidproquo » Thu May 03, 2018 1:13 am

We should really merge threads with the other Battletech thread. But anyways, maybe our missing step is [URL]https://fearlessrevolution.com/threads/battletech.6563/page-6#post-44393[/URL] and maybe SunBeam in all his tinkering had done something along those lines.

Captain_Shrug
What is cheating?
What is cheating?
Posts: 3
Joined: Thu May 03, 2018 12:34 am
Reputation: 0

Battletech

Post by Captain_Shrug » Thu May 03, 2018 1:21 am

[QUOTE="quidproquo, post: 44400, member: 16853"]We should really merge threads with the other Battletech thread. But anyways, maybe our missing step is [URL]https://fearlessrevolution.com/threads/battletech.6563/page-6#post-44393[/URL] and maybe SunBeam in all his tinkering had done something along those lines.[/QUOTE]



I am so freaking lost in that thread.

quidproquo
What is cheating?
What is cheating?
Posts: 4
Joined: Wed May 02, 2018 3:19 am
Reputation: 0

Battletech

Post by quidproquo » Thu May 03, 2018 1:46 am

On a different point, I tried to compile a list of all the edits I made to .json files which may be helpful. Again, .json files are located in SteamAppscommonBATTLETECHBattleTech_DataStreamingAssetsdata

Keep a backup of your modded files (and original files), because updates will replace them.



in SimGameConstantsSimGameConstants.json

DefaultSystemTravelTime, DefaultFuelTime, FuelStationFuelTime - Days involved in steps to travel, decrease to shorten

MaxJumpDistance - I believe how far the jumpships will go, as in larger number means fewer jumps needed

The whole Finances section if you want to decrease all the different upkeeps (I changed one once)

MaxLevelOneAbilities, MaxLevelTwoAbilities - I only touched this once, but I believe it is able to change the number of level one (lvl 5) and lvl 2 (lvl 9) abilities you get. Will not affect already made/leveled characters. Setting both to 4 should be all that's needed. From reading around, you want to get all the toggled abilities first sensor, multishot, and bulwark, otherwise the passives will take a spot on your bar and you won't be able to get the toggled skills

LethalDamageCost, IncapacitatedDamageCost, BaseInjuryDamageCost - I don't know which one is which, but I took off the zeroes at the end of each one (divided all the values by 10), and all pilot injury recovery times became less than a day. I'm sure changing them to 1 will do the same thing. Will not affect already injured/healing pilots in your save game, as it seems that calculation was already made

StartingCBills, StartingMechTechSkill, StartingMedTechSkill - as the name implies the amount of each when you start a new game.

Mechlab section - modify the Techpoints values to modify how many techpoints they need to complete said task. I was lazy and made everything 0.1, which resulted in all repairs and refits happening instantly. The only thing that took 1 day was pulling a mech from storage. The Cost lines are the c-bills cost of each task, adjust as you see fit (I'm simple, divided by 10)



in abilitiesTraits

TraitDefMinRangeReduce45.json and TraitDefMinRangeReduce90.json change the number after "modValue" to the range you want those talents to reduce minimum range by

TraitDefOverheatAddFifteen.json and TraitDefOverheatAddThirty.json chang the number after "modValue" to the number you want those talents to increase maximum heat limit by

you can do similar things to Evasivecharge, sprintincrease, and unsteady files - too lazy to list them and I didn't change them

I could not figure out how to modify the damage multipliers in the talents. I'm also not sure if they would affect the enemies



in heatsinksGear_HeatSink_Generic_Standard.json to edit the base model heatsinks

DissipationCapacity to change how effective they are - I'm not sure if it affects the opponent, since they are also programmed to not overheat

Tonnage to change the weight (I made mine 0.01)



in weapon

I changed all the tonnage by dividing them all by 100. This made all the weapons really light, so I could put all the weapons I wanted onto mechs. If you have Notepad++, you can edit multiple files at once so you don't have to open all 140+ files individually

Be careful editing the weapons themselves as it does affect the enemy. Changing the weight will not change their loadout (I think they're all stock)



There are a bunch others that you can change, like in upgrades (I did it for cockpitmods) and shipupgrades. But if you just change all your medbay and mechbay stuff, and all the tonnage and heatsinks, you can max out a mech with tons of weight to spare and alpha strike every turn.

Tetnacious
Noobzor
Noobzor
Posts: 6
Joined: Wed May 02, 2018 7:54 pm
Reputation: 0

Battletech

Post by Tetnacious » Thu May 03, 2018 1:55 am

Yes that's what you do.



[B]But [USER=12587]@SunBeam[/USER] also found a registry key you can add which will be a lot easier. [URL]https://fearlessrevolution.com/threads/battletech.6603/page-6#post-44348[/URL][/B]



To change the assembly:



I'm using JustDecompile with Reflexil.



Open JustDecompile.

Install & Load the reflexil plugin from the plugins menu.

Open the Assembly-CSharp.dll

Go to BattleTech -> SimGameState.

Click the _OnInit method.

In the reflexil window at the bottom add these operands at the top.

Add opcode ldarg.0 with no operand.

Add opcode ldc.i4.1 with no operand

Add opcode stfld with operand type field reference,

click the operand box, you'll get a popup, type allowdebug, Select the AllowDebug field and click ok

Then right click the assembly in the tree on the left and save from the reflexil menu.

EnterpriseNL
Fearless Donors
Fearless Donors
Posts: 124
Joined: Fri Sep 01, 2017 1:35 pm
Reputation: 8

Battletech

Post by EnterpriseNL » Thu May 03, 2018 2:25 am

Well, When I do that, the game doesn't even load my save game anymore, just a endless loop

gives me error in console, see txt file

When I put the original assambly back its working again





Also I only have the in battle cheat gui.
Last edited by EnterpriseNL on Thu May 03, 2018 2:32 am, edited 2 times in total.

User avatar
pgain2004
Cheater
Cheater
Posts: 37
Joined: Fri May 05, 2017 3:53 am
Reputation: 2

Battletech

Post by pgain2004 » Thu May 03, 2018 2:52 am

[QUOTE="Saisla, post: 44259, member: 10549"]I little reedited confings from [B][USER=1274]HEROES[/USER] [/B](post #72) and from my last post[B].[/B]

So:

-store will have only ++ and +++ weapons

-store will have ER-type weapons (erppc and others). They dont have a ++ or +++ variants

-store will have gaussrifle with ammo. Dont have ++ and +++ too

-store will have most components and upgrades (including unpurchasable double heatsinks, that now can be buyed)

-store will have most mechs with "cheated" blackknight6B( devs gives him 4 double heatsinks in each leg. Most mechs can have only 1 dhs in leg)



How install ( i have steam version):

1) Put downloaded Data folder in SteamsteamappscommonBATTLETECHBattleTech_DataStreamingAssets

2) Fly to system with "manufacturing"

3) Dont forget to give yourself some money - stuff isnt cheap.[/QUOTE]



You don't need to travel to manufacturing star, just delete the "planet_industry_manufacturing" in RequirementTags. And you need to put upgrades into in "Inventory" instead of "Specials" to make it always purchasable. Besides, your list are so mess up...

Tetnacious
Noobzor
Noobzor
Posts: 6
Joined: Wed May 02, 2018 7:54 pm
Reputation: 0

Battletech

Post by Tetnacious » Thu May 03, 2018 4:33 am

[QUOTE="EnterpriseNL, post: 44410, member: 8239"]Well, When I do that, the game doesn't even load my save game anymore, just a endless loop

gives me error in console, see txt file

When I put the original assambly back its working again





Also I only have the in battle cheat gui.[/QUOTE]



I don't see an ldc.i4.5 opcode in my version (I got it on steam).

Make sure that you changed it correctly, or get a dev with a gog version to do it.

If you're trying to also run cheat engine at the same time, that won't work, changing the assembly will completely scramble the address space.

There shouldn't be any technical problem with adding those lines. Especially with GOG version that should be DRM free. I'll give it a check when I find time.



Can someone upload the GOG dll btw?

cowbot
Noobzor
Noobzor
Posts: 10
Joined: Sat Apr 28, 2018 10:00 am
Reputation: 0

Battletech

Post by cowbot » Thu May 03, 2018 7:21 am

[QUOTE="Tetnacious, post: 44407, member: 16879"]Yes that's what you do.



[B]But [USER=12587]@SunBeam[/USER] also found a registry key you can add which will be a lot easier. [URL]https://fearlessrevolution.com/threads/battletech.6603/page-6#post-44348[/URL][/B]



To change the assembly:



I'm using JustDecompile with Reflexil.



Open JustDecompile.

Install & Load the reflexil plugin from the plugins menu.

Open the Assembly-CSharp.dll

Go to BattleTech -> SimGameState.

Click the _OnInit method.

In the reflexil window at the bottom add these operands at the top.

Add opcode ldarg.0 with no operand.

Add opcode ldc.i4.1 with no operand

Add opcode stfld with operand type field reference,

click the operand box, you'll get a popup, type allowdebug, Select the AllowDebug field and click ok

Then right click the assembly in the tree on the left and save from the reflexil menu.[/QUOTE]



I did the following with dnSpy:

Opened the assembly, added "this.AllowDebug = true;" into SimGameState/_OnInit method.

Now there's a DEBUG button which starts a new campaign in debug mode, but I still can't access the debug widget in my already running campaign.

User avatar
Alaunus
Cheater
Cheater
Posts: 49
Joined: Wed Mar 08, 2017 3:15 pm
Reputation: 5

Battletech

Post by Alaunus » Thu May 03, 2018 8:21 am

[QUOTE="quidproquo, post: 44405, member: 16853"][...]

MaxLevelOneAbilities, MaxLevelTwoAbilities - I only touched this once, but I believe it is able to change the number of level one (lvl 5) and lvl 2 (lvl 9) abilities you get. Will not affect already made/leveled characters. Setting both to 4 should be all that's needed. From reading around, you want to get all the toggled abilities first sensor, multishot, and bulwark, otherwise the passives will take a spot on your bar and you won't be able to get the toggled skills



[...]



in abilitiesTraits

TraitDefMinRangeReduce45.json and TraitDefMinRangeReduce90.json change the number after "modValue" to the range you want those talents to reduce minimum range by

TraitDefOverheatAddFifteen.json and TraitDefOverheatAddThirty.json chang the number after "modValue" to the number you want those talents to increase maximum heat limit by

you can do similar things to Evasivecharge, sprintincrease, and unsteady files - too lazy to list them and I didn't change them

I could not figure out how to modify the damage multipliers in the talents. I'm also not sure if they would [b][u]affect the enemies[/u][/b]



[...][/QUOTE]



Do not touch the trait files especially if you are not sure what they do. Enemies have complete access to those and oh boy do they make use of those 'minor' changes.



The same is true for the abilities. While it looks like an obvious choice to change it turns out to be a trap. The combat part of the game is hard coded to three abilities. And in addition you cannot get a rank 9 ability without having its rank 5 counterpart. So the only change that the game actually allows would be to forfeit one rank 9 ability to get a third rank 5 one which probably is not what you want.

EnterpriseNL
Fearless Donors
Fearless Donors
Posts: 124
Joined: Fri Sep 01, 2017 1:35 pm
Reputation: 8

Battletech

Post by EnterpriseNL » Thu May 03, 2018 12:52 pm

Well im done trying to get the debug widget, will do with the fund/morale CE and in game battle cheat gui

Post Reply

Who is online

Users browsing this forum: No registered users