Jump to content
Official BF Editor Forums
Sign in to follow this  
[SFaith] Woodrow

The Python Official Questions/Request Page!

Recommended Posts

Alright. For those curious, this is the current set of features that we, the community, are unable to do. This list also doubles as the central repository of requests that we, the active community, have for DICE should EA give them the time and permission to get about doing it :D .

For those wondering what can be done with Python, please read through our other posts on this board or check out http://bf2.fun-o-matic.org for the BF2 python wiki. Should you still have a question, please ask in another thread. Should your request prove to be unconquerable by us, the community, please contact me and I'll then be happy to add it to this list.

**ADDENDUM! I've actually had a chat with DICE on a few of these matters. While I haven't gained any answers, they have confirmed a few things here. They also expressed their wish to be able to extend python functionality in a future patch, however they do not currently have time. They also suggested we continue to ask, however, so that these issues are not forgotten.

--------------------------------------------------------

1) SuperB asks:

"Can we allow python to gain access to the rich language of the console variables in the BF2.exe through host.rcon_invoke(rcon_command) or another new command? This already works in BF2_r.exe, where python already has access. However, while this works in BF2_r.exe, the method fails to return the console readout back to python in BF2.exe"

UPDATE: THEY HAVE ADDED SUPPORT FOR THIS!

Sorry for the late update, but check out here on the forums as the very awesome SuperB, King of Camelot, and others hash it out to seriously pump up our python power in the Engine!

http://bfeditor.org/forums/index.php?showtopic=3546

http://bfeditor.org/forums/index.php?showtopic=3569

------------------------------------------------------

2) Quite a few of us have asked:

"Does anyone know if it is possible to change a player's kit in-game via python?" This has come up numerous times and is a feature that quite a few mods would like. There are multiple reasons for wanting it. anything from rewarding players to upgrading/changing models while a player is alive. While it is asked in several places, here's a link to one of our best (though not very successful) discussions.

http://bfeditor.org/forums/index.php?showtopic=1248

DICE comments: Unfortunately not. The kit drop / pickup is triggered in the engine and not exposed to python currently

3) [FH]ctz asks:

"Between 1.0 and 1.01, hosts.pers_plrSetUnlocks stopped working. Instead, it seems as though all this is done in BF2.exe itself away from teh python stuff now. Is this a bug or a permanant change to stop people running servers with unlocks available? If it is, can we come to some compromise like making pers_plrSetUnlocks work for mods which are not 'bf2'?"

Basically, there was great intention to make use of the kit unlocking system for quite a few things in different mods. Rewards for players in-game, tech trees, purchaseable upgrades, or even simply just alternate kit selections than the standard.

And while we do agree that regular BF2 unranked servers shouldn't have their stuff unlocked, this single stroke has crippled the plans of quite a few mods wishing to use the system in other ways. As such, a fix would be much appreciated.

http://bfeditor.org/forums/index.php?showtopic=235

DICE comments: Just as you think, this was removed so that server admins would not be able to give the players all unlocks so easily.

4) Woodrow asks:

a) "Is there any way of removing a player from a vehicle?" This actually stems from the failed question "is there any way to stop a player entering a vehicle that belongs to their team?" though if there is a way of performing either then the same result would be achieved. So a method to do either would be very welcome.

http://bfeditor.org/forums/index.php?showt...4&highlight=kit

DICE comments: There is currently no way that I know to do this, without killing the player or vehicle

B) Is there any way to change a player's squad from python? We can check what squad they are in, but sadly we can't reassign them to different squads. This would be nice for, say, assigning players to squads depending on what vehicle/vehicle type they enter, among other things.

(no link at this time)

DICE comments: As you suspect, changing player squads is not exposed to python either

5) ikik asks:

"Anyone know if it's possible to spawn a vehicle on the fly with python without it being in the map?" By map, I'm assuming not spawned on the map at the time, but perhaps an objectspawner ready-waiting in the .con/.tweaks.

The basic premise is it'd be wizard to be able to spawn stuff with python by feeding a vehicle (or vehiclespawner name) and a location into a command which is then passed into the game engine for a vehicle to be generated. At the moment SuperB has a workaround whereby we have an independent spawner buried deep below ground, high in the air, or way off the map which spawns vehicles that we then teleport to the spot as needed. However, this is not exactly preferable and rather clumsy.

http://bfeditor.org/forums/index.php?showtopic=1877

6) Packetloss asks (quite a lot of stuff actually! pulling the most interesting question, #4):

"4. Any documentation at all on the following would be most appreciated:

* host.sgl_sendPythonEvent

* host.sgl_sendGameLogicEvent

* host.sgl_getParam / host.sgl_setParam (specifically: what's available

to get/set?)

* host.ss_getParam (specifically: what's available to get?)

* host.pmgr_p_get / host.pmgr_p_set (specifically: what's available to

get/set?) "

He also asks "What's the best way to report Python-relaged bugs, so that DICE actually hears about them and they have a chance of being fixed?"

Amen to that brother. You can see his full question set at this link here:

http://bfeditor.org/forums/index.php?showtopic=172

7) Azaezel puts in a couple feature requests:

a) the .con commands set a whole host of different values, most of which can't later be changed on the fly. Perhaps some way to do that in the future may lend interesting results?

B) There's been some consternation concerning networkable objects. Is there any way we can get a list of what class functions utilise networkable coding so we know without a doubt what all we can do server side?

c) we've been having some trouble with moving control points about. Most precisely, they don't have networky attached to them, so if we warp control points about they don't move on the client side. Anyhow, that's the best light I can shed on it ATM :)

Our chappy here also tossed me this link this morning to add onto this, concerning point "a" (it's BF1942, but the same basic premise holds).

http://widowx.com/phpBB2/viewtopic.php?t=8726

-----------------------------------------------------------

That's about it for now. As/if I receive more information on these matters I'll update this page. And as far as it goes, DICE was fairly decent in its responses and the enclosing letter. While disappointing, it does confirm a few things and they do express a desire to continue helping, when they get a chance. So, it's up to us now to find ways to do these things until we see actual fixes. If anyone comes up with an answer to any of these, feel free to post them in this thread.

----------------------

**EDIT: 27-10-05: added question 7

**EDIT: 28-11-05: added DICE responses

Share this post


Link to post
Share on other sites

2 things. Chappies one of our testers :P

and the link has far more to do with point b, than a, as it contains indexes and functions pertaining to values which are calculated and held solely server-side, thus being able to be ssmed, and wich should in theory, be able to be stably manipulated if the functionality were available. (although as it's an ongoing project, that of course not the full list. (toldja I made origami for a living ;) ) (still bad at written explainations)

edit: ok, ill step out of the shadows long enough to note that one major *cough* difference, is in the instantanous ctds now caused by ssming a seperate kit from what the clients got. Prior to that, the only acual bug with it in 1942 was the visual kit selection icon. (sorry boss, had to give em somethin, mebey it'll help everybody)

Share this post


Link to post
Share on other sites

I would like to point out that the only feature we need is that python be able to use the debug console commands as outlined in request number 1. So we should make a point of pushing for that one that one.

Then all the rest become possible, and more.

I also think that question number 7 should be stricken from the record. As it is known.

7) Azaezel puts in a couple feature requests:  

a) the .con commands set a whole host of different values, most of which can't later be changed on the fly. Perhaps some way to do that in the future may lend interesting results?

Con files are con files they are not changable in real time. Period.

B) There's been some consternation concerning networkable objects. Is there any way we can get a list of what class functions utilise networkable coding so we know without a doubt what all we can do server side?

PCO's, players, Vehicles and Spawners, and their children, are networkable objects, on dedicated servers, everything else isn't.

c) we've been having some trouble with moving control points about. Most precisely, they don't have networky attached to them, so if we warp control points about they don't move on the client side. Anyhow, that's the best light I can shed on it ATM  

Make the control point a child of a PCO and then move the PCO and the control point will move.

Share this post


Link to post
Share on other sites

Real time? Not with the current exposed function set. However as they can be changed at mapload prior to clients connecting, and redefined without killing off clients for the next map it'sself, there should be little issue with

Forget it. Don't bother asking. Won't do any good anyway. Not here to pick fights.

Share this post


Link to post
Share on other sites

For Question #2, you can't physically change out the whole kit; however, why not add the 'rewards' directly to his kit on-the-fly? These temporary changes could be for one life, or for this player for the rest of the round. It is not complicated to do.

Share this post


Link to post
Share on other sites
For Question #2, you can't physically change out the whole kit; however, why not add the 'rewards' directly to his kit on-the-fly? These temporary changes could be for one life, or for this player for the rest of the round. It is not complicated to do.

How would you add rewards to the player's kit?

I know you can add weapons and all to a player's kit while he is spawned by "player.pickup weaponName", but this only works on local servers, I get an error on dedicated servers.

Share this post


Link to post
Share on other sites

I am wondering if it is possible to put a cap on classes. E.I. limit the numberof AT guys, or snipers, etc. Make a limit perteam or summat?

~NeVaR

Share this post


Link to post
Share on other sites

Hello everyone,

I have a request to customize freecam use. I know currently its able to be turned on and off. Im wondering if someone would be able to, when freecam is turned on, limit who can actually use it based on a set of game name prefixes.

Our tournament currently runs a custom autobalance module that restricts our armies to their respective sides, restricts people from joining when an army is over the prescribed amount of players over the enemy, reports those numbers on joins and disconnects with admins shown inside () EXAMPLE USMC 20(1) - MEC 16(2), and following a tournament rule of engagement bans for all chat.

While allowing our admins to all-chat freely, and swap sides. as well as Not count toward an armies actual in game numbers, for purpose of our "2 over" rule.

Id like to allow freecam use by our admins while restricting army tags from using it while dead, based on the prefix used.

Currently we are limited to actually playing, and team followcam mode to investigate matters.

Is this something that can be done?

Please send me a PM here or email at dave.smith@combatstudios.com If you may be interested in helping out with this project.

Edited by [CS]LuucEarth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×