Jump to content

Array in config file


eXecator

Recommended Posts

Hi there,

 

I'm currently a bit confused trying to use the config( . ) specifier for array members. I'm trying to replicate this:

// XGGameData.uc
struct native InclusionExclusionList { [...] }


// XComTacticalMissionManager.uc
class XComTacticalMissionManager extends Object [...] config(Missions);

var const config array<InclusionExclusionList> InclusionExclusionLists;


// DefaultMIssions.ini
[XComGame.XComTacticalMissionManager]

InclusionExclusionLists=(ListID="Open", [...])
InclusionExclusionLists=(ListID="NoBosses", [...])

So the XComTacticalMissionManager's InclusionExclusionLists memeber gets initialized via DefaultMissions.ini. To me the ini-lines look a little weird, like they are resetting InclusionExclusionLists instead of adding to it. But it works fine, so who cares about syntax...

 

However if I try this myself with something like this

// Foo.uc
class Foo config(Foo);
var const config array<Bar> Bars;

// XComFoo.ini
[FooMod.Foo]
Bars = ([...])
Bars = ([...])

I'll end up with only 1 single, lonely Bar in my Bars. It will work though with those lines:

Bars[0]=([...])
Bars[1]=([...])

What am I missing here? Is it because of native behaviour of the TacticalManager or InclusionExclusionList? Is it because DefaultStuff.ini gets handled different from XComStuff.ini? Did I screw up somewhere and this should work?

 

Link to comment
Share on other sites

I think I ran into something like this while trying to add a custom perk tree.

 

Instead of writing this:

SoldierRanks=( [...] )
SoldierRanks=( [...] )

I had to prefix each line with '+':

+SoldierRanks=( [...] )
+SoldierRanks=( [...] )

I'm not sure if that'll apply to your situation. I assume that I had to do it because the particular file that I was putting lines in is XComClassData.ini, which apparently follows a naming convention indicating that it is modifying DefaultClassData.ini rather than acting as a stand-alone file.

 

Also, I agree with you about the syntax; it really does look like they're overwriting the value over and over.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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