Talk:Main Page

From BF2 Technical Information Wiki
Jump to: navigation, search

Contents

Ninjas!

There have been a lot of Ninja edits recently, undocumented edits even in the Talk pages. "--~~~~" is all you have to enter for the Wiki to say who you are and when you did what you did. I like to know who I'm talking to, and I doubt I'm the only one. So please, let us know who you are. Thanks. --dst 07:41, 15 Sep 2005 (MDT)

By the way, you can get the same effect as typing "--~~~~" by just pressing the button in the edit toolbar that's second from the end on the right--it adds the --Woody 09:26, 22 Sep 2005 (MDT)secret-wiki-signiture-code to your posting automatically. --Woody 09:35, 15 Sep 2005 (MDT)


Does anyone have an idea of how or where to get the images for the ribbons and badges used in the game. I would like to include these in a stat tracking program I am writing. Thanks in advance.


See the File_Formats page for details of some of the file formats used within the game. You can find the awards in the Menu_client.zip archive, they're under \External\FlashMenu\images\awards.

--Vex 13:32, 13 Jul 2005 (MDT)

Can I open these images with Photoshop (6.0)? How do I view them?

See the link on the File Formats page titled "Nvidia DDS Plugin for reading and writing DDS files in Adobe Photoshop". That link takes you to a page where you can download a Photoshop plugin that lets you directly open DDS files from inside Photoshop. Works great! --Woody

can you tell me how to do this. I downloaded the plug-in for Photoshop from Nvidia, but have no clue what to do now. I click on one of .png files from the directory and get an error. Thanks.

nevermind...i found it...i just need to open the Atlas file...thanks for all your help tho.


I have been looking into using the "landot sniper limit" script. However I would like to try and get this change the players weapon back to their previous weapon they had or a default weapon should they have just joined the game. This is because the kick can put players off using the server.

I have seen there is a "bf2.PlayerManager" object. Does anyone know if this can be used to do the above?

Or perhaps you know another way of doing this?

Here is the landot sniper limit script I have been looking at: http://landot.org:8080/landot/sniper/document_view

Any help, much appreciated. --Hailo hailo.ceo@gmail.com


Alternate Battlefield Ranking

Hello there, i tried loads of resources, and i keep on coming back to this resource.

For finalizing our project, we could use some expirenced Python scripters. We are working on ABR - short for Alternate Battlefield Ranking. this system is identical to EA's ranking system. Currently we have  : A ABR Server Browser Client. Posibility of different Ranked Worlds. Custom Unlock-Award's Definitions - per world, a Web backend for Stats, Compatibility for scripts like bf2stats.com and SigScripts and more. Ranked MOD Servers Possible.

For those who feel they could contribute to this Project, please contact us at www.bf2scripts.com in the forum. the more help we get, the faster we can release this to the public.

You could also contact me at satcomnl (at) gmail.com --SatcomNL 15:26, 17 Aug 2005 (MDT)

Debug question

Firstly - this is my first use of a Wiki - sorry if this is not the place for this question. I am just starting to fiddle with BF2 scripting, and wanted to change the way autobalance.py works. It's already been done, but it is a learning experience for me. In any case, I want to see the debug output, so I set g_debug to 1 in __init__.py, and added a default.cfg specifying the name of the pythonlogfile. I start the dedicated server - then nothing - rather - the server runs, but I see no debug output or files created. Could you point me to where I might get info on how to properly do this?

Thanks Rob


Hi Rob! Nice to see some new faces around here. Anyways, back to your question. You can capture the Python debug information by one of two methods. The first method is described here: Debugging. That method writes the debug output from Python to a log file. The second method can be found about half way down this page under BF2 Python Log: BF2 Python Log. This is the method I use, as it displays the debug information in real time and in a seperate window. Hope this helps! If you have any other questions, be sure to ask, thats what we are here for.

--King of Camelot 14:29, 11 Sep 2005 (MDT)


Finding Key Hashes That Go With CD Keys

Hi I didn't know where to post this so here goes. I've had a problem getting to the download link for the CD Key Hasher. Some of the guys that got banned from our server would like a second chance so I need them to run the CD Key hasher so I know which hash is theirs.

Catheter-OMO 10/12/05 9:44 ET

Catheter: The same thing has happened to me before! That key hasher was posted by Panic; I've put a note on his Talk Page asking if he could fix it. In the meantime, we have a short Python program that does the same thing. If you don't want to use the whole program, here's a quick-and-easy way to do what you want:

  1. Install a copy of Python, if you haven't already done so.
  2. Go into the Python folder and double-click python.exe to open an interactive Python window.
  3. At the >>> prompt, type import md5 and press "enter".
  4. You'll get another >>> prompt; type the following, replacing the fake CD-key I'm using as an example, with your real one:
 print md5.new("j6eky8jmht2pqqrfy21e").hexdigest()

Python will print the key hash that corresponds to your CD-key, and then give you another >>> prompt. Repeat as many times as you need. IMPORTANT: the CD-key must be typed in ALL lower case, with no dashes or spaces. --Woody 10:06, 12 Oct 2005 (MDT)

Map Config

Is there a .con file that points the application to where the level maps are located?

Can it be modified so that you can place the maps elsewhere, other than the default location?

Thanks --SuperNovaCain 11:36, 20 Sep 2005 (MDT)SuperN¤vaCain


There is no .con configuration option for level map locations; they are always in Battlefield 2 Server/mods/<mod name>/Levels. The only way I know of to put the maps somewhere else is to make the Levels directory a link to somewhere else in the file system--but then all your maps will have to be in the directory the link points to, so it's not a very flexible solution. Some of the BFX servers (I'm not sure about BF2 at this point--I haven't tried it) have a command-line option called +overlayPath that allows you to put some of the server's files in an alternate location, but I think this only works for settings and log files, not for map files--the idea behind the option was to make it easy to run multiple instances of a server on a box, not to allow critical server data files to be moved around. --Woody 14:25, 21 Sep 2005 (MDT)


To let you know where I'm going with this logic... I'm trying to see exactly how quickly I can go from picking a map, to playing it (so I'm talking client not server config). I've thought of putting my levels on a ram disk. On boot, I will have to copy all levels onto the ram disk and theoretically, I should get astronomical load speeds.
Your suggestion to "make the Levels directory a link to somewhere else in the file system"... what do you mean by this? Make it a shortcut to the actual directory? Some type of virtual directory?
Your help is appreciated. --SuperNovaCain 08:22, 22 Sep 2005 (MDT)


Interesting idea; I don't know if it will work, but it's certainly worth a try. From what I've seen the long load times at level change are not because your hard disk is slow, but because of the way the BF2 game engine works, (a) needing to decompress the level .zip file into lots of little config files that it needs to read, resulting in lots of disk accesses, and (b) reading and interpreting all those data files, building the data structures a level needs in memory from their instructions, etc. This approach gives a lot of flexibility and makes it easy to mod BF2, but results in really long load times.

Having more RAM on your machine does make level loading go noticably faster; I'm guessing that's because the game engine can decompress the level .zip files et al into RAM. If that's true, then just having more RAM on your machine will already give you most of the advantage of having a RAM disk, and beyond that the only thing that would accelerate loading further would be a faster processor.

Nevertheless, I could be wrong about all that, and the RAM disk idea is certainly worth trying. Clarification on my suggestion about using a "link": I was refering to a Linux symbolic link; links allow you to have what appears to be a directory at a certain point in the file system hierarchy actually be somewhere else--for example, on another disk, or even a RAM disk--just what you want! Windows has the same sort of facility, called, as you suggested, a "shortcut". Under Linux, links behave exactly like normal directories; under Windows things don't always work as you would expect, and whether a shortcut looks like a directory or a file depends on how the software that's trying to access it is written--so BF2 will certainly work correctly with links under Linux, but there's no way to tell if BF2 will respect and follow shortcuts under Windows without trying it. Good luck! --Woody 09:26, 22 Sep 2005 (MDT)

Differences Between 1.02 and 1.03

Here's the output of "diff -ur" for all the Python files in the 1.1284.0 and 1.1.2551.0 Linux dedicated servers. http://i.dackz.net/misc/code/bf2.verbose.diff

Here are md5sums for all the Linux dedicated server installers, straight from largedownloads.ea.com. You shouldn't really trust these though, as I could be making it all up, but EA doesn't provide md5sums on their own. Oh well.

6da85c133271fce4d7b8da7f70e74e07  bf2-linuxded-1.0.2442.0-installer.sh
5e57184d65a60cb507a2f32579cb9904  bf2-linuxded-1.0.2446.12d-installer.sh
69714922293f711988fe4009213961ff  bf2-linuxded-1.1.2475.0-installer.sh
50d119d8f4dbcfc71b197874dfbb1ceb  bf2-linuxded-1.1.2484.0-installer.sh
03a9e5db085a223bac49f80e8d377125  bf2-linuxded-1.1.2551.0-installer.sh

--Dackz 23:33, 4 Oct 2005 (MDT)


Differences Between 1.03 and Whatever

--- bf2-old/python/bf2/stats/constants.py       2005-09-23 11:16:20.000000000 -0400
+++ bf2/python/bf2/stats/constants.py   2005-11-09 13:10:14.000000000 -0500
@@ -167,7 +167,20 @@
        "usmin_claymore"        : WEAPON_TYPE_CLAYMORE,
        "defibrillator"         : WEAPON_TYPE_SHOCKPAD,
        "at_mine"               : WEAPON_TYPE_ATMINE,
-       "simrad"                : WEAPON_TYPE_TARGETING
+       "simrad"                : WEAPON_TYPE_TARGETING,
+
+# xpack1 stuff
+       "insgr_rpg"             : WEAPON_TYPE_ATAA,
+       "rurif_oc14"            : WEAPON_TYPE_ASSAULT,
+       "sasrif_fn2000"         : WEAPON_TYPE_ASSAULT,
+       "sasgr_fn2000"          : WEAPON_TYPE_ASSAULTGRN,
+       "sasrif_g36e"           : WEAPON_TYPE_ASSAULT,
+       "sasrif_g36k"           : WEAPON_TYPE_ASSAULT,
+       "sasrif_mg36"           : WEAPON_TYPE_LMG,
+       "sasrif_mp7"            : WEAPON_TYPE_SMG,
+       "spzrif_aps"            : WEAPON_TYPE_ASSAULT,
+       "usrif_fnscarh"         : WEAPON_TYPE_ASSAULT,
+       "usrif_fnscarl"         : WEAPON_TYPE_CARBINE,
 }

md5sum for new installer:

7e8bf36321aec07a78199510c6a6365d  bf2-linuxded-1.1.2554-356-installer.sh

Also, curiously enough the new server files have ranking-related python files in them. The usual files for normal ranking aren't there, but ranking files for the expansion pack are. I haven't really been keeping up with BF2 lately, so I'm not sure if this was intended or not.

--Dackz 12:46, 23 Nov 2005 (MST)

  • I downloaded the Windows version of the sever, and didn't see the files you were talking about. What are the file names for these ranking files? --King of Camelot 02:35, 26 Nov 200 5 (MST)
    • Well it's in the Linux archive, but I'm not sure if they're extracted by the installer. I'd rather not say too much about it, but you can actually run a "ranked" xpack server with these files, though the stats collected will be ignored by GameSpy. --Dackz 09:59, 26 Nov 2005 (MST)

Unlocking Server Commands

I should've figured this out a while ago, but if you want to use those "unauthorised" commands like pythonHost.reinitialize, running the server with "+noStatusMonitor 1" seems to enable them!

There's a way to do this without disabling the status monitor, but the overhead for running a command with that method is kind of high. I may post the script for doing that in the future. --Dackz 10:30, 26 Nov 2005 (MST)

Question about PlayerScore Object

Hi all, This wiki is a great resource! However, I have been banging my head (figurtively :-) against a wall with one problem.

I am currently trying to generate some very slimmed down logs (low overhead) for "realtime" use at LAN parties. I want to track users by IP and simply get their Nickname, score, kills and deaths at the end of each round. All stats parsing will be done on a seperate server.

With help from your "Object Reference" section I was able to insert this code into stats.py where it processes and finalizes each player at the end of a round: (* = original EA scripting, @ = my added code)

*   for p in bf2.playerManager.getPlayers():
@     f=open('C:\...newlog.txt', 'a')
@     print >> f,str("IP: " + p.getAddress()) + str("Name: " + p.getName()) + ",Round ID: " + str(p.index)
@     f.close()
*     p.stats.wasHereAtEnd = 1
*     finalizePlayer(p)

I'm am pretty new to Python so this could just be a syntax issue, but the last statement in the print line "str(p.index)" will only work for "index" and I need "deaths", "kills" and "score". I have tried other class attributes in the "bf2.PlayerManager.PlayerScore" section and I only get something to the effect of "<bf2.PlayerManager.PlayerScore instance at 0x030C0238>" (when I try "str(p.score)").

I notice that your list differentiates between "Class attributes stored in the PlayerScore object" and " Class attributes stored in the BF2 engine" but I am not sure how I am supposed to call them differently. Am I missing something obvious?

Thanks for any help,

--Fodder 15:47, 10 May 2006 (MDT)Fodder


Let's see if this helps. . . if p is a player object (more accurately, an instance of class bf2.PlayerManager.Player), one of it's attributes will be p.score; that attribute turns out to contain another object, this one of an instance of class bf2.PlayerManager.PlayerScore (that's why when you try to access p.score you get back an object). To access that object's attributes, such as deaths (the number of times the player has died, you would use p.score.deaths. Same for p.score.kills and p.score.score. To try to make this more clear, in the last case (p.score.score), you're accessing the score attribute of the Player object in p, which happens to contain a PlayerScore object, then accessing the score attribute of that PlayerScore object (DICE confused things by using the name "score" for more than one thing, but it works, since Python isn't as easily confused as us humans).

You're right, the distinction about where attributes of PlayerScore objects are stored isn't very clear and needs to be explained more (I'll put that somewhere on page 127 of my to-do list). All of the attributes are accessed the same way (as shown in the examples in the last paragraph), but internally the PlayerScore object handles request to read different attributes in different ways:

  1. some attributes (e.g. p.score.repairs) are simple attributes of the PlayerScore object itself;
  2. others (e.g. p.score.deaths) are actually methods that, when invoked, pull data out of the core BF2 game engine and return that;
  3. still others (e.g. p.score.dkRatio) are methods that pull data from different places, do a calculation with it, and then return the result of the calculation.

To someone writing a Python script, the difference between these doesn't matter unless you're trying to change the value of one of these attributes: the first ones are easy to change, since they are just Python objects; the second ones may or may not be changeable by Python, since they live in the game engine, not the Python interpreter, so they can only be changed if the game engine provides a way to do so; and the third ones can't be changed because they are just calculations, with no stored value of their own. If you're only trying to read their values, then none of this matters--you treat them all the same.

--Woody 18:49, 11 May 2006 (MDT)


Nice, that was exactly what I needed to know! It now works like a charm. :-)

Thanks so much for the help, Woody.

--Fodder 17:22, 13 May 2006 (MDT)

Query Interval

Hey, does anyone know the minimum time interval allowed between queries to the bf2 master statistics server? or is there none? - Danielphin 07:18, 18 June 2006 (MDT)

Personally I don't know for sure but I know I queried the heck out of it when testing my app with no probs. I also query it for each of the people in a persons buddy list and have been testing with about 30 people so it queries them right after the other with no issues, so it *looks* like there's no min interval.

Battlefield 2142

Are we adding BF2142 information here (ie, to bf2tech) or will there be a 2142tech for this purpose? - 23:52, 2 October 2006 Kurt

I emailed the admin back in mid August on the subject of creating a 2142 wiki and he said he hadn't the intention to start a new wiki unless the underlying engine changed radically. It appears that it hasn't changed all that much so I suspect that bf2tech will be the home for 2142 as well. --Danielphin 08:31, 2 October 2006 (MDT)

Ok, may as well crack on and add stuff here then. Seems most of it is fundamentally similar but there is enough new stuff with 2142 to make it worthwhile adding various bits and bobs.

Yup, just to confirm: BF2142 information is very welcome here; just please be sure that if you post something that is only relevent to BF2142 alone, that it is labeled as such. --Woody 12:22, 3 October 2006 (MDT)

Battlefield 2142 In Game Advertising

Anyone else working on this? Could be useful to compare notes before adding an article.--Kurt 07:31, 11 October 2006 (MDT)

Whats there to work on? --Danielphin 07:33, 11 October 2006 (MDT)

How it works and all that. Or has everyone else done this already?--Kurt 08:10, 11 October 2006 (MDT)

how to block the ads --MadHatter 11:46, 16 November 2006 (MST)

bf2142 server stats port?

Hello,

does anyone knows how to find out what port the server stats are send in bf2142 when is other than 29900?

if I only have the ip and and game port

ex. Xxx.xxx.xxx.xxx:port when port is not 16567

how do I find what port to query to get the server stats?


If you only know the ip and game port, you need to query the Gamespy master to get the query port. There are not hard and fast rules as to what the port can be.

What are you actually trying to do though? Querying a server will only return that specific server info, it's got nothing to do with stats. --Kurt 05:04, 20 November 2006 (MST)

Add more layman's info

I'm a new user who found this site while trying to find specific info on the individual soldier classes in the unmodded version of the game. I use wikimedia sites to get knowledge on just about everything, and I would personally like to see more conventional information on the game that may or may not be related to modding. I am currently writing a personal evaluation on individual soldier classes that I want to show to my friends at my local weekly LAN get-together. You know, to teach the noobs. Anyway, I would like to see layman-friendly, encyclopedia-type articles on specifics in the game. I'd like to know about things like the different maps, vehicles, soldier classes, etc. I'm just saying a BF2 wiki would be the ideal site for this.

---

I agree, but I believe that this Wiki is intended for the advanced community such as the Modders and those that like to know exactly how things work. You could Google about for UBAR or try http://wiki.bf2s.com/ User:OSVigilante

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox