Jump to content

INI file in mod not grabbing new soldier abilities


mairsil1

Recommended Posts

I'm certain I'm missing something simple here, but after pouring over a million mods that work with abilities and reading every post on the topic I can find, I cannot understand why mine will not work. I think I have the ability I would like to add built correctly and I would love to start testing, but when I go into the debugger the class never has the ability I've added.

 

The config file in my solution is named XComClassData.ini, but I have tried it named other things with a "basedon" value set to that ini as well. I have tried using "-SoldierRanks" for each of the default values as well as just "!SoldierRanks" in my INI, then my add in code is just like this (I don't know how this could be wrong, it's identical to what I see in other working mods).

 

 

 

[Ranger X2SoldierClassTemplate]
!SoldierRanks (or -SoldierRanks copied from the DefaultClassData.ini exactly, either method fails)
+SoldierRanks=(aAbilityTree=((AbilityName="SwordSlice", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)), aStatProgression=((StatType=eStat_Offense,StatAmount=3), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=1)),)
+SoldierRanks=(aAbilityTree=((AbilityName="ShadowSlice", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon), (AbilityName="Phantom")), aStatProgression=((StatType=eStat_Offense,StatAmount=3), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)),)
+SoldierRanks=(aAbilityTree=((AbilityName="Shadowstrike", ApplyToWeaponSlot=eInvSlot_Unknown), (AbilityName="Shadowstep", ApplyToWeaponSlot=eInvSlot_Unknown)), aStatProgression=((StatType=eStat_Offense,StatAmount=3), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=0)),)
+SoldierRanks=(aAbilityTree=((AbilityName="Stealth"), (AbilityName="RunAndGun")), aStatProgression=((StatType=eStat_Offense,StatAmount=2), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=1), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=0)),)
+SoldierRanks=(aAbilityTree=((AbilityName="Implacable"), (AbilityName="Bladestorm", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)), aStatProgression=((StatType=eStat_Offense,StatAmount=2), (StatType=eStat_HP,StatAmount=0), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)),)
+SoldierRanks=(aAbilityTree=((AbilityName="DeepCover"), (AbilityName="Untouchable")), aStatProgression=((StatType=eStat_Offense,StatAmount=1), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=0)),)
+SoldierRanks=(aAbilityTree=((AbilityName="RapidFire", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), (AbilityName="Reaper", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)), aStatProgression=((StatType=eStat_Offense,StatAmount=1), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=1), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)),)

Is there some initialization step I'm missing somewhere else that is causing the debugger to ignore my new ability tree?
Link to comment
Share on other sites

The HiddenPotential mod uses this method.

And from what I can tell, order matters. I did by mistake copy the SwordSlice line twice (when trying to give an ability) and it replaced the next ability in line, which pushed the next ability 1 spot down and so on.

-SoldierRanks=(    aAbilityTree=(    (AbilityName="SwordSlice", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)             ),         aStatProgression=((StatType=eStat_Offense,StatAmount=3), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=1)),       )
+SoldierRanks=(    aAbilityTree=(    (AbilityName="SwordSlice", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)             ),         aStatProgression=((StatType=eStat_Offense,StatAmount=1,RandStatAmount=6), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=1)),       )
-SoldierRanks=(  aAbilityTree=(    (AbilityName="Phantom"),             (AbilityName="Blademaster", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)             ),     aStatProgression=((StatType=eStat_Offense,StatAmount=3), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)),       )
+SoldierRanks=(  aAbilityTree=(    (AbilityName="Phantom"),             (AbilityName="Blademaster", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon)             ),     aStatProgression=((StatType=eStat_Offense,StatAmount=1,RandStatAmount=6), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=5), (StatType=eStat_CombatSims,StatAmount=0)),       )
Link to comment
Share on other sites

Yeah, I got that order matters and all that. I have the same number of abilities in the same order and while I've seen the -,+,-,+ method in other mods, I've also seen the subtract them all then add all of your own method in working mods. I think this goes back to a post I saw from Amineri that said when subtracting (instead of using !) the game looks for the item and value, so if you had Ability 1-7 and you tell it subtract 1, then add 8, subtract 2 then add 9, etc, since it's matching values you would still end up with 8-14 the same as if you tell it subtract 1, subtract 2... subtract 7, add 8, add 9... add 14. That's my understanding of the actual INI manipulation and why I think both methods work.

 

However, what I'm saying is that my debugger literally makes no changes to the Ranger ability tree at all. I could just not have my INI file in the solution and it would look identical, it perpetually fails to recognize it, and I don't know why.

Link to comment
Share on other sites

Something I've noticed, is that the game is VERY picky about long configuration lines, to the point where an extra space character results in your "-" line not matching correctly. I would go to your User/Documents/My Games/XCOM2/XComGame/Config directory, find the appropriate line you are trying to replace in the appropriate file, and copy it EXACTLY from there.

 

Here's a couple other threads about similar things:

http://forums.nexusmods.com/index.php?/topic/3840440-anyone-know-how-to-remove-config-lines-that-spill-multiple-lines-with/

http://forums.nexusmods.com/index.php?/topic/3828080-script-editing/page-2&do=findComment&comment=34873745

Link to comment
Share on other sites

concur - even with cut and paste, I've had it be... very odd - hit or miss inw hat it chooses to recognize-
what's more, I've found changea that I cannot get it to accept with 'modbuddy' ( - line, plus line )
but work fine if I do them by hand - which s fine until i try to publish it
( for example, telling grenadiers they cannot use the cannon, rather the rifle ) done through modbuddy, could NOT get it to recognize it - by hand? bang - like a charm.

Might I add, turned out some of the modbuddy *.uc files were WRITE-only - don't want to wonder what kind of issues that gave me originally - i can only assume that the copy made into the mod's src folder isn't.

I'm gathering there's a preference for making entirely new classes as changing the default classes seems fraught with unexpected behaviors.

Link to comment
Share on other sites

I too am facing this problem. I know for certain, that if I edit for example eStat_HP to be 4 instead of 1 for ranger squaddie manually in my documents config, it will work. However, if I try to achieve the same with merger commands (namely, removing the line with a '-' and then adding the exact same line with my change in with '+') it fails to do so. I really don't get why, because this method works flawlessly on any other config I layed hands upon

 

 

*Edit* I made sure I was very precise when doing this. Alternatively I even tried to reduce line length (removing spaces) appropriately to the number of signs I added to the line, but even that did not work.

I am not sure if this can be done ~at all~. I took a deep look into the underlying unreal code and it seems that the SoldierRanks array is protected. Although one would assume, this would only stop us from modifying/altering it's structure, it also seems to have an effect on the merger, which is responsible for .ini changes, because, as we all are aware of, adding or changing the default weapon loadout is possible (and that is not protected). Sadly, this also means that defining additional stat progressions on rank up, besides the predefined vanilla ones, like mobility or armor mitigation, will also not be possible - I have yet to determine what controls the said maximum length of the array, but I fear it may not be altered.

Edited by LazySkyrimPlayer
Link to comment
Share on other sites

Man, I think the solution to this must be so simple. Urgh. Frustrating.

 

Right now what I want to know is what .ini you edit on the ModBuddy; as there are two of each: The DefaultConifg.ini on steamapps and the XCOMConfig.ini on the documents.

Their lines are different, btw (similar, but not quite the same); so when choosing to be precise, which one are we talking about?

 

Amnieri said to edit the DefaultConfig.ini and then rename it to XcomConfig.ini; which will then create a third file the game has to check. The DefaultConfig, the XComConfig on the documents and the XComConfig on your mod folder.

 

Now, the DefaultConfig one will always be overwritten by the XComConfig; the question is, which one has the preference, the XComConfig on the mod or the one in the users' documents?

Link to comment
Share on other sites

Lots of mods do this successfully. If there are mod conflicts, there is some ambiguity in what happens; but for your local mods, it may help to understand more about what happens when the game loads.

 

For every mod which is active, the game compares the timestamps of the XcomXyz.ini files in the mod directory against the XComXyz.ini files in the My Documents directory. If the My Documents file is missing, or older, then it is created from scratch. This starts with the game DefaultXyz.ini file, applies each of the mod ini files in mod load order, and then writes the My Documents XComXyz.ini file. After that, the mod ini files are not used anymore.

 

In case there is some confusing result or leftover data, it may help to remove all the My Documents XComXyz.ini files, so that they can all be created from scratch the next time the game is launched.

 

Does that help understand how the files are used?

Edited by davidlallen
Link to comment
Share on other sites

Hum.

I'll give the concrete example.

I want to make my rookies look more random, right?

I can achieve this (as is widely known) by modifing these lines on the namelist.ini

NewSoldier_HatChance = 0.15
NewSoldier_UpperFacePropChance = 0.15
NewSoldier_LowerFacePropChance = 0.15
NewSoldier_BeardChance = 0.33
NewSoldier_ForceColors = true

But I want this to be part of my mod, so I created a XComNamelist.ini on the config folder of my mod and this did:

-NewSoldier_HatChance = 0.15
-NewSoldier_UpperFacePropChance = 0.15
-NewSoldier_LowerFacePropChance = 0.15
-NewSoldier_BeardChance = 0.33
-NewSoldier_ForceColors = true

+NewSoldier_HatChance = 0.9
+NewSoldier_UpperFacePropChance = 0.9
+NewSoldier_LowerFacePropChance = 0.9
+NewSoldier_BeardChance = 0.9
+NewSoldier_ForceColors = false

Not only is this not working, but my mod actually makes the game ignore the XcomNamelist.ini on my documents as in, the changes I do there, are ignored unless I start the game without my mod.

Plus, part of my mod is to add face paints and armor patterns to rookies, so I created the var config stuff on the .uc file as to be able to create this new line on the config:

+NewSoldier_FacePaintChance = 0.9

But I can't even test it, because my XComnamelist.ini is being ignored anyway.

 

I can, by the way, ignore all this process to just make the game always add stuff to your rookies.

But then the user is left without a way to configure it, if he wants.

Edited by Sblargh
Link to comment
Share on other sites

Well, let's work out the part where your XcomNameList.ini file is being ignored. Are you using any other mods? Have you cleaned out your My Documents ini files? The "-" command is highly sensitive to white space; are you sure you have the same whitespace as the line you are trying to delete?

 

Are you using modbuddy? If so are you performing a build after each time you change the file?

 

Once you have checked all these things, I am pretty hopeful you will see that your ini file changes are picked up.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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