XCOM 2
41 ratings
XModBase 2.0 for War of the Chosen (beta)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.065 MB
Sep 8, 2017 @ 12:44am
Apr 30, 2020 @ 4:15am
3 Change Notes ( view )

Subscribe to download
XModBase 2.0 for War of the Chosen (beta)

Description
This has not been extensively tested. Please treat it as beta quality, and report any bugs you find.

XModBase (XMB) is a library for mod authors, designed to make it easier to create interesting and unique perks. It provides a collection of effects and conditions which can be combined to create a huge variety of different perks. It takes care of annoying details like filling out all the boring-but-necessary fields of X2AbilityTemplate, and provides support for localization tags so you can change your abilities' values in one place and have their descriptions update automatically.

FOR PLAYERS

If you're a player, you don't need to worry about XModBase. It's safe to install multiple mods that use XModBase, even if they use different versions.

INSTALLATION

There are two ways of using XMB: one that's easy, and one that's better.

EASY INSTALLATION

Easy installation will make it possible to build and run your mod using XModBase. However, if you publish your mod, your users will need to install XModBase separately.

1. Copy the XModBase mod files to "C:\Program Files (x86)\Steam\SteamApps\common\XCOM 2\XComGame\Mods\XModBase".

2. Copy all the XMB*.uc files from XModBase\Src\XModBase\Classes to your own mod's Classes directory.

3. Add the following lines to your mod's XComEngine.ini. Note that steam adds invisible characters to the end of the line which you must remove if you copy+paste these!

[UnrealEd.EditorEngine]
+ModEditPackages=LW_Tuple
+ModEditPackages=XModBase_Interfaces
+ModEditPackages=XModBase_Core_2_0_2

COMPLETE INSTALLATION

Complete installation will include the XModBase libraries in your mod, so you can publish it without your users needing to install XModBase. Your mod will still be compatible with other mods using XModBase, even mods which have a different version. Users will automatically get the latest version of XModBase from any installed mod.

1. Copy all the XMB*.uc files from XModBase\Src\XModBase\Classes to your own mod's Classes directory.

2. Create new folders under your mod's Src folder so it looks like this:



3. Now, for each of those "Classes" folders, right-click and choose "Add > Existing Item...", then add all of the *.uc files from the corresponding directory in XModBase. You should end up with a Src directory like this:



4. Add the following lines to your mod's XComEngine.ini. Note that steam adds invisible characters to the end of the line which you must remove if you copy+paste these!

[Engine.ScriptPackages]
+NonNativePackages=LW_Tuple
+NonNativePackages=XModBase_Interfaces
+NonNativePackages=XModBase_Core_2_0_2

[UnrealEd.EditorEngine]
+ModEditPackages=LW_Tuple
+ModEditPackages=XModBase_Interfaces
+ModEditPackages=XModBase_Core_2_0_2

USING XMODBASE

First, look in XModBase\Src\XModBase\Classes for Examples.uc. It contains several example abilities built using XModBase classes.

Your ability sets should extend XMBAbility, rather than X2Ability. XMBAbility adds several utility functions and properties to reduce the amount of boilerplate needed when to make a new ability.

The most versatile class in XModBase is XMBEffect_ConditionalBonus. It can provide passive bonuses to attack hit chances, damage, and/or defense. The bonuses can be conditional on hit type, weapon tech level, or any X2Condition - and XModBase includes a number of conditions for common checks. So if you want you can apply a damage bonus on critical hits with the primary weapon, or an increased hit chance against targets at higher elevation, you can.

XModBase provides additional effects that are either commonly useful or hard to do. Here's a list of some of the available effects:

XMBEffect_AbilityCostRefund - Passively refunds ability costs based on conditions
XMBEffect_AddAbilityCharges - Adds extra charges to an ability or abilities
XMBEffect_AddItemChargesBySlot - Adds extra charges to items in certain slots, like Heavy Ordnance but more general
XMBEffect_AddUtilityItem - Adds a bonus utility item that lasts for the duration of the mission then disappears
XMBEffect_BonusDamageByDamageType - Grants bonus damage on attacks and damage-over-time of a specific elemental damage type
XMBEffect_BonusRadius - Increases the radius of grenades of a specific type, or of all grenades
XMBEffect_ChangeHitResultForAttacker -Changes the result of an attack after all other hit calculations
XMBEffect_ConditionalBonus - Grants attack and/or defense bonuses based on conditions
XMBEffect_DoNotConsumeAllPoints - Makes another ability not end the turn when used
XMBEffect_PermanentStatChange - Permanently changes the base stats of a unit
XMBEffect_Extended - Base class for defining your own X2Effects with additional functions to override
XMBEffect_RevealUnit - Makes a unit visible on the map
XMBEffect_ToHitModifierByRange - Modifies to-hit based on range to target and conditions
Popular Discussions View All (1)
10
Oct 22, 2022 @ 1:41am
PINNED: Bug reports
xylthixlm
37 Comments
Hudson Savage Apr 22, 2023 @ 12:03am 
Moders usually integrate XMB into their mods directly, makes it easier on the user's end.
zin Apr 15, 2023 @ 6:56am 
I don’t see any mods that use this. Is there a more updated alternative that other mods use?
Dęąth Viper Apr 23, 2022 @ 7:03pm 
Hi, I am having trouble using this. I get error reports after copyig the files over into the mod. Mind if I add you so you could help me get this straightened out??
Hudson Savage Aug 1, 2021 @ 12:06am 
Not with my previous setups (hundreds of mods)
Joe Marotta Jul 31, 2021 @ 11:16am 
has anyone had any issues with this mod disabling use of PCS's? i easily could have messed things up by adding own abilities (but nothing that changes anything to do with PCS). after removing various mods, i have isolated "insufficient rank for combat sims" to this mod with my own modifications. any help would be appreciated
SentySent Jun 9, 2020 @ 10:09am 
Is it possible to implement rupture damage effect into XMBEffect_ConditionalBonus? And can XMBEffect_ConditionalBonus applied to grenades and heavy weapons?
Drakten Jun 2, 2020 @ 10:24pm 
Hey @xylthixlm having a bit of trouble with the "syntax". This is an ability tied to a melee weapon upgrade, but it doesn't seem to fire: https://pastebin.com/E3CJAZVc

What am I doing wrong exactly?

xylthixlm  [author] Apr 30, 2020 @ 5:32am 
You'll need to update your mod if you want the improved compatibility, but it's safe to keep running the old version.
SentySent Apr 30, 2020 @ 5:27am 
Hi, do I need to replace the XModBase with the latest version for my mods that dependent on it?
xylthixlm  [author] Apr 30, 2020 @ 4:16am 
Updated to 2.0.2. This release improves compatibility with the Community Highlander.