I have a question regarding using this method with a mutator that has
some of the config variables in structures.
Attempted to use this with a new SwarmSpawner mutator I am working on.
The variables all show up in the advanced settings as they should, and
I can change the variables that are not Struct's, but the data inside
structures seems to be unmodifiable via the adv. settings menu.
It does display the data fine if it exists in the ini file however.
I suspect the answer is "it cant be done", but thought I would post the inquiry anyway.
Here is the int file I am using:
Code: Select all
[Public]
Object=(Name=SwarmSpawn.SS,Class=Class,MetaClass=Engine.Mutator,Description="SwarmSpawn")
Preferences=(Caption="Mutators",Parent="Advanced Options")
Preferences=(Caption="SwarmSpawn",Parent="Mutators",Class=SwarmSpawn.SS,Immediate=True)
This is how the data is defined in the mutator code:
Code: Select all
var config int NumSwarms;
var config int CheckRate;
var config bool bDebugMode;
struct SwarmInfoType
{
var String SwarmClass;
var int SwarmSize;
var float SDS;
};
var config SwarmInfoType SwarmInfo[4];
struct SwarmSettingsType
{
var String SettingName;
var String SettingValue;
var bool bPreSpawn;
};
var config SwarmSettingsType SwarmSettings0[4];
var config SwarmSettingsType SwarmSettings1[4];
var config SwarmSettingsType SwarmSettings2[4];
var config SwarmSettingsType SwarmSettings3[4];
And here is what the ini file looks like:
Code: Select all
[SwarmSpawn.SS]
NumSwarms=4
CheckRate=60
bDebugMode=True
SwarmInfo[0]=(SwarmClass="UnrealShare.Cow",swarmsize=3,SDS=0.250000)
SwarmInfo[1]=(SwarmClass="NewBirds.Bird2",swarmsize=1,SDS=2.000000)
SwarmInfo[2]=(SwarmClass="NewBirds.Bird3",swarmsize=4,SDS=0.500000)
SwarmInfo[3]=(SwarmClass="UnrealShare.Brute",swarmsize=1,SDS=1.000000)
SwarmSettings0[0]=(SettingName="bHasBaby",SettingValue="True",bPreSpawn=True)
SwarmSettings0[1]=(SettingName="bGreenBlood",SettingValue="True",bPreSpawn=False)
SwarmSettings0[2]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings0[3]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings1[0]=(SettingName="BirdColor",SettingValue="3",bPreSpawn=True)
SwarmSettings1[1]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings1[2]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings1[3]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings2[0]=(SettingName="BirdColor",SettingValue="5",bPreSpawn=True)
SwarmSettings2[1]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings2[2]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings2[3]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings3[0]=(SettingName="GroundSpeed",SettingValue="250",bPreSpawn=False)
SwarmSettings3[1]=(SettingName="JumpZ",SettingValue="360",bPreSpawn=False)
SwarmSettings3[2]=(SettingName="",SettingValue="",bPreSpawn=False)
SwarmSettings3[3]=(SettingName="",SettingValue="",bPreSpawn=False)
All the values show up in the adv. preferences menu the way I want them to, but
only the 1st 3 are modifiable.....
If I take the variables out of the structures, both the lists in the adv preferences menus and in the
ini file become very "user unfriendly".
(And would be even more so when I increase the # of Swarms and Settings for each... Just have it at 4 for testing atm.)
Or maybe somebody could tell me a compiler directive that will enable nested arrays.
Also. I suggest either this topic become a sticky, or you could consolidate some of the examples above, and have that
post made a sticky.
May want to make a note that using this technique will add lines for empty array elements in your ini.
For example, an ini file created with a text editor with 4 settings in it, 2 of the settings are value[0] in
an array of 512. Those settings are optional. If the mutator doesn't find them, they are assumed to
be zero, null, false etc.
The original ini file has 4 lines in it.
If you adjust any setting for the mutator, you will end up with an ini file that has 1026 lines in it...
All but 4 will be empty. Back up your ini's and/or be aware of this before using.
It might also be useful to add a bit explaining how to make the Advanced Preferences menu item show up
in the UT menu so that users dont have to press Tab and type 'Preferences' every time.
(I admit it, did a clean install last week for editing, and seem to have forgotten how to turn that option back on.....
)