I've been trying to find the values, but no way to get it.
For some reason this game make the CE freezer after unknown value search, so i can't script the way i want.
I may try some other methods, i would be glad to get some advices on unity engine.
I managed to do free buyout with coin with dnSpy ILcode edit by replacing the cost with FixedPoint.Zero.
the number of coins in game is a struct with a int value inside and a bunch of other stuff like overriden math operators, it is possible to simply replace the struct instead of doing math over the same 'int' address, especially if it involves zero.
In my case value -= cost should be inplace, but if I simply AOB on that minus OP, it's inside FixedPoint's 'minus' function, not the 'buyout' function which is one layer out in the call stack.
Also it seems the game uses a separate process(or thread?) to run logic like on a game server.
check this place if you are interested:
buyout with coins:
Amplitude.Mercury.firstpass.dll
namespace Amplitude.Mercury.Simulation
internal class DepartmentOfIndustry : Agency, ISerializable
private void ProcessOrderBuyoutConstructionAt(OrderBuyoutConstructionAt order)
population+1 in settlement when disbanding troops:
internal class DepartmentOfDefense : Agency, ISerializable
private void ProcessOrderDisbandUnits(OrderDisbandUnits order)
Sorry I don't know much English, but the money in this game can be hacked when searching for an integer of 4 bytes. The number of money you need to multiply by 1000 and search in the range. I got that the game value is 912 money, and the addresses are 912153. And even after weeding out, I got that 7 addresses are responsible for this. But I checked it out late in the game in the saves.
I hope this helps someone, and if I understand correctly from the Fixed Point function, this should work for everything else!
Every value is a 4byte multiplied by 1000, including research values(though my search ended up with a different value per each time I changed research project).
If someone knowing how to do tables could tackle this...be much appreciated?