Talk:Feature Requests

From BF2 Technical Information Wiki
Jump to: navigation, search

Python Scripting

  • Expose os subsystem to allow directory scanning for plugins.

It's already exposed. Just doing "import os" should work -- actually, I haven't tested this thoroughly, but I've noticed that the "pickle" module does not work, though cPickle does.

  • Allow use of pythonHost object in server console so user-created scripts can be controlled there.

This could potentially be worked around if an entire replacement console was made. It probably wouldn't be too hard to do, just have it update general server info every X milliseconds, print out interesting server events like connects/disconnects and chatter, and forward input to the original console via host.rcon_invoke().

os module

The standard os module doesn't work--you can import it, but not use any of it's methods--doing so generates "no such method" exceptions. If you check os.__dict__ you can see a few attributes from the original, but none of the methods. . . and even the attributes don't work, even though they're listed.

I suspect this was done intentionally, for security reasons--nerfing the os module is a lot like a Java "sandbox"--it makes it harder (but by no means impossible) to access the operating system and the file system.

(MPUKBoffbowsh) Yeah, I've had to modify urllib to not use anything OS specific. Here's my Working Url Lib. It only works for urlencode, i've had to use sockets for HTTP

I've managed to get the os module imported, but it seems that it's not possible to use os.path as the os specific modules that it requires are not included in the intepreter as builtins (as they normally would be, so this is what they did to disable the module). I believe that it's possible to use only most of the functions that are directly defined in os.py which I think are quite useless (makedirs, removedirs, renames, exec*, spawn*). I'm not sure if even those work. os.walk depends on the os.path module. --DOb 17:53, 13 Jul 2005 (MDT)

HUD: Less/Greater operators

Does anybody know if there are operators for less and greater in the HUD Con-files? I know there is EQUAL, AND, OR, NOT but no LESS, GREATER :(

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox