So... how do I add new aliens like your centurion? I'm looking through your files, and I can't tell if it is complicated or deceptively simple.
To start, rather than any fancy thing (adding abilities, etc), I'd just enjoy a basic guide on how to, say, clone a sectoid and make it have higher stats and a different texture.
It is deceptively simple, I think, at least from the perspective of gameplay coding.
There's only 5 unrealscript classes (*.uc) in the mod, and 3 of those are for defining new abilities and ability effects, so you can ignore those for the purposes of just creating a new alien.
The core bits are :
The first one defines the character template. All I did there was to go into the base-game code, into X2Character_DefaultCharacters and copy a template from the Muton, then modify it from there.
The second one overwrites the weapon stats, allowing us to add more damage and the like. Again, I copied from X2Item_DefaultWeapons.uc, and modified as needed.
In both cases, the art is linked to via the Archetype definition.
For character :
is how we defined the link to our new art asset for the Muton Centurion. When I was first creating the gameplay code, I just linked to the regular Muton archetype to make sure everything ran.
For item :
Template.GameArchetype = "WP_Muton_Rifle.WP_MutonRifle";
is how we linked the new Centurion item template to the existing base game art assets -- we didn't customize the weapon at all.
Once the templates are set up, the next trick is to set up appropriate config files. The Centurion isn't probably quite the perfect example code, since there's some stuff in there I wrote but didn't end up getting working (like the AIJobs).
XComAI.ini : Handles configuration the AI Behavior trees. Only needed if you are adding new abilities or you want to change behavior of new unit.
XComGameCore.ini : Only needed if you want custom loot tables for new unit, which we didn't end up doing for Centurion.
XComGameData.ini : Used to define Loadout of alien -- which items they are using.
XComGameData_CharacterStats.ini : Defines all the character stats for unit, including difficulty variations. In particular the "LeaderLevelSpawnWeights" and "FollowerLevelSpawnWeights" are used to determine when your unit gets added to a mission.
I have a file for XComMissions.ini, but this was just configuring a special test mission with Centurion in it, which isn't really needed since you can open any old mission and use \DropUnit console command to spawn your new unit.
Once the templates and configuration files are done, the next step is setting up the art.
To do this you have to work in UnrealEd. From the ModBuddy VS Shell, launch UnrealEd with TOOLS / XCom Editor.
The base-game content has archetypes and art split into separate packages, but I found that combining it all together for mods to be more helpful.
- Archetypes are under XComGame/Content/XCOM_2/Packages/GameData
- Character art assets are under XComGame/Content/XCOM_2/Packages/Characters
I found the archetype I wanted to clone, right-click, select "Create a Copy...". Then enter a new package name. The new package will show up under the NewPackages area. Similarly you can copy meshes, materials, textures etc as needed to the new package. You can also export meshes, textures and animations by right-click, select "Export to File...".
Anyhow a full accounting of setting up a new archetype and art assets in a package is probably beyond one simple post. Once it's done, I save the package to the Mod Project content folder, then pack in the ModBuddy VS Shell, use "Add Existing Item..." to add the art package to the project.
That's it for now!