Community Page
- blog.garethj.com/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Thanks manatlan - that looks like a really useful tool. Will save me some time next time I need to do it.
- you should look at : http://www.manatlan.com/page/py2deb which does the same thing ...
- no worries Gareth - thanks for all the help youre sharing with everyone x hope portfolio goes well! all the best x
- Ubuntu has had its own solutions to *some* of these problems for a while (gnome-app-install) so I assume they are hesitant to swap to something else. Richard seemed to think they were very...
- Thanks for the overview Gareth. I'm surprised your Ubuntu install didn't put package kit on straight away, it's been default in Fedora so long I guess I've taken it for granted now.
Jump to original thread »
Lately I’ve been doing some work (I promise it is real work) with Battlefield 2. The server part of the game has a cut-down version of Python built in so that you can interact with it, modifying aspects of the game and reacting to events etc. More details on this can be found on this [...]
... Continue reading »
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
import urllib
webPageHandle = urllib.urlopen('http://blog.garethj.com/')
webPageContents = webpage.read()
Then obviously you'll have to parse webPageContents for the information you need and use the BF2 API to send that into the game. This page looks like a good tutorial if you need more help: http://www.voidspace.org.uk/python/articles/url...
Hope that's useful :)
1 year ago
Originally I wanted to use post methods, but I now think a simple get is more efficent for my level of coding. It also means that I can use the standard python lib that comes with bf2.
I appreciate the help.
1 year ago
1 year ago
1 year ago
2. Replace the Python library path at runtime to use the new libraries, e.g. edit ‘bf2/python/bf2/__init__.py’ and putting the equivalent of ’sys.path = ['/usr/lib/python2.5/', '/usr/lib/python2.5/lib-dynload/', 'python', 'mods/bf2/python', 'admin']‘ after the ‘import sys’ line.
Is what I did, but I did substitute my version for 2.5. I used locate to find the directories for python. I run the 64 bit version of bf2.exe so I figured 64bit libs would be a proper replacement.
1 year ago