View Full Version : access vars in inis
SwaTz0rs
11-26-2007, 02:57 PM
hey there...
can anyone tell me how i get access to settings stored in my custom ini file?
class myweapon extends UTWeap_SniperRifle config(myweapon);
var config int bAmmoCount;
var config int bMaxAmmoCount;
function setammo()....
{
...
...
...
what i want to do is make the AmmoCount configurable... but it wont work as it seems like the weapon doesnt have 'access' to the myweapon.ini
ut3 is so freaking different from ut99
:D
thanks in advance
You can save values out by creating a config-variable, changing it's value and calling SaveConfig() (also see Object.uc).
The value is read from the .ini-file if the object is created. I don't think there is a way to read it manually (perhaps ResetConfig()?).
Henrik
11-26-2007, 05:32 PM
put the variable in a section called
[yourpackagenamehere.myweapon]
bAmmoCount=whatever
bMaxAmmoCount=whatever
at the bottom of your ini.
ps, "b" in front of the name isn't normally used for stuff that isn't "true" or "false".
SwaTz0rs
11-26-2007, 06:21 PM
already got it working thanks anyways... some spelling mistakes in the config file...
uhm ye i know about the b its not called like this in my actual file
Dark[NSF]
11-26-2007, 07:16 PM
put the variable in a section called
[yourpackagenamehere.myweapon]
bAmmoCount=whatever
bMaxAmmoCount=whatever
at the bottom of your ini.
ps, "b" in front of the name isn't normally used for stuff that isn't "true" or "false".
so if i'm in my game replication info class how can i add server configurable options? Should it fall in a GameSettings category or a ROMGameReplicationInfo category?
my code
class ROMGameReplicationInfo extends UTGameReplicationInfo
config(GameSettings);
my ini
[ReignOfMilitias.GameSettings]
RespawnCountDown=20
Dark[NSF]
11-26-2007, 09:25 PM
nevermind, figured it out:
http://forums.beyondunreal.com/showthread.php?t=192252
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.