Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a DLCInfo loadorder system #511

Closed
Musashi1584 opened this issue May 9, 2019 · 7 comments
Closed

Create a DLCInfo loadorder system #511

Musashi1584 opened this issue May 9, 2019 · 7 comments
Labels
needs-docs Needs documentation

Comments

@Musashi1584
Copy link
Contributor

By adding

function array<string> GetRunBeforeDLCIdentifiers();
function array<string> GetRunAfterDLCIdentifiers();

we create directed acyclic graph (dag) of mod dependencies.

Implement in a mod it would look like

[ModPackage.X2DownloadableContentInfo_MyMod]

DLCIdentifier="MyMod"
+RunBefore="OtherMod"
+RunAfter="AnotherMod"
class X2DownloadableContentInfo_MyMod extends X2DownloadableContentInfo config(ModConfig);
var config array<string> RunBefore;
var config array<string> RunAfter;

function array<string> GetRunBeforeDLCIdentifiers()
{
	return default.RunBefore;
}

function array<string> GetRunAfterDLCIdentifiers()
{
	return default.RunAfter;
}

With subclassing XComOnlineEventMgr and intercepting GetDLCInfos it is possible to reorder the dag of DLCInfo classes using topological sorting.

This results effectively in a order control for dlcinfo hooks like OnPostTemplatesCreated.

@Xymanek
Copy link
Member

Xymanek commented May 9, 2019

With subclassing XComOnlineEventMgr

This is effectively an MCO, which CHL is supposed to avoid. Is this something we are willing to break in this case?

@Musashi1584
Copy link
Contributor Author

not really, its implemented by

XComEngine

defaultproperties
{
	OnlineEventMgrClassName = "XComGame.CHOnlineEventMgr"
}

@Xymanek
Copy link
Member

Xymanek commented May 9, 2019

This is still a class-level replacement, effectively an MCO, regadless of how it's implemented. If there is another mod out there that MCOs XComOnlineEventMgr, it will break

@robojumper
Copy link
Member

This results effectively in a order control for dlcinfo hooks like OnPostTemplatesCreated.

Native to native function calls cannot be intercepted by script. This would work for all non-native hooks, but we can change the order there without creating a new OnlineEventMgr already. Maybe investigate whether the OnlineEventManager maintains an array of X2DownloadableContentInfo objects you can sort, and whether we have a good place to do it (after bootstrapping the OnlineEventMgr, before creating templates)?

@Musashi1584
Copy link
Contributor Author

Lets take this to the discord guys.

@Xymanek
Copy link
Member

Xymanek commented May 9, 2019

Relevant note: I've tried to MCO RedScreenManager but it wouldn't work, suggesting that MCOs may not work during engine init. If we confirm that it's the case indeed (for online event manager at least) then this concern can be rescinded

Musashi1584 added a commit to Musashi1584/X2WOTCCommunityHighlander that referenced this issue May 9, 2019
Musashi1584 added a commit to Musashi1584/X2WOTCCommunityHighlander that referenced this issue May 9, 2019
Musashi1584 added a commit to Musashi1584/X2WOTCCommunityHighlander that referenced this issue Jun 4, 2019
Musashi1584 added a commit to Musashi1584/X2WOTCCommunityHighlander that referenced this issue Jun 19, 2019
Musashi1584 added a commit to Musashi1584/X2WOTCCommunityHighlander that referenced this issue Jun 20, 2019
Musashi1584 added a commit that referenced this issue Jun 21, 2019
Musashi1584 added a commit that referenced this issue Jun 27, 2019
@Xymanek
Copy link
Member

Xymanek commented Dec 11, 2019

Why is this still open?

@robojumper robojumper added the needs-docs Needs documentation label Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-docs Needs documentation
Projects
None yet
Development

No branches or pull requests

3 participants