Jump to content

Can someone explain what the + does in .ini files?


BlueRaja

Recommended Posts

Ok, this has been driving me mad.

According to the documentation, dynamic arrays can be initialized via config files like so:

MyClass.uc:

class MyClass extends whatever config(Namespace);   
var config array<MyType> MyArray;

XComMyClass.ini:

[Namespace.MyClass]  
MyArray=(A=1,B=1)  
MyArray=(A=2,B=2)

In this case, according to the documentation, MyArray should have two elements. Indeed, XCOM does this all over the place, and it seems to work correctly for them (search for eg. BodyPartTemplateConfig).

However, when I attempt it.... MyArray has only a single element, (A=2,B=2)

What's even more maddening is that if I put + before each line in the config, it works correctly, with MyArray having two elements. According to the documentation, the only thing + does is prevent duplicates from being added, so it makes no sense that adding a + would fix my issue.

Could someone with more knowledge of UDK please explain WTF is going on!?

Link to comment
Share on other sites

The dynamic array in BodyPartTemplateConfig has no parentheses when inputting data into the array.

 

Thus it would appear that the arrays do not automatically assume you're adding new elements when they are explicitly inside parentheses, so the + helps it delineate this behavior from simply overwriting the old value.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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