-
Notifications
You must be signed in to change notification settings - Fork 16
Guide: Uploading Mods
There are two pieces of data that need to be sent via the mod.io API when uploading a mod; the Mod Profile, and the Modfile data. The Mod Profile represents all of the information that is presented to a player looking to download a mod such as the name, any associated imagery, and a description. The Modfile represents the information connected with a specific release, such as the version number, the change log, and includes a download link for the Modfile data.
Create or load an EditableModProfile object with the creator provided information, ensuring to note that each field with a submitted value has .isDirty
set to true
. (The uploading functionality provided by ModManager will ignore any fields where .isDirty
is left set to false
.)
// --- Submitting a new Mod Profile to the server ---
var newModProfile = new EditableModProfile();
newModProfile.name.value = "Example Mod";
newModProfile.name.isDirty = true;
newModProfile.summary.value = "This mod is an example";
newModProfile.summary.isDirty = true;
newModProfile.logoLocator.value = new ImageLocatorData()
{
fileName = "Example Logo",
url = @"C:/ExampleModLogo.png",
};
newModProfile.logoLocator.isDirty = true;
newModProfile.tags.value = new string[] { "Weapon", "Hunter" };
newModProfile.tags.isDirty = true;
ModManager.SubmitNewMod(newModProfile,
(confirmedProfile) => OnSuccess(confirmedProfile),
(error) => WebRequestError.LogAsWarning(error));
// --- Updating an existing Mod Profile ---
var modProfileChanges = EditableModProfile.CreateFromProfile(existingModProfile);
modProfileChanges.visibility.value = ModVisibility.Hidden;
modProfileChanges.visibility.isDirty = true;
ModManager.SubmitModChanges(existingModProfile.id,
modProfileChanges,
(confirmedProfile) => OnSuccess(confirmedProfile),
(error) => WebRequestError.LogAsWarning(error));
Once a Mod Profile exists on the mod.io servers, a release can be added to it.
Create a new EditableModfile object with the creator provided information, ensuring to note that each field with a submitted value has .isDirty
set to true
. (The uploading functionality provided by ModManager will ignore any fields where .isDirty
is left set to false
.)
Note: Mod releases cannot be changed once uploaded. Uploading a new Modfile with the setActiveBuild
parameter as true will request all subscribed players to download the new Modfile.
// --- Submit a new release ---
EditableModfile modReleaseInformation = new EditableModfile();
modReleaseInformation.version.value = "1.2.0";
modReleaseInformation.version.isDirty = true;
modReleaseInformation.changelog.value = "Changes were made!";
modReleaseInformation.changelog.isDirty = true;
modReleaseInformation.metadataBlob.value = "Some game-specific metadata";
modReleaseInformation.metadataBlob.isDirty = true;
ModManager.UploadModBinaryDirectory(existingModProfile.id,
modReleaseInformation,
@"C:/ModReleaseDirectory",
true, // set as the current build
(confirmedModfile) => OnUploaded(confirmedModfile),
(error) => WebRequestError.LogAsWarning(error));