UE3 - UT3 Hello, A question about rewrite array data type in config files.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

db123

New Member
Aug 10, 2009
6
0
0
:lol::lol: Hello, I have a question about rewrite the array data in config files. first, I create a new Pawn class which is inherit from pawn: ZombiePawn. Every ZombiePawn have several levels, every level corresponds a healthMax. so I define a struct to describe it:
struct Desc
{ int level; int heathMax; };
var() gloablconfig array< Desc > HeathMaxDesc;
I do this in config files:
+HealthMaxDesc = ( level = 0, healthMax=2000 )
+HealthMaxdesc = ( level = 1, healthmax=4000)
now, I have a special ZombiePawn, this pawn have a bigger HealthMax, so I wan't to rewrite this HealthMaxDesc array in configfile.
But I can't find the method to do this. On UDN, I find - !, but I don't know how to use it work with array data type.
thanks a lot.
 

Angel_Mapper

Goooooooats
Jun 17, 2001
3,532
3
38
Cape Suzette
www.angelmapper.com
Change globalconfig to config, and make separate ini sections for each. Like this:

Code:
[MyPackage.ZombiePawn]
HealthMaxDesc = (level = 0, healthMax=2000)
HealthMaxDesc = (level = 1, healthmax=4000)

[MyPackage.BiggerZombiePawn]
HealthMaxDesc = (level = 0, healthMax=10000)
HealthMaxDesc = (level = 1, healthmax=20000)

One question though, are you sure you should be making these configurable? It seems like you'd want to put something like this in the default properties instead so players can't change it.
 
Last edited:

db123

New Member
Aug 10, 2009
6
0
0
Hi Angel_mapper, Because this information will be valid on dedicated server and config file will be encrypted on client. I set them in config file because our Planner or LD can alter them at any time。
Thanks for your help, I will test your method later,
Missing cached shader **
Missing cached shader **
Missing cached shader **
^_^
 

db123

New Member
Aug 10, 2009
6
0
0
config
This variable will be made configurable. The current value can be saved to the ini file and will be loaded when created. Cannot be given a value in default properties. Implies const.

globalconfig
Works just like config except that you can't override it in a subclass. Cannot be given a value in default properties. Implies const.

In chinese:
config
这个变量是可以配置的。当前的值将被保存到一个ini文件中并在创建时加载。这个变量不能在默认属性中赋值。
globalconfig
和config的使用基本相同,除了您可以在子类中覆盖它,它不能在默认属性中赋值。
 

db123

New Member
Aug 10, 2009
6
0
0
:lol:
Change globalconfig to config, and make separate ini sections for each. Like this:

Code:
[MyPackage.ZombiePawn]
HealthMaxDesc = (level = 0, healthMax=2000)
HealthMaxDesc = (level = 1, healthmax=4000)

[MyPackage.BiggerZombiePawn]
HealthMaxDesc = (level = 0, healthMax=10000)
HealthMaxDesc = (level = 1, healthmax=20000)

One question though, are you sure you should be making these configurable? It seems like you'd want to put something like this in the default properties instead so players can't change it.


Thanks for your suggestion:lol: use 'config' is right, but we must add a '+' or a '.' for them. the total code like this:
Code:
+HealthMaxDesc = (level = 0, healthMax=2000)
+HealthMaxDesc = (level = 1, healthmax=4000)

[MyPackage.BiggerZombiePawn]
.HealthMaxDesc = (level = 0, healthMax=10000)
.HealthMaxDesc = (level = 1, healthmax=20000)
:D

Thanks again for all your help!:lol::lol:
 

db123

New Member
Aug 10, 2009
6
0
0
by the way, use 'globalconfig' is not right here, because I test it. O(∩_∩)O~
 
Last edited: