Skip to content

WCSharp.W3MMD

Orden4 edited this page Oct 12, 2023 · 2 revisions

This is a port of W3MMD for C#, a standard for storing game metadata into replay files, which parsers can then utilise in order to display relevant or interesting information about what happened during the game.

Other sources of information on W3MMD:

This C# port works largely the same as the vJass and TypeScript versions. Using the W3Mmd class, you can create events, variables, set player flags and emit custom events. You can find a detailed list of its methods at the automatic documentation.

Example usage:

var killCount = W3Mmd.DefineInt("Total kills", W3MmdGoalType.High, W3MmdSuggestionType.Leaderboard);
var killEvent = W3Mmd.DefineEvent("Kills", "{0} killed {1}", "Killer", "Victim");
PlayerUnitEvents.Register(UnitTypeEvent.Kills, () =>
{
	var killer = GetKillingUnit();
	var victim = GetTriggerUnit();
	killEvent.Emit(GetUnitName(killer), GetUnitName(victim));
	killCount.Add(GetOwningPlayer(killer), 1)
});
Clone this wiki locally