Multiple Game Modes in a Single Mod...
Soul_Rider
Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
in Modding
Is it more hassle than it should be to run Multiple Game Modes in a single mod?
I am having problems with conflicting files. I have one set of files for the first game mode, but almost everyone of the files needs editing again for the 2nd game mode. This is a source of great frustration.
Sure, subclassing some files is ok, and resolves a lot of issues, but I am changing files like HealSprayMixin, Spit, between each mod, so in essence I am having to create 2 separate mods in the same package. The code is confused about the gamerules, as 2 gamerules files are loaded at launch, so things like GetGamerules() don't return the expected results. It is a pain.
Does anyone have any suggestions or ideas? Especially as I have a 3rd game mode planned for the same mod... I really don't want to have to break the playerbase by running 2 separate mods, that would be heartbreaking :(
I am having problems with conflicting files. I have one set of files for the first game mode, but almost everyone of the files needs editing again for the 2nd game mode. This is a source of great frustration.
Sure, subclassing some files is ok, and resolves a lot of issues, but I am changing files like HealSprayMixin, Spit, between each mod, so in essence I am having to create 2 separate mods in the same package. The code is confused about the gamerules, as 2 gamerules files are loaded at launch, so things like GetGamerules() don't return the expected results. It is a pain.
Does anyone have any suggestions or ideas? Especially as I have a 3rd game mode planned for the same mod... I really don't want to have to break the playerbase by running 2 separate mods, that would be heartbreaking :(
Comments
What we did was to have it so on StartWorld the server works out whether to run Combat or not based on the saved state from the previous game and loads one set of files. When the client loads it receives a network message from the server on connect that tells it to load the relevant Game Mode files. If you want to go from a Build mode to a Fight mode you can either do this kind of switching between entire codebases or it might be easier to just have a global enum GameMode.Build / GameMode.Fight that you use to specialise the behaviour as required.
I think we will use this if we ever get around to implementing different game types inside Combat (capture the flag, king of the hill etc).
What we did was to have it so on StartWorld the server works out whether to run Combat or not based on the saved state from the previous game and loads one set of files. When the client loads it receives a network message from the server on connect that tells it to load the relevant Game Mode files. If you want to go from a Build mode to a Fight mode you can either do this kind of switching between entire codebases or it might be easier to just have a global enum GameMode.Build / GameMode.Fight that you use to specialise the behaviour as required.
I think we will use this if we ever get around to implementing different game types inside Combat (capture the flag, king of the hill etc).<!--QuoteEnd--></div><!--QuoteEEnd-->
If you figure it out before me, I'll put the code into Proving Grounds..