Monday, April 23, 2012

[SC2] Built in Mod Manager?

Supreme Commander allows you to change from SupCom 2 to SupCom2 DLC1 right in the start screen. Can we tap into that?
I mean how do I add another option after DLC 1 to turn another DLC on?
Anyone looked into this?
Note: I realized if you are modding the original units you wouldn't want to use the same system as the DLC1, so this probably doesn't apply to us. :P
It would still be interesting code to investigate and might have some easter eggs.|||Bastilean|||I *think* the lobby chat functions are still done in Lua (the file that handles them is actually processed both at the main menu and when in game). If we can pass a list of mods to load then we could write a mod-support mod.
Problem is that I don't have anyone to test with, nor would I be willing to buy a second copy of the game.
[PS:] If you put mods into the Sim's __active_mods table as soon as SimInit.lua is run, you can still load mods. The trick is putting mods into that table from the Lobby - which is something the engine does.
IINM, we can read and write files in Sup2 now as well. My idea is that if the host's lobby can send a message to client lobbies, and have them write a list of mods to file, then we can read that file from the Sim when the game starts.|||Loading up multiplayer (not skirmish) while having Revamp installed gives a pop-up that says "mod_detected_warning". Multiplayer obviously still works so there is some kind of mod manager code actively floating around.
But the way mod support in general has been implemented (at least for GPG's purposes) is a bit weird. There are "mod" folders in each of bp.scd, lua.scd, z_dlc1.scd, z_lua_dlc1.scd (all populated with DLC1 stuff). But the Revamp mod has it's own Revamp_Expansion.scd as well, which seems to invoke the "mod_detected_warning".
liveordie: out of curiosity, have you tried to make Revamp follow the "mods" folder structure in the above scd's?|||The mod_detected_warning is nothing more than a mismatch between the *.scd files and the *.enc files.
It's not a mod manager per-say at all. Since the Sim blindly processes all mods that it's told to on blind faith that other Sims will do the same, it relies on the manager to vet what mods everyone has. I expect that if people have two different mods installed, the mod_detected_warning will fire, the game will launch then desync because the mods are different.|||BulletMagnet|||This is why my mod doesnt trigger mod_detected warning =)
BillGates checked for me if this could be done, but his conclusion was indeed that its impossbile/hardcoded.|||Yeah, the engine itself is what handles shadowing etc. You could make a mod folder, have it mounted, insert a mod_info.lua table for it into __active_mods at the beginning of SimInit, but ultimately the engine would ignore your shadow folder, and you wouldn't be able to do anything more than blueprint mods with it anyway.
I haven't looked at the remaining lobby code in depth, but there isn't much of it left, and I'm quite sure that it does not pass an __active_mods to the engine like the FA/Demigod lobbies did. In fact, the game no longer does RuleInit states in the lobby at all, waiting until launch to pre-load blueprints etc, so the only lua state you'd have access to in the lobby is a really limited, probably user-layer state that handles chat and such (as BulletMagnet pointed out).

No comments:

Post a Comment