So, I spent more hours than I'd like to admit understanding the dub code and where I need to put stuff etc.

Anyway, it turned out to be MUCH simpler than I thought it would be to do this.

I simply have a new function in init.d that simply gets the versions for each of the strings in deps, if it doesnt exist on code.dlang.org it ignores it.

It then calls writePackageJson as dub always has.

void initMultiDepPackage(Path root_path, string[] deps){
	//import std.stdio;
	import dub.packagesupplier : RegistryPackageSupplier;

	string[string] depVers;
	auto ps = new RegistryPackageSupplier(URL.parse("http://code.dlang.org/")); // hacky, need to get Dub's Package Supplier service, will work better
	logDebug("Searching server for latest versions for %s", deps);
	foreach(dep; deps){
		try{
			auto versionStrings = ps.getVersions(dep);
			depVers[dep] = versionStrings[$-1].toString;
		} catch(Exception e){
			logError("Error, no package %s found", dep);
			logError(e.msg);
		}
	}
	logDebug("Dependancy Versions: %s", depVers);
	writePackageJson(root_path, "A D application", depVers); // same as usual
	createDirectory(root_path ~ "source");
	write((root_path ~ "source/app.d").toNativeString(),
q{import std.stdio;

	void main()
	{
		writeln("Edit source/app.d to start your project.");
	}
});
}

Two other changes are required in commandline.d and dub.d, both are minor (calling the new function basically)

Have done some minor testing, seems to work pretty well. Will spend more time at it tomorrow to test properly and iron out some things.