Jump to content

Modding details? Ask away!


Amineri

Recommended Posts

 

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 :

 

- X2Character_MutonM2.uc

- X2Item_MutonM2.uc

 

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 :

CharTemplate.strPawnArchetypes.AddItem("LWMutonM2.ARC_GameUnit_MutonM2");

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!

 

I am trying to make a variant of an advent trooper to add into the game. I am not trying to make something with reskins or different weapons, just want to make another type of Advent trooper that has some armor. Using the information here I created the X2_Character.uc and created an entry in the XcomGameData_CharacterStats. Since I am basing loot, ai, loadout, and art on the original Advent trooper, do I need to do anything else?

 

Also looking at the Centurion X2_Character.uc code I found this at the top

 

class X2Character_MutonM2 extends X2Character config(LW_MutonM2);

 

Is the that config file needed to making a variant of an existing unit in game if I am not changing anything damage or rangewise?

Link to comment
Share on other sites

  • Replies 399
  • Created
  • Last Reply

Top Posters In This Topic

Hello Amineri & other people reading!

 

Can you please point out the ini files to me in which I have to make changes so as to be able to play the Legendary Difficulty but without any aim debuffs or any help to the Advent soliders chances to hit. Basically I want to get rid of ANY kind of assistance in the battlefield BOTH to my own soldiers and to the Advent. Want to get rid of things like, you know, how on lower difficulty settings, X-Com gets help if soldiers keep missing shots or on higher difficulty settings the Advent gets defensive/offensive boosts.

 

In short, I want a pure, unadulterated RNG, but WITH the long strategic layer (like extra enemies on the field, higher shaken chance, longer research, longer time to heal etc) of the Legend Difficulty.

 

Thankyou.

Link to comment
Share on other sites

on higher difficulty settings the Advent gets defensive/offensive boosts.

 

So... which stats do you want to have then for them aliens? Default (Rookie) Stats, Veteran Stats or Commander Stats? Instead of Legendary Stats that is.

In any event XComGameData_CharacterStats.ini is where the stats you want to change are at. I believe, if you do not want to make a mod out of it, you just need to delete _Diff_3 (which stands for legendary difficulty, the count is up from 0) for Default/Rookie Stats or delete _Diff_3 and find and replace (even the standard notepad has that function) all _Diff_1 or _Diff_2 , you choice (if you want Veteran or Commander), with _Diff_3.

 

The enemies do not get any hidden bonuses (you just can not see most of their stats by default) and XCOM gets none either on Legendary (but indeed they get on lower difficulties).

Link to comment
Share on other sites

 

on higher difficulty settings the Advent gets defensive/offensive boosts.

 

So... which stats do you want to have then for them aliens? Default (Rookie) Stats, Veteran Stats or Commander Stats? Instead of Legendary Stats that is.

In any event XComGameData_CharacterStats.ini is where the stats you want to change are at. I believe, if you do not want to make a mod out of it, you just need to delete _Diff_3 (which stands for legendary difficulty, the count is up from 0) for Default/Rookie Stats or delete _Diff_3 and find and replace (even the standard notepad has that function) all _Diff_1 or _Diff_2 , you choice (if you want Veteran or Commander), with _Diff_3.

 

The enemies do not get any hidden bonuses (you just can not see most of their stats by default) and XCOM gets none either on Legendary (but indeed they get on lower difficulties).

 

 

Thankyou for pointing out the location :smile:

 

However from a quick glance, it seems that only the HP, Will, Crit chances are changing. So no change in Offensive or Defensive stats for aliens at all on higher levels? I say this because i read on reddit or nexus that same as in Xcom EU, Xcom 2 has some "offset" of 10% on classic and 20% on legendary..like he meant that aliens are harder to hit on higher levels. Is that true?

Edited by Xenic251
Link to comment
Share on other sites

so I was wondering, is it possible to tweak the cooldown for the grapple/grapplepowered ability? I tried the x2ability_defaultabilityset.uc file, where it shows a line for what is supposed to be the grapple cooldown (cooldown_inumturns), I think, to no effect, and I haven't seen anything for it in the ini's. is this the only hard coded cooldown in the game? or am I missing something?

Link to comment
Share on other sites

so I was wondering, is it possible to tweak the cooldown for the grapple/grapplepowered ability? I tried the x2ability_defaultabilityset.uc file, where it shows a line for what is supposed to be the grapple cooldown (cooldown_inumturns), I think, to no effect, and I haven't seen anything for it in the ini's. is this the only hard coded cooldown in the game? or am I missing something?

Looking at those abilities it appears to be that their creating functions are static which means you cant override them, a possible solution is on the start of the game that you are going into that ability set and change the cooldown from there or listening to figure out when the grapple is fired and then changing the cooldown on that unit

Edited by Guest
Link to comment
Share on other sites

I have a voice pack on the steam workshop. Some people are reporting crashes when testing in the armory others are not having problems at all.

 

I've used this tutorial and read the included documentation but I still don't know what the issue is. Since it works fine on my end I can't get any sort of bug reports.

 

I also gone through and read the old Long War voice pack instructions and followed every step but people still report crashes.

 

If you have the time, please take a look through my code and see what could be the problem. It's super frustrating with no official word on what's causing everyone's voice packs to break.

 

Source: https://mega.nz/#!YZ9SwbhL!bylHBE3oOthg2ZMJoyVVZ5nkzr11XOp-YEB1j9x3sVo

 

 

Link to comment
Share on other sites

Hi Amineri!

 

I know you've already said you don't handle the art side of things, but I was wondering if you can help me. I have a history as a 3D artist already, so the creation of assets isn't new to me, but I am new to modding, and I'd like to try putting my own Guns and Props into XCOM2 as a starting point.

 

Problems is, I have no idea where to start with this. I'm guessing it's pretty simple, and done mostly through the UDK bundled with the ModBuddy program, but if you could give me some information on how to get started and what have you, that'd be excellent :D

Link to comment
Share on other sites

 

Does anyone have a working example for overriding X2AbilityToHitCalc_StandardAim or a similar class? I've been trying, following the example template, and none of my subclass's functions are being called (no effect, no log output). There was one other poster in the thread who had the same problem with X2AbilityToHitCalc_Hacking, and at least a few others with problems getting their class overrides to do anything.

 

If you do a search through the source files for usages of X2AbilityToHitCalc_StandardAim (I use Notepad++), you'll find that the class is being explicitly specified in the weapon templates. Such as :

StandardAim = new class'X2AbilityToHitCalc_StandardAim';
StandardAim.bGuaranteedHit = true;
Template.AbilityToHitCalc = StandardAim;

from X2Ability_AdventMEC.CreateMicroMissilesAbility.

 

This is using new, so should be override-able, but it is being invoked when the game is launching, when the base-game templates are being loaded. Presumably this occurs prior to the mods being launched, so it's basically a sort of load-order issue. You'd want your class overrides to take place before these templates get loaded.

 

This is just a theory of mine, but could be confirmed by changing the DefaultEngine.ini to include your override definitions (implicitly making them part of the base game). I'm not quite sure when the relative timing of "config merging" versus "Template creation" occurs, since it's all deep down in the native exe ...

 

 

I think I found the problem. The X2Ability_AdventMEC example is an exception to the rule, since many other ability templates do not use "new" to create X2AbilityToHitCalc. In the parent class X2Ability there are default properties:

DefaultProperties
{
	...

	Begin Object Class=X2AbilityToHitCalc_StandardAim Name=DefaultSimpleStandardAim
	End Object
	SimpleStandardAim = DefaultSimpleStandardAim;

        ...
}

and most abilities (including X2Ability_WeaponCommon.AddStandardShot) use this default instead:

Template.AbilityToHitCalc = default.SimpleStandardAim;
Template.AbilityToHitOwnerOnMissCalc = default.SimpleStandardAim;

..I'm not really sure how to go about getting all of the different abilities to use a different default HitCalc.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...