← Home SEEBIE90 DOCS
Download PDF
No copies or uploads of M.A.W.S. assetsExample code is free to useNo printed reproduction or modification of this documentationSuggestions: Discord to the authorLicense

Sci-Fi Expansion Pack

Extending a mod without touching it

The Sci-Fi Expansion Pack adds an energy shield, a gravity field and more to M.A.W.S. – as a separate add-on that only uses modded class and a few hooks the base mod exposes.

In plain wordsThe add-on changes the base mod's classes from outside (modded class). The base mod keeps a few empty methods ready that the add-on fills in.

View in the Workshop →

M.A.W.S. Sci-Fi Expansion Pack
Sci-Fi Expansion: laser disruptor, AGL40 implosion, gravity distortion, energy shield, EMP rockets, vehicle hackingSci-Fi Expansion: laser disruptor, AGL40 implosion, gravity distortion, energy shield, EMP rockets, vehicle hacking
Three new modules and three systems built into every walker. The AI crew uses all of it.

Systems

How an add-on hooks in

The base mod exposes a small extension singleton with empty virtual methods. The add-on mods that class and overrides only what it needs. Without the add-on, the base mod runs its defaults – no checks, no #ifdef, no load-order tricks.

Example code – free to use
// --- base mod
class MyWalker_Extension
{
	protected static ref MyWalker_Extension s_Instance;

	static MyWalker_Extension Get()
	{
		if (!s_Instance)
			s_Instance = new MyWalker_Extension();	// with an add-on loaded this creates the MODDED class
		return s_Instance;
	}

	//! Damage that reaches the zones after armour. Return what is left.
	float FilterWalkerDamage(MyWalker_DamageModel model, float damage, BaseDamageContext ctx)
	{
		return damage;
	}
}

// --- add-on
modded class MyWalker_Extension
{
	override float FilterWalkerDamage(MyWalker_DamageModel model, float damage, BaseDamageContext ctx)
	{
		damage = super.FilterWalkerDamage(model, damage, ctx);
		return model.MyShield_Absorb(damage, ctx);
	}
}
Notemodded class replaces the class everywhere, including new calls inside the base mod. That is why a plain singleton is enough as an extension point.

State lives where it already replicates

New replicated state is added to components that already exist on the walker (damage model, module manager) via modded class with extra [RplProp] fields. No new components in the base prefab, no prefab edits in the add-on.

Example code on this site is free to use in your own projects (credit appreciated). The M.A.W.S. mods, their code and assets are covered by the M.A.W.S. License – no copies or uploads. This documentation may not be reproduced in print or modified. Suggestions: Discord. Arma Reforger / Enfusion are trademarks of Bohemia Interactive.
Impressum · Privacy Policy