[bfprog] Configuration Variables?
Forrest Thiessen
thiessen at cyberscapearena.com
Mon Jul 25 08:06:12 PDT 2005
There's a function in the wiki "cookbook" section that accesses
configuration variables:
http://bf2.fun-o-matic.org/index.php/Cookbook:Finding_the_Value_of_a_Server_Configuration_Variable
It works great on standard config variables built into BF2. However,
the second part of your question is about putting your own custom
variables into the main BF2 .con files, and I have *not* found a way to
get that to work, yet. I tried adding a line to ServerSettings.con, for
example, that said "sv.forrest 1". When I try retrieving the value of
sv.forrest, I get an error--something like "unknown variable" (it might
be slightly different--I don't remember the exact wording of the error).
You can always make your own .con file, and read and parse it during
game startup, but I understand why you'd prefer to use the existing
configuration mechanism.
--Forrest (aka "Woody")
Andrew Armstrong wrote:
> Hey,
>
> For the love of gawd, help me! :)
>
> I have been working on a script file that will reject people who dont
> meet a minimum rank. This works as intended.
>
> However, I *do not want* to have to hard code the 'min required rank'
> variable in the python script - this is not acceptable (multiple
> configs etc among other things).
>
> I want to be able to say in the server config file put:
>
> sv.minrank = 1
>
> Just as an example.
>
> And then retrieve it in my script via:
>
> if (playersrank < (getSetting('sv.minrank'))
> ... kick em
>
> Once again, jsut an example (getSetting() is made up).
>
> Surely theres an easy way to make such variables accessable?
>
> Trying to figure this out is driving me insane - Any help would be
> appreciated!
>
> Cheers,
> Andrew
>
>------------------------------------------------------------------------
>
>_______________________________________________
>BFProg mailing list
>BFProg at lists.matureasskickers.net
>http://lists.matureasskickers.net/mailman/listinfo/bfprog
>
>
More information about the BFProg
mailing list