Jump to content

Help with loading ini files in modbuddy


bboban13

Recommended Posts

Hi everyone,

 

Can someone help me to "make" modbuddy load my defaultgamecore.ini into mod ?

I know that I can edit that file directly in steam files and it works , but I'd like to share the mod on nexus and not make players copy paste etc. every time they want to try the changes .

 

Mod compiles but changes are just not loaded :sad:

 

Here is the screenshot

 

 

Link to comment
Share on other sites

I posted this in a PM once already so well, here is a sample picture here so you can tell what you need: http://puu.sh/n2y7K/3171452bee.png for reference.

 

(Merely do not mind the second .uc because the SDK duplicates them for whatever reason and while cleaning does not help, the end result will still be one and the right file. Also, the MutonM2 modifications actually do not work.)

 

Now then, you get the basic structure by using the DefaultMod and deleting unnecessary folders so all I really did/write was the XComGameData_CharacterStats.ini. I wrote it by copying the lines I want to modify with (all) their [headers] from the real .ini and copy the lines again but adjust the value to my very liking, the original line gets a - to mark it for removal and mine a + to add it. Habitually I also append the [iniVersion] at the bottom without actually knowing if it is essential, mind you. Choose to build the Mod (not Solution) and it should be ready for testing.

 

I'd also like to note that other Mods may not use the - and + and still work, I do not know why but my first mod certainly did not work like this.

 

That's about all the advice I can give (since you are also missing your screenshot).
Link to comment
Share on other sites

I'd also like to note that other Mods may not use the - and + and still work, I do not know why but my first mod certainly did not work like this.

 

Please correct me, if I'm wrong, but "the last one wins".

// Contents of some ini file

[Section]
Key = 1

[Section]
Key = 2

Result will be Key = 2.

 

It's like in the code. If you set Key to 1 and on the next line to 2, it will be equal to 2 in the end.

---

 

+ Adds a line if that property doesn't exist yet (from a previous configuration file or earlier in the same configuration file).

- Removes a line (but it has to be an exact match).

. Adds a new property.

! Removes a property; but you don't have to have an exact match, just the name of the property.

 

+-.! marks are great to keep configuration files tidy. But sometimes there is no exact match, because some other mod may add the very same key (the last one wins), or new key needs to be added to specific place in an existing array.

// original
[XComGame.XComGameState_UFO]
MaxHuntingDistance=0.2

// mod 1 just adds new key
[XComGame.XComGameState_UFO]
MaxHuntingDistance=0.4

// mod 2 removes the original (exact match) and adds new key
[XComGame.XComGameState_UFO]
-MaxHuntingDistance=0.2
+MaxHuntingDistance=0.6

// But if 0.6 is added to a place, where 0.2 was, result of such ini should be MaxHuntingDistance=0.4.
// original
[XComGame.X2SoldierClass_DefaultClasses]
SoldierClasses="Rookie"
SoldierClasses="Ranger"
SoldierClasses="Sharpshooter"
SoldierClasses="Grenadier"
SoldierClasses="Specialist"
SoldierClasses="PsiOperative"
SoldierClasses="MP_Ranger"
SoldierClasses="MP_Sharpshooter"
SoldierClasses="MP_Grenadier"
SoldierClasses="MP_Specialist"
SoldierClasses="MP_PsiOperative"

// mod 1 - Would ClearArray trick performed by IniLocPatcher (XCOM EU - Logs\EMS\) work?
// This may not be the best example, because most of exposed arrays in XCOM 2 inis are indexed.
[XComGame.X2SoldierClass_DefaultClasses]
!SoldierClasses=ClearArray // < clear
SoldierClasses="Rookie"
SoldierClasses="Ranger"
SoldierClasses="Sharpshooter"
SoldierClasses="Grenadier"
SoldierClasses="Specialist"
SoldierClasses="PsiOperative"
SoldierClasses="Wizard" // < add
SoldierClasses="MP_Ranger"
SoldierClasses="MP_Sharpshooter"
SoldierClasses="MP_Grenadier"
SoldierClasses="MP_Specialist"
SoldierClasses="MP_PsiOperative"
Edited by Drakous79
Link to comment
Share on other sites

 

I'd also like to note that other Mods may not use the - and + and still work, I do not know why but my first mod certainly did not work like this.

 

Please correct me, if I'm wrong, but "the last one wins".

 

It's like in the code. If you set Key to 1 and on the next line to 2, it will be equal to 2 in the end.

---

 

Then the next question probably is how one can find out/influence which one is first and which one is last, especially in terms of Mods which have no apparent load order...

Link to comment
Share on other sites

I'd like to know it too. Right now it seems like more customers want to get the same product, but nobody knows who is going to get it :smile:

 

It is not possible to check on daily basis, which mod is changing the same ini value and update own mod's description.

 

Considering manual edits the last entry wins. In Steam Workshop it may be the first mod changing the value wins.

 

Edit: We can do test mods and experiment.

Edited by Drakous79
Link to comment
Share on other sites

  • Recently Browsing   0 members

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