Replacing / Overriding existing model within the CampaignGameStarter

Users who are viewing this thread

erik9631

Recruit
Hello.
I made a mod that allows you to change the number of attribute points and focus points per level. Issue is that currently, I rewrote and recompiled the existing DLL in the game, which I do not want. I want it to fulfill the basic mod structure for compatibility reasons.

I have been going through the game code a lot and I found out that in order to achieve what I want, I need to replace DefaultCharacterDevelopmentModel, extend it by another class and override the properties that return the focus points and attribute points per level - Easy.
The issue is that in the SandBoxManager class there is an OnGameStart method, in which there are various game models added to the campaignGameStarter (Which is a simple list), one of them being the DefaultCharacterDevelopmentModel which I want to replace.

Now I haven't looked at the code long enough to deduce how exactly are the GameModels managed and I would like to ask whether someone has already figured this out.

The question basically falls to two things.
The first thing is, in the MBSubModuleBase (In your mod dll), you can override the OnGameStart, which in fact gives you a gameStarterObject. The question is whether it is a reference to the SAME gameStarterObject that is in the OnGameStart method in the SandBoxManager class, or whether it is different (I have my doubts it is not the same).
In case it is the same, how would the game handle if I passed my own GameModel to the GameStarterObject there would be two, which one would it chose, would it be sufficient to override?
If not then how should I go about overriding the existing GameModel from the mo module? (My current hypothesis is that I would need to remove it during the gameLoad and insert my own but I have not found a way to remove it yet)
 
Back
Top Bottom