Wie man eine modinfo schreibt:
ModManager fileformat specifications
Um die API zu nutzen:
Wie gesagt, die Dokumentation liegt unter dem API Button im Info Tab im ModManager.
Nur ist die Funktion leider gerade kaputt, daher hier nun ein Auszug.
Bevor hier jemand meckert, die API Dokumentation wird automatisch erstellt, daher gibt es keine Dokumentation im klassischen Sinne.
In einer environment.script
Code
if (defined MAIN.$modmanager.getAPI) {
$api = MAIN.$modmanager.getAPI(2, "yourmodid");
if (!$api) {
// API Version not found
} else {
// API Version found, start hooking here.
}
}
Code
================================================
API Version 2
================================================
// Check if modid is active
// Returns: true/false
function mod_isactive($modid)
// Get the path of an active mod
// Returns: string or false
function mod_getPath($modid)
// Hook API
//
// Start any hooking with the function hooks_start(),
// this will remove any previous modification done by your modid in CIM.
// Notice, files already loaded won't be affected.
//
// After all modifications are requested, call the function hooks_write()
// If any modification failed since start, all these modifications will be reverted.
//
// If a mod gets unloaded, MM will revert all changes.
//
//
//
// Start hooking files (removes any previous hooks by your modid)
// Returns: -
function hooks_start()
// must be called when hooks should be written
// Returns: false on error
function hooks_write()
// Adds a hook to filename:
// In:
// filename
// placement 0: replace, -1: before, 1: after
// search string to search
// newdata data to insert/replace
// count how many times to apply the hook
// skip skip that many times before applying
//
// Returns: false on error
function hook_add($filename, $placement, $searchdata, $newdata, $count, $skip = 0)
// Replaces in filename olddata with newdata
// Returns: false on error
function hook_replace($filename, $olddata, $newdata)
// Addes newdata after searchdata in filename
// Returns: false on error
function hook_after($filename, $searchdata, $newdata)
// Addes newdata infront of searchdata in filename
// Returns: false on error
function hook_before($filename, $searchdata, $newdata)
// Rollbacks any changes made by your modid
// Returns: -
function hook_rollback()
Alles anzeigen
Wie gesagt, man muss etwas Ahnung von Programmieren haben. Die Beste Möglichkeit ist ein Tool wie WinMerge oder ähnliches zu nutzen, jede Änderung zu analysieren und dann den jeweiligen Code Block schreiben.