Jump to content

eAbility_?


Recommended Posts

There are lists of eAbility codes out there, but all the ones I've discovered lack the two that I'm scouring the boards for.

 

Anybody know the eAbility code for Covering Fire and for Holo-Targetting? I saw Holo-targetting at once point a few hours ago, and it was... laser-something.

 

Damn my ADHD! I got distracted before I could write it down. Thank you for any help.

 

- JR

Link to comment
Share on other sites

Thanks, Bertilsson, but I can't seem to get that site to show any data. I'm not sure what the problem is. I can pull the large dropdown menues, but no matter how I filter it, nothing ever appears.

What browser do you use?

 

The idea is that you should get a big table with 4506 rows in it and that you can optionally filter the number of items by using the drop-down menus or just type free-text in any of the text boxes below (including the value boxes, to reverse lookup what values may refer to).

 

if you for example type perk in the name box you will find anything with perk in the name.

 

But the names used in the code for perks aren't always very intuitive and holo-targeting for example called ePerk_TracerBeams.

 

For future reference this tool is probably more user friendly when it comes to perks:

http://hem.bredband.net/bertrich/XCOM/ExtendedPerkGen.htm

By hovering the mouse over any perk inside the drop down menus, you will get the hex number of that perk and a description...

Link to comment
Share on other sites

Oh, I'm extremely new to doing this sort of thing. Reading and tweaking as I go.

 

I noticed that if I added eAbility_ShotSuppress to assault rifles, pistols, and LMG's, they would appear for everybody that had those weapons. That appealed to me - suppressing fire is really more a function of the weapon. It doesn't take any special training.

 

Anyhow, I started a new game and it worked, so I got all excited and took it back off and tried to see if I could add holotargetting to weapons the same way as before. I didn't have the terminology down and didn't know it was named TracerBeams behind the scenes, so I decided to try Covering Fire and come back to Holo-Targetting later once I have more experience.

 

So I'm doing nothing more complex than screwing around with [XComGame.XGTacticalGameCore] at the moment. We all gotta start somewhere, right? :-)

Link to comment
Share on other sites

Indeed we do have to start somewhere :)

 

My first try at scanning through the unreal code was attempting to trace through the mechanics of how the air combat system works.

 

Anyhow, internal to the game there are two different enums : eAbility_ and ePerk_

 

The way the game handles these are quite different, but semantically it's easy to confuse the two because the soldier barracks UI labels the perk selection interface as "Abilities". You also have to get used to the different ways that things are handled in the strategy side of the game vs the tactical side. Strategy game is handled in XComStrategyGame.upk, while tactical game stuff is handled in XComGame.upk.

 

Perks in the strategy game are stored in the XGStrategySolder class in the m_kChar variable, which is a variable of type TCharacter. The TCharacter struct type is define in XGTacticalGameCoreNativeBase in XComGame (and is used in both upks) :

struct native TCharacter
{
	var string strName;
	var int iType;
	var TInventory kInventory;
	var int aUpgrades[111];
	var int aAbilities[89];
	var int aProperties[14];
	var int aStats[19];
	var int aTraversals[15];
	var XGTacticalGameCoreData.ESoldierClass eClass;
	var bool bHasPsiGift;

The perks are stored in the aUpgrades array. This basically functions as a boolean array (even though it's of type int) in the vanilla game. Each perk has an index into the array -- if the value at the index is 0 then the soldier doesn't have the perk, and 1 means the soldier has the perk.

 

However, units can also be given abilities directly. The aAbilities array draws from the eAbility_ enum. In addition this stores properties from the eCP_ enum (the enum definition is ECharacterProperty) and possible traversal types (i.e. can drop down, crash through windows, etc) eTraversal_, which is the ETraversalType enum.

 

The abilities, character properties and traversal types for soldiers are defined in the DefaultGameCore.ini via the Characters = lines. This contains the template for all soldiers, so for example adding eAbility_MedikitHeal to the soldier line gives every XCOM unit the ability to use Medikit healing, even without the item (assuming that the code is also modded to give the unit some charges.

 

From the tactical game engine's perspective, abilities are always "active abilities" -- they generate the buttons at the bottom of the UI. Pressing/clicking the button activates an ability. Many abilities take a movement action point or use the single firing action ending the turn for the unit. The primary exception to this is the move ability, eAbility_Move (which is ability number 1 in the enum list) which is triggered via clicking on the target destination.

 

Now, perks can fall into two general categories : passive perks and active perks. Active perks basically always map to an ability, thus creating a triggerable button. An example of this is Run and Gun. The perk ePerk_RunAndGun (perk 6) causes the unit to get the ability eAbility_RunAndGun (ability 66). The unit having the perk causes the game engine to add the ability to the soldier's ability list as appropriate. The ability on the ability list causes the icon to appear, allowing the ability to be used.

 

However, perks can also be passive perks, which do NOT result in an ability being added. A good example of this is ePerk_LightningReflexes. There is no such corresponding ability for Lightning Reflexes. Instead the game code tests for Lightning Reflexes when a unit is shot at on overwatch. The holo targeting perk works in the same way, although internally it is called ePerk_TracerBeams.

 

Abilities can come from a variety of sources. They can come directly from the character template (and so would be common to all characters of that type), they can come from weapons (most gun-type weapons get eAbility_ShotStandard which is what allows for basic shooting), they can in theory come from armor (this is how the ghost ability is added to ghost armor), and they can also be derived from perks.

 

The function that re-builds the ability list is XGUnitNativeBase.BuildAbilities. Unfortunately this function is written in native code (in xcomgame.exe), so it's much harder to see what's happening or mod how this works. This function is invoked repeatedly during the game to keep refreshing the ability list (for example, after Run and Gun is activated most abilities are filtered off the list until the next turn).

 

You've probably noticed that we've created some new perks for Long War. All of the perks created were of the passive type (as these are implemented in various places throughout the upk code). It wasn't possible to create a perk that mapped to an ability because the BuildAbilities function is in native code.

 

Unfortunately, the way the game is structured the holotargeting/tracerbeams effect is based upon a character property and not a weapon property. This is why the effect applies to both a rifle and the pistol -- it's not a specific weapon property. The same is true for covering fire.

 

Only abilities off the EAbility enum list (that all start with eAbility_) can be added to weapons.

 

Hope this helps a bit!

Link to comment
Share on other sites

Haha I think I understood more of that than I expected to.

 

So if I'm reading you right and understand the logic, I could add "Run and gun" to pistols and make it work just fine for anybody that had a pistol drawn, but trying to add Aggression or Close-Combat Specialist would fail, because the area I'm tinkering with only works correctly if it gives me a button to mash.

Link to comment
Share on other sites

Haha I think I understood more of that than I expected to.

 

So if I'm reading you right and understand the logic, I could add "Run and gun" to pistols and make it work just fine for anybody that had a pistol drawn, but trying to add Aggression or Close-Combat Specialist would fail, because the area I'm tinkering with only works correctly if it gives me a button to mash.

 

Pretty much. I think pistols are actually bugged in that stat adjustments and such from pistols aren't given to the unit -- only from the main weapon. I know that we tried to add a -5 to hit on the pistol and it just didn't work.

 

There are actually 4 (or 5) types of item slots for each unit : armor, pistol, large item, small item. Each unit can only have 1 armor and 1 pistol, but technically up to 16 each of the large items and small items. Large items are rifles, LMGs, shotguns, rocket launchers and sniper rifles. Small items are things like grenades, nano-fiber vests, and medikits. There is a fifth category of 'custom items' that are always added automatically be the game. Psi amps and grapple hooks are what's put in.

 

The reason I mention this is that I think the BuildAbilities native code only draws abilities from items in the large item, armor and custom item slots. The rules for grenade type items is a little wonky though. Frag and Alien grenades spawn the ability icon just by being there, but smoke grenade and battlescanners only get the ability icon added if the soldier has the perk. The game actually HAS smoke grenade and battlescanner items, but adding those items doesn't cause the ability to activate.

 

As an example, we did add the eAbility_Aim to the sniper rifles. This was renamed as "steady weapon" to avoid confusion with the aim/offense stat. This generates an ability that is active only when the sniper rifle is active (switching to pistol the steady weapon ability disappear IIRC). However, using the ability grants a generic +20 aim bonus which can then be applied to a pistol shot on the next turn, which is a little broken.

 

In general you should be able to add eAbility_RunAndGun to a large item weapon and I think the ability would be added to the list. Maybe. It might only trigger based on the perk. Unfortunately it all depends on that BuildAbility function which isn't moddable :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...