Talk:Cookbook:Ploting Object Positions on a Map Image

From BF2 Technical Information Wiki
Revision as of 10:13, 29 March 2006 by Woody (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

the real question is ( i think ) can you get this PIL component to work inside BF2! any suggestions? as im not really into how pyton is embedded in bf2. cant we just init the py files? --SatcomNL 08:01, 2 Aug 2005 (MDT)

Yes, you can! I've had similar questions about making other external libraries work with BF2; I'll write up how you do it as a separate Cookbook article over the next week. The short answer is that you just need to put the PIL files where the BF2 Python interpreter can find them, and then everything will work. The directories BF2 looks in by default are:

  • Battlefield 2/pylib-2.3.4.zip (a zip file containing the standard library)
  • Battlefield 2/python
  • Battlefield 2/mods/bf2
  • Battlefield 2/admin

You can either add the directory where PIL lives to this list, or you can put PIL in one of these directories. The trickier parts are that you need to be sure to use the correct version of PIL (BF2 uses an old version of Python, so you have to use an old version of PIL), and find all the pieces of PIL. I'll write something up with the details, soon. --Woody 11:02, 2 Aug 2005 (MDT)


That's really cool. How exactly did you gather the position data? Is it by some event listener Python thingy?

I got the position data by registering a handler for PlayerDeath events that, when called (which is whenever a player dies), would just print the dying player's coordinates out to a log file. --Woody 11:13, 29 March 2006 (MST)

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox