I came across the FreeRoamCamera in ILSpy, then right-clicked its name in the source code view and clicked Analyze. This will give you a small tree of what reads or writes to something like a class or one of its fields. I followed the chain all the way back to something I could actually get a reference to, which is App.instance (it is a static field). I added a handy field for Game.instance and App.instance and named them app and game for convenience.
It's interesting that altering the free roam camera's zoom crashes the game, do you have a field named "game"?
Ah, I have been using the "Analyze" function a lot, though it often gives lots of Used Bys... I wasn't sure how you came to determine the link from min-Zoom to App. I'll try and re-trace your steps - npw knowing I am looking for something that is a 'static' field to end up in (public static instance - are the three keywords it seems... Not many of them. App, Game, DesignDataManager, Simulation2D - thats about it)...
The Zoom feature is fine... it's the SpeedMultipliers function that causes the crash.
got 'Game game' in the head and 'game = Game.instance;' in the Awake/[/code]
Edit: I am surprised my determinism hasn't wavered yet.
So as a first go proof of concept, i decided 'I'm gonna change the backstory bonus moral from 0.3f to 0.5f' The original line is in PlayerBackstories. "private readonly float mDriverMoraleModifier = 0.3f;" so not overly disimilar to your MaxZoom code I have working.
Code:
if (state == GameState.Type.FrontendState)
{
PlayerBackStory pbs = game.player.
pbs.GetType()
.GetField("mDriverMoraleModifier", BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(pbs, 0.5f);
}
Is what I have so far... but the "game.player.<missing>" - and in missing, I'd love to put playerBackStory, it doesn't appear thats a valid option.
The process was a little more complex then I thought
Where on earth did you learn all this?
This is a lot of work to just change a few numbers to make the game harder for the player then the AI!
At least the public variables are easy to adjust... but unfortunatly, a lot of those begin their life as private - so I am determined to master this. I'm kinda hoping Crashed isn't too fed up of me already... I am not a very good apprentice.
Wishlist
1/ be able to modify a variety of numbers. (I am not too interested in changing how the game is played, its quite solid - I just want to insert some balance and difficulty)
// Mostly the player only buffs/debuffs. I mostly want to adjust the 'days off bonus' for part creation, and change it to 'days added debuff' - this will let me (elsewhere) shorten the time it takes to make the parts for the AI - so that the player doesn't notice any change in speed of making a part - but the AI will. I want to adjust a x% extra race costs (opposite of financial back story) for harder money management when compared with the AI. A lot of the other AI tweaks, I can do in the Assets.
Other sections I would like to do, are actually not too hard to get to variables... e.g., increase the Red Zome % globally, and part strain.Prevent going into the red by more then $1M instead of $5. etc etc.,Already done the one's I've found.
2/ Be able to modify my modified numbers (with random seeds or difficulty levels - should be easy to do given there's code for a working toggle key, I just have to modify my own modifications with a variable)