PDA

View Full Version : Problem with OptionSet/GameSettingsClass



solidblack
11-29-2007, 03:10 PM
I believe it's an easy fix, but I'm kinda dumb at the moment :(

Problem is, UT3 crashes when clicking on settings after selecting the gametype.

Log:

ScriptLog: UTUITabPage::OnGameModeChanged() - Current Game Mode: Race.RaceGame
ScriptLog: Invalid name (UTGameSettingsRCE) specified to SetCurrentByName() on UTDataStore_GameSettingsDM_0

Ok, obviously UT is trying to find some entry for RCE in UTDataStore_GameSettingsDM at 0.

UTDataStore_GameSettingsDM

/**
* Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
*/

/**
* Warfare specific datastore for TDM game creation
*/
class UTDataStore_GameSettingsDM extends UIDataStore_OnlineGameSettings;

defaultproperties
{
GameSettingsCfgList(0)=(GameSettingsClass=Class'UT Game.UTGameSettingsDM',SettingsName="UTGameSettingsDM")
GameSettingsCfgList(1)=(GameSettingsClass=Class'UT Game.UTGameSettingsTDM',SettingsName="UTGameSettingsTDM")
GameSettingsCfgList(2)=(GameSettingsClass=Class'UT Game.UTGameSettingsCTF',SettingsName="UTGameSettingsCTF")
GameSettingsCfgList(3)=(GameSettingsClass=Class'UT Game.UTGameSettingsVCTF',SettingsName="UTGameSettingsVCTF")
GameSettingsCfgList(4)=(GameSettingsClass=Class'UT Game.UTGameSettingsWAR',SettingsName="UTGameSettingsWAR")
GameSettingsCfgList(5)=(GameSettingsClass=Class'UT Game.UTGameSettingsDUEL',SettingsName="UTGameSettingsDUEL")
GameSettingsCfgList(6)=(GameSettingsClass=Class'UT Game.UTGameSettingsCampaign',SettingsName="UTGameSettingsCampaign")
Tag="UTGameSettings"
Name="Default__UTDataStore_GameSettingsDM"
ObjectArchetype=UIDataStore_OnlineGameSettings'Eng ine.Default__UIDataStore_OnlineGameSettings'

So made my own:
UTDataStore_GameSettingsRCE:


class UTDataStore_GameSettingsRCE extends UTDataStore_OnlineGameSettings;

defaultproperties {
GameSettingsCfgList(0)=(GameSettingsClass=Class'Ra ce.UTGameSettingsRCE',SettingsName="UTGameSettingsRCE")
}


UTRace.ini:


[RaceGame UTUIDataProvider_GameModeInfo]
GameMode=Race.RaceGame
DefaultMap=
GameSettingsClass=UTGameSettingsRCE
GameSearchClass=
OptionSet=RCE <--- If I use DM here it will not crash and display DM properties
FriendlyName=Racing
Description=Race, RACE, R A C E ! ! !
PreviewImageMarkup=
Prefixes=RCE
IconImage=
bIsCampaign=False
IconU=0.000000
IconV=0.000000
IconUL=0.000000
IconVL=0.000000
bRemoveOn360=False
bRemoveOnPC=False
bRemoveOnPS3=False


UTGameSettings (more or less empty)


class UTGameSettingsRCE extends UTGameSettingsCommon;
defaultproperties
{
LocalizedSettings(0)=(ValueIndex=7)
Properties(1)=(Data=(Value1=1))
Properties(2)=(Data=(Value1=2))
Name="Default__GameSettingsRCE"
ObjectArchetype=UTGameSettingsCommon'UTGame.Defaul t__UTGameSettingsCommon'
}


How can I make it happen that UT3 doesn't always point to UTDataStore_GameSettingsDM? Also tried subclassing UTDataStore_GameSettingsDM - no luck.

solidblack
11-30-2007, 07:18 PM
*bump*
Pls help :( An own gametype needs its own settings

Mysterial
11-30-2007, 10:55 PM
It doesn't work at the moment - you have to use one of the stock gametypes' settings screens. Yes, we know this is terrible.

solidblack
12-01-2007, 08:42 AM
It doesn't work at the moment - you have to use one of the stock gametypes' settings screens. Yes, we know this is terrible.

Thx for your reply, I hope this gets fixed soon :rolleyes:

agentq_71
12-12-2007, 12:49 AM
Anyone know if this is fixed in the patch?

Mysterial
12-12-2007, 11:17 AM
No. It is on the list for the next patch.

Gugi
12-12-2007, 12:24 PM
btw, don't use this:

defaultproperties {
GameSettingsCfgList(0)=(GameSettingsClass=Class'Ra ce.UTGameSettingsRCE',SettingsName="UTGameSettingsRCE")
}

Use this (note the { is on an extra line):

defaultproperties
{
GameSettingsCfgList(0)=(GameSettingsClass=Class'Ra ce.UTGameSettingsRCE',SettingsName="UTGameSettingsRCE")
}
If you don't your defaultproperties might not work correctly.

HoMeRS}i{MpSoN
08-20-2008, 03:50 PM
New patch is out... Is this working now? Is there some sort of tutorial or other information on how to setup a datastore for custom gametype settings?

HoMeRS}i{MpSoN
08-28-2008, 09:14 PM
/Bump

Will custom games settings work now?

Wormbo
08-29-2008, 02:01 AM
No. :rolleyes:

HoMeRS}i{MpSoN
08-30-2008, 01:30 PM
:(
Epic should make this priority as modding has always been an integral part of Unreal...

darksly
08-31-2008, 06:01 PM
How can I make it happen that UT3 doesn't always point to UTDataStore_GameSettingsDM? Also tried subclassing UTDataStore_GameSettingsDM - no luck.

In UTEngine.ini you have this :


...
[Engine.Engine]
...
DataStoreClientClassName=Engine.DataStoreClient
...

...
[Engine.DataStoreClient]
...
GlobalDataStoreClasses=UTGame.UTDataStore_GameSett ingsDM
...

Try to replace this last line by this :
GlobalDataStoreClasses=Race.UTDataStore_GameSettin gsRCE

I tried with my own classes and I don't have any more error like
ScriptLog: Invalid name (UTGameSettingsRCE) specified to SetCurrentByName() on UTDataStore_GameSettingsDM_0 but unfortunately it's still not working... maybe you'll have more luck :)

HKLM
09-29-2008, 12:42 AM
I believe it's an easy fix, but I'm kinda dumb at the moment :(

Problem is, UT3 crashes when clicking on settings after selecting the gametype.

Log:

ScriptLog: UTUITabPage::OnGameModeChanged() - Current Game Mode: Race.RaceGame
ScriptLog: Invalid name (UTGameSettingsRCE) specified to SetCurrentByName() on UTDataStore_GameSettingsDM_0

Ok, obviously UT is trying to find some entry for RCE in UTDataStore_GameSettingsDM at 0.

So made my own:
UTDataStore_GameSettingsRCE:


class UTDataStore_GameSettingsRCE extends UTDataStore_OnlineGameSettings;

defaultproperties {
GameSettingsCfgList(0)=(GameSettingsClass=Class'Ra ce.UTGameSettingsRCE',SettingsName="UTGameSettingsRCE")
}


UTRace.ini:


[RaceGame UTUIDataProvider_GameModeInfo]
GameMode=Race.RaceGame
DefaultMap=
GameSettingsClass=UTGameSettingsRCE
GameSearchClass=
OptionSet=RCE <--- If I use DM here it will not crash and display DM properties
FriendlyName=Racing


UTGameSettings (more or less empty)


class UTGameSettingsRCE extends UTGameSettingsCommon;
defaultproperties
{
LocalizedSettings(0)=(ValueIndex=7)
Properties(1)=(Data=(Value1=1))
Properties(2)=(Data=(Value1=2))
Name="Default__GameSettingsRCE"
ObjectArchetype=UTGameSettingsCommon'UTGame.Defaul t__UTGameSettingsCommon'
}


How can I make it happen that UT3 doesn't always point to UTDataStore_GameSettingsDM? Also tried subclassing UTDataStore_GameSettingsDM - no luck.

I've been working on this same issue myself. So far I can get a new option to show up in the UI but so far it does not do anything.

There is a few things that I see, I can help you with.

use the Add method to make a safe addition to the GameSettingsCfgList dynamic array.



class UTDataStore_GameSettingsRCE extends UTDataStore_GameSettingsDM;

defaultproperties
{
GameSettingsCfgList.Add=(GameSettingsClass=Class'R ace.UTGameSettingsRCE',SettingsName="UTGameSettingsRCE")
Tag=UTGameSettingsRCE // <-- I found I dont get some errors by setting the tag to something elese then the "UTGameSettings" from UTDataStore_GameSettingsDM
}


Also because we have to use UTGameSearchCustom for our mods to showup in the browser, you will prob want to extend your class off UTGameSettingsDM instead of UTGameSettingsCommon. My thinking is that because UTGameSearchCustom is a subclass of UTGameSearchDM and in UTGameSearchDM it has the defaultproperty of GameSettingsClass=class'UTGame.UTGameSettingsDM'
so it prob would be more likely to work if your UTGameSettingsRCE class was a subclass of UTGameSettingsDM.



class UTGameSettingsRCE extends UTGameSettingsCommon;

const PROPERTY_MYSETTING = 0x4000000F;
var databinding int MySetting;

defaultproperties
{
LocalizedSettings(0)=(ValueIndex=7)
Properties(1)=(Data=(Value1=1))
Properties(2)=(Data=(Value1=2))

Properties.Add((PropertyId=PROPERTY_MYSETTING ,Data=(Type=SDT_Int32,Value1=2),AdvertisementType= ODAT_OnlineService))
PropertyMappings.Add((Id=PROPERTY_MYSETTING ,name="MySetting",ColumnHeaderText="My Setting",MappingType=PVMT_PredefinedValues,((Type=SDT_Int3 2, Value1=0), (Type=SDT_Int32, Value1=1),(Type=SDT_Int32, Value1=2),(Type=SDT_Int32, Value1=3),(Type=SDT_Int32, Value1=4)))

/* Remove the following commented out lines:
Name="Default__GameSettingsRCE"
ObjectArchetype=UTGameSettingsCommon'UTGame.Defaul t__UTGameSettingsCommon'
*/
}

Also FYI u dont need to have the name and ObjectArchetype properties for any class. Those will be automaticly created upon compile. Other then that, the class looks fine. Have you also setup the localized file to support those properties you set in UTGameSettingsRCE?

Race.INT


[UTGameSettingsRCE]
PropertyMappings[0]=(ColumnHeaderText="Map")
PropertyMappings[1]=(ColumnHeaderText="Game")
PropertyMappings[2]=(ColumnHeaderText="Score Limit")
PropertyMappings[3]=(ColumnHeaderText="Time Limit")
PropertyMappings[4]=(ColumnHeaderText="Bots")
PropertyMappings[5]=(ColumnHeaderText="Server Description")
PropertyMappings[6]=(ColumnHeaderText="Mutators")
PropertyMappings[7]=(ColumnHeaderText="My Setting")


And now I have found that you can add widgets to the UI by editing your UTEngine.ini file. Add your UTDataStore_GameSettingsRCE right after the UTGame.UTDataStore_GameSettingsDM entry in the Engine.DataStoreClient section.

UTEngine.ini

[Engine.DataStoreClient]
...
GlobalDataStoreClasses=UTGame.UTDataStore_GameSett ingsDM
GlobalDataStoreClasses=Race.UTDataStore_GameSettin gsRCE
...


Now to actualy to add widgets, you will need to edit your UTGame.ini file

UTGame.ini


[MySetting_Common UTUIDataProvider_MenuOption]
OptionSet=Common
DataStoreMarkup=<UTGameSettingsRCE:MySetting>
OptionType=UTOT_Slider
RangeData=(MinValue=0.0,MaxValue=4.0,bIntRange=1,N udgeValue=1.0,CurrentValue=2.0)

[MySetting_RCE UTUIDataProvider_MenuOption]
OptionSet=RCE
DataStoreMarkup=<UTGameSettingsRCE:MySetting>
OptionType=UTOT_Slider
RangeData=(MinValue=0.0,MaxValue=4.0,bIntRange=1,N udgeValue=1.0,CurrentValue=2.0)

[GoalScore_DM UTUIDataProvider_MenuOption]
OptionSet=DM
OptionSet=TDM
OptionSet=CTF
OptionSet=VCTF
OptionSet=WAR
OptionSet=DUEL
OptionSet=RCE
DataStoreMarkup=<UTGameSettings:GoalScore>
bEditableCombo=1
bNumericCombo=1

[TimeLimit_DM UTUIDataProvider_MenuOption]
OptionSet=DM
OptionSet=TDM
OptionSet=CTF
OptionSet=VCTF
OptionSet=WAR
OptionSet=DUEL
OptionSet=RCE
DataStoreMarkup=<UTGameSettings:TimeLimit>
bEditableCombo=1
bNumericCombo=1

The 1st part will add a new UI option to the menu but so far I still have not yet got it to do anything yet. (TODO: I think it is prob needs the DataStoreMarkup property to be correctly setup.

As shown in the GoalScore_DM UTUIDataProvider_MenuOption and TimeLimit_DM UTUIDataProvider_MenuOption sections of my example, you will have to add your OptionSet to the array for the setting to show up for your game.

Oh yeah to get your new widget a text label you will have to add to your .INT file

Race.INT

[MySetting UTUIDataProvider_MenuOption]
FriendlyName=My Setting
Description=This is my test setting.

[MySetting_Common UTUIDataProvider_MenuOption]
FriendlyName=My Setting
Description=This is my test setting.

[MySetting_RCE UTUIDataProvider_MenuOption]
FriendlyName=My Setting
Description=This is my test setting.


Finaly now you can use OptionSet=RCE and it will not crash.

UTRace.ini:


[RaceGame UTUIDataProvider_GameModeInfo]
GameMode=Race.RaceGame
GameSettingsClass=UTGameSettingsRCE
GameSearchClass=UTGameSearchCustom <--- Epic says mods have to use this
OptionSet=RCE <--- This will work now


Hope this helps and please let me know if you find a way to actualy bind the new widgets to useable values.

Oni.Chikara
10-23-2008, 08:18 PM
HKLM or anyone else that can answer,
Me and a group of guys are doing a UT3 mod, and we are trying to make our own rules for OptionSet and UTGameSettings. First of all, when I use the code listed here for UTDataStore... it says

"ExecWarning, Missing '(' in default properties array operation: GameSettingsCfgList.Add=(GameSettingsClass=Class'U TExplore.UTGameSettingsEX',SettingsName="UTGameSettingsEX")"

I was hoping that someone could help us here.
Thanks

HKLM
10-23-2008, 08:30 PM
HKLM or anyone else that can answer,
Me and a group of guys are doing a UT3 mod, and we are trying to make our own rules for OptionSet and UTGameSettings. First of all, when I use the code listed here for UTDataStore... it says

"ExecWarning, Missing '(' in default properties array operation: GameSettingsCfgList.Add=(GameSettingsClass=Class'U TExplore.UTGameSettingsEX',SettingsName="UTGameSettingsEX")"

I was hoping that someone could help us here.
Thanks

I have released a add-on to UT3Dom that adds the in game options to the stock UI. Download it from http://ut3dom.xantaz.net/download.php?view.8
it also includes the source code. Take a look at how I made it.

As for your "Missing '(' in default properties array " error:
You have to add a second set of ( ) see below:


/**
* Game Settings class for the UI to use with UTDom script package
* Clear out the GameSettingsCfgList array, then add it all back along with our new entry.
* Writen by Brian 'Snake' Alexander. Copyright(c) 2008 All Rights Reserved.
*/
class UTDataStore_GameSettingsDOM extends UTDataStore_GameSettingsDM;

defaultproperties
{
GameSettingsCfgList.Empty
GameSettingsCfgList.Add((GameSettingsClass=class'U TDomUI.UTGameSettingsDOM',SettingsName="UTGameSettingsDOM"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TDomUI.UTGameSettingsDDOM',SettingsName="UTGameSettingsDDOM"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsDM',SettingsName="UTGameSettingsDM"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsTDM',SettingsName="UTGameSettingsTDM"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsCTF',SettingsName="UTGameSettingsCTF"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsVCTF',SettingsName="UTGameSettingsVCTF"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsWAR',SettingsName="UTGameSettingsWAR"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsDUEL',SettingsName="UTGameSettingsDUEL"))
GameSettingsCfgList.Add((GameSettingsClass=class'U TGame.UTGameSettingsCampaign',SettingsName="UTGameSettingsCampaign"))
}




While this does work, it really will only work for one mod. Us mod authors should come up with a way to be more felxable so this will work with any one/everyones mod.

Wormbo
10-24-2008, 07:09 AM
And how exactly do mods other than UT3Dom benefit from that?

Or let me rephrase that: How exactly do several unrelated mods benefit from that at the same time?

HKLM
10-24-2008, 08:55 PM
And how exactly do mods other than UT3Dom benefit from that?

Or let me rephrase that: How exactly do several unrelated mods benefit from that at the same time?

That is why if u read the last part of my post I said
"While this does work, it really will only work for one mod. Us mod authors should come up with a way to be more felxable so this will work with any one/everyones mod."

And yet I do agree with you. Personaly I dont really like the way I had to do this, and would preffer a much more flexable way that would allow for more then just one mod to work esp seen as this change was required in the users UTEngine.ini for this to work:


[Engine.DataStoreClient]
; GlobalDataStoreClasses=UTGame.UTDataStore_GameSett ingsDM <-Replace this with our new DataStore
GlobalDataStoreClasses=UTDomUI.UTDataStore_GameSet tingsDOM

If you have any ideas on how to implement this any better, please let me know, Im open to suggestions.

HoMeRS}i{MpSoN
10-26-2008, 12:11 PM
Based on all of the above posts, this would not help custom game types either (where you wouldn't want to override the DM global data store)

HKLM
10-26-2008, 05:40 PM
Based on all of the above posts, this would not help custom game types either (where you wouldn't want to override the DM global data store)

This is the way I did it and it worked. Now yes I know this way is a bad way to implement it, but unless someone comes up with a better way, this is the only way I found taht will work. So instead of pointing out how its a bad idea, lets try to solve this with a good way to do it.

HoMeRS}i{MpSoN
10-27-2008, 08:43 PM
I was not saying your way was "bad". I was just saying that it won't work for all cases (in my case for a custom gametype, as opposed to a full blown mod). I am pretty sure the reason the "correct" way won't work is due to a documented bug that has not yet been resolved...

Oni.Chikara
10-28-2008, 06:06 PM
Here is my code for my gamesettings code:

/* Project Explore:
* Creates the new game rules for the Explore gametype
*
* References:
*
*
* By Explore Team(PK,ES,RJ,ML)
*
*/

class UTGameSettingsEX extends UTGameSettingsDM; //UTGameSettingsEX inherits everything from UTGameSettingsCommon

const PROPERTY_MYSETTING = 0x4000000F;
var databinding int MySetting;

defaultproperties
{
LocalizedSettings(0)=(ValueIndex=7)
Properties(1)=(Data=(Value1=1))
Properties(2)=(Data=(Value1=2))

Properties.Add(PropertyId=PROPERTY_MYSETTING,Data= (Type=SDT_Int32,Value1=2),AdvertisementType=ODAT_O nlineService)
PropertyMappings.Add(Id=PROPERTY_MYSETTING,name="MySetting",ColumnHeaderText="My Setting",MappingType=PVMT_PredefinedValues,((Type=SDT_Int3 2, Value1=0), (Type=SDT_Int32, Value1=1),(Type=SDT_Int32, Value1=2),(Type=SDT_Int32, Value1=3),(Type=SDT_Int32, Value1=4)))

}

The error that I am getting is:
Warning, ImporText, (Properties): Missing opening parenthesis: PropertyId=PROPERTY_MYSETTING,Data=(Type=SDT_Int32 ,Value1=2),AdvertisementType=ODAT_OnlineService)

I added parenthesis to the beginning and end and then it had other errors. I tried adding '()' right after PropertyID, and that didn't work either. Any help would be appreciated.

HKLM
10-28-2008, 09:28 PM
You need to add PredefinedValues= as shown below


PropertyMappings.Add(Id=PROPERTY_MYSETTING,name="MySetting",ColumnHeaderText="My Setting",MappingType=PVMT_PredefinedValues, PredefinedValues=((Type=SDT_Int32, Value1=0), (Type=SDT_Int32, Value1=1),(Type=SDT_Int32, Value1=2),(Type=SDT_Int32, Value1=3),(Type=SDT_Int32, Value1=4)))


Also you will have to not use the PropertyMappings.Add method, instead you will have to manualy add each to the array by number. See the source code from UTDomUI, download it at:
http://ut3dom.xantaz.net/download.php?view.9

Micah71381
11-03-2008, 05:53 PM
Without editing files outside my mod, is it possible to change the set of widgets that appear when my GameType is selected? I'm OK with using the set of widgets provided by the game, but I would like to choose what shows up without having to use the subset of widgets visible to one of the built-in game types.

Basically, I want to put this in my .INT file:

[UTGameSettingsRCE]
PropertyMappings[0]=(ColumnHeaderText="Time Limit")

And make the settings for my GameType display just the time limit option without touching UTGame.ini and UTEngine.ini. From the sound of it and looking at the code myself, I'm guessing this isn't possible but I thought I would ask.

HKLM
11-03-2008, 08:27 PM
Actualy it is very easy to do, BUT it would require editing the UTGame.ini like so:


[TimeLimit_DM UTUIDataProvider_MenuOption]
OptionSet=TDM
OptionSet=CTF
OptionSet=VCTF
OptionSet=WAR
OptionSet=DUEL
OptionSet=RCE ;<-- Your mods OptionSet
DataStoreMarkup=<UTGameSettings:TimeLimit>
bEditableCombo=1
bNumericCombo=1


Just add your mods OptionSet to the "TimeLimit_DM UTUIDataProvider_MenuOption" section. Only the TimeLimit setting would be displayed, nothing else.

... and thinking about it, if that is the only thing you want to have displayed, then I think that all you would need to really do is just use something to the effect of the following for your mods ini file:


[RaceGame UTUIDataProvider_GameModeInfo]
GameMode=Race.RaceGame
GameSettingsClass=UTgameSettingsDM
GameSearchClass=UTGameSearchCustom
OptionSet=RCE


Use the UTgameSettingsDM for the GameSettingsClass and your own OptionSet value. That along with the edit in the UTGame.ini shown above, I think would completely do it.

Micah71381
11-04-2008, 01:02 PM
I'm unwilling to edit any of the built-in .ini files because that would make my mod not only incompatible with other mods but it would also make the installation experience for the end-user horrendous(or require me to write an install script of some kind).

HKLM
11-04-2008, 02:54 PM
How so would it make it incompatible with other mods? All that would be required for your mod, is to setup UTRace.ini (or what ever your mods config file is named) and to add your mods OptionSet to the TimeLimit_DM UTUIDataProvider_MenuOption in UTGame.ini.

UTRace.ini


[RaceGame UTUIDataProvider_GameModeInfo]
GameMode=Race.RaceGame
GameSettingsClass=UTgameSettingsDM
GameSearchClass=UTGameSearchCustom
OptionSet=RCE


UTGame.ini


[TimeLimit_DM UTUIDataProvider_MenuOption]
OptionSet=TDM
OptionSet=CTF
OptionSet=VCTF
OptionSet=WAR
OptionSet=DUEL
OptionSet=RCE
DataStoreMarkup=<UTGameSettings:TimeLimit>
bEditableCombo=1
bNumericCombo=1

That is it! The only possible way it could be incompatible is if another mod used the exact same value for the OptionSet.

As for editing the UTGame.ini, I think that if you used the TC type of mod, it should have its own copy of UTGame.ini, seperate from the users main working UTGame.ini. And you can safely add your mods OptionSet by adding "+OptionSet=RCE" to the users C:\Program Files\Unreal Tournament 3\UTGame\Config\DefaultGame.ini as shown below:

DefaultGame.ini


[TimeLimit_DM UTUIDataProvider_MenuOption]
+OptionSet=RCE


This will cause the game to add that value to the UTGame.ini only when the UTGame.ini file is dynamicly created (due to old file being deleted, or upon 1st run of the game or when starting a TC mod for the 1st time)

Anyways "Can lead a horse to water, but can not make it drink it."

Micah71381
11-04-2008, 08:38 PM
How so would it make it incompatible with other mods? All that would be required for your mod, is to setup UTRace.ini (or what ever your mods config file is named) and to add your mods OptionSet to the TimeLimit_DM UTUIDataProvider_MenuOption in UTGame.ini.

In the end it's a user-experience thing. I definitely wouldn't expect an end-user to modify their .ini files because while it's easy for you and I, there are be plenty of people who have a hard enough time with standard installation wizards. This means I would have to provide an install script along with the mod that will set everything up for them.

Not a big deal, and only slightly error prone (the script could break if the .ini file is not created yet, such as before first-run or if they have modified it in such a way that the script can't find the right place to inject) but now the end-user is expected to trust me, whereas before they weren't. UT mods as they are currently implemented are sandboxed in such a way that the end-users do not have to trust the mod author when using a mod because the worst they could do is not work.

Of course, I can then offer two versions, one with an installer and one without an installer but instead with instructions on what file to modify, etc. Now we are back to dealing with the stupid user who chooses the "expert" install but runs into trouble with the setup process. This leads to support that I have to spend time doing instead of working on the mod (along with support for cases where the script fails).

In the end I may very well have to do something as you have suggested, but my hope with the original post was that there was some way to do it without having to modify anything outside my mod's directory (currently the mod install process is simply, "put folder into My Documents/MyGames/Unreal Tournament 3/UTGame/Published/CookedPC". I'm sure there are plenty of people here who will disagree with me in my assessment of how much the installation procedure matters but experience has taught me that little things like how easy the installation process is really do have an impact on the end-user's overall "mod experience".

HKLM
11-04-2008, 09:30 PM
Here is a sample installer script for NSIS (Nullsoft Scriptable Install System) http://nsis.sourceforge.net/Main_Page
This is similar to the script that I wrote for the UTDomUI installer, because yes I do agree with you. Even with a fool-proof installer, there are those few people that will somehow find a way to mess-up the installation. And UTDomUI requires alot of ini file editing. and thus is why it is only available as a installer and no manual install is avabile.
This installer script will automaticly backup the UTGame.ini before making any changes then it add the OptionSet=RCE to the correct section. You can add more logic if needed, even add a uninstaller for the mod. Feel free to use this as a template / starting point if you would like to.



!define APPNAME "My Mod"
!define APPNAMEANDVERSION "My Mod 1.0"
SetCompressor /FINAL /SOLID lzma ; Yeilds better compression then even a RAR file at Max
Name "${APPNAME}"
InstallDir "$DOCUMENTS\My Games\Unreal Tournament 3\UTGame" ; Default Install location
OutFile "C:\Development\MyMod_Setup.exe"
CRCCheck on
XPStyle on
RequestExecutionLevel user ; for Windows Vista compatibility
!include "MUI2.nsh"
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
/* The text that is displayed on the page to select where to install */
DirText "!!! IMPORTANT !!!$\r$\nSetup will install ${APPNAME} in your UT3 User Settings folder.$\r$\nSelect the parent folder that your 'Published' folder resides in.$\r$\n(Normaly this is the 'UTGame' folder, in your 'My Documents' folder).$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder."

/**
Add the
OptionSet=RCE
to the existing _DM section. So that we can use the existing UI settings with our gametypes.

Hack to add our new OptionSet entries due to NSIS not being able to handle the dynamic array
style that the Unreal Engine 3 uses in the ini files.
By re-writing the existing section title line with that same line then on the next line add the new OptionSet entries.
Normaly NSIS would just overwrite the existing entry with the new values, and that would leave users without any settings
for DM game.
*/
Section "Your Mod" Section1
SetOverwrite on
SetOutPath "$INSTDIR\Config\"
IfFileExists "$INSTDIR\Config\UTGame_RCE.bak" 0 +3
MessageBox MB_YESNO|MB_ICONSTOP "You have previously installed this, install this over itself can possibily corrupt your ini files!$\r$\n$\r$\nDo you want to continue anyways?" IDYES +2 IDNO 0
Abort
IfFileExists "$INSTDIR\Config\UTGame.ini" +2 0
Abort "You must play UT3 atleast once before installing this mod. (No UTGame.ini file found)"
/* Backup the original UTGame.ini before we start changing things */
CopyFiles /SILENT "$INSTDIR\Config\UTGame.ini" "$INSTDIR\Config\UTGame_RCE.bak"
File "C:\Documents and Settings\User Name\My Documents\My Games\Unreal Tournament 3\UTGame\Config\UTRace.ini"
ClearErrors
Push "$INSTDIR\Config\UTGame.ini" ; file to modify
Push "[TimeLimit_DM UTUIDataProvider_MenuOption]" ; string that a line must begin with
Push "[TimeLimit_DM UTUIDataProvider_MenuOption]$\r$\nOptionSet=RCE" ; string to replace whole line with
Call ReplaceLineStr
FlushINI "$INSTDIR\Config\UTGame.ini"
; Add logic to install the rest of the mod
SectionEnd

/**
function to replace a entire line in a text file
Copied from http://nsis.sourceforge.net/Replace_line_that_starts_with_specified_string
*/
Function ReplaceLineStr
Exch $R0 ; string to replace that whole line with
Exch
Exch $R1 ; string that line should start with
Exch
Exch 2
Exch $R2 ; file
Push $R3 ; file handle
Push $R4 ; temp file
Push $R5 ; temp file handle
Push $R6 ; global
Push $R7 ; input string length
Push $R8 ; line string length
Push $R9 ; global
StrLen $R7 $R1
GetTempFileName $R4
FileOpen $R5 $R4 w
FileOpen $R3 $R2 r
ReadLoop:
ClearErrors
FileRead $R3 $R6
IfErrors Done
StrLen $R8 $R6
StrCpy $R9 $R6 $R7 -$R8
StrCmp $R9 $R1 0 +3
FileWrite $R5 "$R0$\r$\n"
Goto ReadLoop
FileWrite $R5 $R6
Goto ReadLoop
Done:
FileClose $R3
FileClose $R5
SetDetailsPrint none
Delete $R2
Rename $R4 $R2
SetDetailsPrint both
Pop $R9
Pop $R8
Pop $R7
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
Pop $R0
FunctionEnd

Micah71381
11-05-2008, 06:03 PM
Here is a sample installer script for NSIS (Nullsoft Scriptable Install System) http://nsis.sourceforge.net/Main_Page
This is similar to the script that I wrote for the UTDomUI installer, because yes I do agree with you. Even with a fool-proof installer, there are those few people that will somehow find a way to mess-up the installation. And UTDomUI requires alot of ini file editing. and thus is why it is only available as a installer and no manual install is avabile.
This installer script will automaticly backup the UTGame.ini before making any changes then it add the OptionSet=RCE to the correct section. You can add more logic if needed, even add a uninstaller for the mod. Feel free to use this as a template / starting point if you would like to.

Thanks! This will likely come in very handy once I approach release. :)

wacko420
11-05-2008, 06:46 PM
In the end it's a user-experience thing. I definitely wouldn't expect an end-user to modify their .ini files because while it's easy for you and I, there are be plenty of people who have a hard enough time with standard installation wizards. This means I would have to provide an install script along with the mod that will set everything up for them.

Not a big deal, and only slightly error prone (the script could break if the .ini file is not created yet, such as before first-run or if they have modified it in such a way that the script can't find the right place to inject) but now the end-user is expected to trust me, whereas before they weren't. UT mods as they are currently implemented are sandboxed in such a way that the end-users do not have to trust the mod author when using a mod because the worst they could do is not work.

Of course, I can then offer two versions, one with an installer and one without an installer but instead with instructions on what file to modify, etc. Now we are back to dealing with the stupid user who chooses the "expert" install but runs into trouble with the setup process. This leads to support that I have to spend time doing instead of working on the mod (along with support for cases where the script fails).

In the end I may very well have to do something as you have suggested, but my hope with the original post was that there was some way to do it without having to modify anything outside my mod's directory (currently the mod install process is simply, "put folder into My Documents/MyGames/Unreal Tournament 3/UTGame/Published/CookedPC". I'm sure there are plenty of people here who will disagree with me in my assessment of how much the installation procedure matters but experience has taught me that little things like how easy the installation process is really do have an impact on the end-user's overall "mod experience".

A lot of what your talking about here is more or less at the fault of the Mod writer and not the people installing the mod... if you created a ini file it can be based on other ini files which would require NO editing at all by anyone, once the game was launched the ini file would be created correctly do matter what. Unless the author of the mod has done something wrong...

The way this generally works is Mod Author adds there stuff and then bases there ini file off the UT ini files, its done this way to make it easy for everyone, I would recommend looking into the BasedOn directive for the ini files, as thats really what you should be using.

Micah71381
11-05-2008, 07:54 PM
A lot of what your talking about here is more or less at the fault of the Mod writer and not the people installing the mod... if you created a ini file it can be based on other ini files which would require NO editing at all by anyone, once the game was launched the ini file would be created correctly do matter what. Unless the author of the mod has done something wrong...

The way this generally works is Mod Author adds there stuff and then bases there ini file off the UT ini files, its done this way to make it easy for everyone, I would recommend looking into the BasedOn directive for the ini files, as thats really what you should be using.

Are you suggesting that you could create a GameType with it's own OptionSet without having to modify any built in .ini files? If so could you go into more detail on how to accomplish?

Out of curiosity, if my mod's .ini file has a [TimeLimit_DM UTUIDataProvider_MenuOption] section in it, how does that affect UTGame.ini? Is it overridden? Is it extended?

wacko420
11-05-2008, 09:54 PM
Are you suggesting that you could create a GameType with it's own OptionSet without having to modify any built in .ini files? If so could you go into more detail on how to accomplish?

Out of curiosity, if my mod's .ini file has a [TimeLimit_DM UTUIDataProvider_MenuOption] section in it, how does that affect UTGame.ini? Is it overridden? Is it extended?

This is correct, which is what the person above mentioned, each mod has its own UTGame.ini file. The engine expect this file, but the mods files can have its own OptionSet and not have to add it to the base UTGame.ini file. if you add the following to your DefaultGame.ini:

[TimeLimit_DM UTUIDataProvider_MenuOption]
+OPTIONS HERE

[Configuration]
BasedOn=../../UTGame/Config/UTGame.ini


it will generate a UTGame.ini file for your mod and give you all the Unreal 3 stuff for free and include your stuff for free. I recommend going this route as it will allow you to not make changes to your base files and give you what you want.

Micah71381
11-06-2008, 03:00 AM
This is correct, which is what the person above mentioned, each mod has its own UTGame.ini file. The engine expect this file, but the mods files can have its own OptionSet and not have to add it to the base UTGame.ini file. if you add the following to your DefaultGame.ini:

[TimeLimit_DM UTUIDataProvider_MenuOption]
+OPTIONS HERE

[Configuration]
BasedOn=../../UTGame/Config/UTGame.ini


it will generate a UTGame.ini file for your mod and give you all the Unreal 3 stuff for free and include your stuff for free. I recommend going this route as it will allow you to not make changes to your base files and give you what you want.

I'm going to give this a try, it sounds like just what I was looking for. Just to verify (in case you get back to me before I get a chance to test it on my own), this works for GameTypes, not just total conversions right?

HKLM
11-06-2008, 04:37 AM
This is correct, which is what the person above mentioned, each mod has its own UTGame.ini file. The engine expect this file, but the mods files can have its own OptionSet and not have to add it to the base UTGame.ini file. if you add the following to your DefaultGame.ini:

[TimeLimit_DM UTUIDataProvider_MenuOption]
+OPTIONS HERE

[Configuration]
BasedOn=../../UTGame/Config/UTGame.ini


it will generate a UTGame.ini file for your mod and give you all the Unreal 3 stuff for free and include your stuff for free. I recommend going this route as it will allow you to not make changes to your base files and give you what you want.
Nice! I never gave the Configuration.BasedOn much thought. Thanks for the info! :D

eurosat7
04-16-2010, 09:37 AM
Sounds really great. The peace I'm missing:

Where do I have to place my game configuration file (and which name shoud I use, UTGame.ini?)
and do I have to tell it some other ini?
And will it load in the correct order or will by UTGame.ini be overloaded?

(sorry for beeing numb ;) )

BTW - Is it still working for Unreal Engine 3 (Beta 2010-03)?

HKLM
04-16-2010, 07:32 PM
Sounds really great. The peace I'm missing:

Where do I have to place my game configuration file (and which name shoud I use, UTGame.ini?)
and do I have to tell it some other ini?
And will it load in the correct order or will by UTGame.ini be overloaded?

(sorry for beeing numb ;) )

BTW - Is it still working for Unreal Engine 3 (Beta 2010-03)?

First off you should this article at Epic's UDN site:
Document Summary: How to configure various aspects of the Unreal Engine via configuration (.INI) files.
http://udn.epicgames.com/Three/ConfigurationFiles.html

After reading that. most of your questions will be answered.

I did make a working settings menu for my mod some time ago. But since then, I dropped support for this method in favor of using the "mod settings" feature that was added with the official 2.0 patch for UT3. This way, players would not have to start UT3 using the mod switch just to get access to the ingame settings menu.

Anyways if your still interested, heres some tips on getting to get the optionsets to work:
You will need to make changes to the DefaultEngine.ini and DefaultGame.ini files. NOTE: DO NOT ALTER THE INSTALLED GAMES INI FILES! To make the needed changes you have to make the changes done in your own ini file in your mods own config dir (<ut3 install path>\UTGame\Config\MyMod\DefaultGame.ini) You will also have to start UT3 with the mod switch ( UT3.exe -mod=-mod=Config\MyMod )

in your DefaultEngine.ini you will have to replace the UTDataStore_GameSettingsDM datastore with your own. There is no way around this, it must be done or it will not work.


[Engine.DataStoreClient]
-GlobalDataStoreClasses=UTGame.UTDataStore_GameSett ingsDM
+GlobalDataStoreClasses=UTMyMod.UTDataStore_GameSe ttingsMYMOD

[Configuration]
BasedOn=..\UTGame\Config\DefaultEngine.ini


now in your own DefaultGame.ini you can make the changes you want. For example:


[Configuration]
BasedOn=..\UTGame\Config\DefaultGame.ini

[UTMyModGame UTUIDataProvider_GameModeInfo]
...
GameSettingsClass=UTGameSettingsMYMOD
OptionSet=MYMOD
...

[GoalScore_DM UTUIDataProvider_MenuOption]
+OptionSet=MYMOD

[TimeLimit_DM UTUIDataProvider_MenuOption]
+OptionSet=MYMOD