[Question] Scripting references?
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
[Question] Scripting references?
Hey all.
Well, I decided to start coding for BF2 and PR. I've been coding for years now on the unreal engine where I worked on additions for a mod called Infiltration.
Anyway, I'm looking for references concerning coding for BF2 and, possibly PR. A good start point for Unreal coding is the unreal wiki (a wiki covering about anything concerning coding in the unreal engine - describing base functions, classes and all). Does something like that exists for BF2?
For PR, is there any existing documentation on the code?
As a first experiment, I'd like to write a QM report script allowing commander and squad leaders to have an overview of issued kits and available kits.
I'd also like to experiment a few Ideas I have on kit moderations systems.
Anyway, I'll be around.
Well, I decided to start coding for BF2 and PR. I've been coding for years now on the unreal engine where I worked on additions for a mod called Infiltration.
Anyway, I'm looking for references concerning coding for BF2 and, possibly PR. A good start point for Unreal coding is the unreal wiki (a wiki covering about anything concerning coding in the unreal engine - describing base functions, classes and all). Does something like that exists for BF2?
For PR, is there any existing documentation on the code?
As a first experiment, I'd like to write a QM report script allowing commander and squad leaders to have an overview of issued kits and available kits.
I'd also like to experiment a few Ideas I have on kit moderations systems.
Anyway, I'll be around.
-
e-Gor
- Retired PR Developer
- Posts: 3752
- Joined: 2006-03-06 22:40
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
I'm still trying to figure things out. The wiki is a good start, but lacking some basic information.
I see that in PR, all scripts are compiled python scripts on ...\mods\pr\python\game (except the config files)
Of course, there isn't much I can do with a compiled script I guess.
The variables I need to access are variables only related to PR (kit system). Is there a way to get a list of them somehow. Or could someone tell me how to access them if I list those I need? (because I guess I can't count on the source code
). Or am I missing something about the compiled python code and what can be done with it.
Or maybe I need the server files (I only looked at the client files).
I see that in PR, all scripts are compiled python scripts on ...\mods\pr\python\game (except the config files)
Of course, there isn't much I can do with a compiled script I guess.
The variables I need to access are variables only related to PR (kit system). Is there a way to get a list of them somehow. Or could someone tell me how to access them if I list those I need? (because I guess I can't count on the source code
Or maybe I need the server files (I only looked at the client files).
-
e-Gor
- Retired PR Developer
- Posts: 3752
- Joined: 2006-03-06 22:40
Sorry, this thread fell off my radar somehow.
Yes, the python code is closed up... blame certain server admins for that. And we can't distribute the uncompiled python, as this could be used in place of the compiled ones on servers. The server has the same .pyc files as the client.
This was done mainly to prevent server side modding, as we've had some bad experiences with that in the past and have decided to no longer support it.
You should be able to add functionality, but changing PR functionality is not really possible. So the only way to get around this is to write your own QM script from scratch and replace the PR one with that, unfortunately.
Yes, the python code is closed up... blame certain server admins for that. And we can't distribute the uncompiled python, as this could be used in place of the compiled ones on servers. The server has the same .pyc files as the client.
This was done mainly to prevent server side modding, as we've had some bad experiences with that in the past and have decided to no longer support it.
You should be able to add functionality, but changing PR functionality is not really possible. So the only way to get around this is to write your own QM script from scratch and replace the PR one with that, unfortunately.
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
Exactly as I thought by looking through the PR files. Thanks for the reply. I'm a bit disappointed, but meh. I had hoped I could bring my experience in here to help improve the game. But I'm no modeler, no mapper, and a bad animator (although I manage to get good work done, but it takes me hours). Coding is really my force.[R-DEV]e-Gor wrote:Sorry, this thread fell off my radar somehow.
Yes, the python code is closed up... blame certain server admins for that. And we can't distribute the uncompiled python, as this could be used in place of the compiled ones on servers. The server has the same .pyc files as the client.
This was done mainly to prevent server side modding, as we've had some bad experiences with that in the past and have decided to no longer support it.
You should be able to add functionality, but changing PR functionality is not really possible. So the only way to get around this is to write your own QM script from scratch and replace the PR one with that, unfortunately.
I do understand why you decided to make such things impossible. Sad, but understandable.
If the code is unavailable, could it be possible to have a list of variables giving me information on kit distribution? Or would knowing those variables allow me to access and modify them, making SSM possible, which would go against the idea of not releasing them in the first place?
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
I'd like to work on a reporting system to give SL and CO an overview of the available and issued equipment, which squads has what, etc. That's the basic idea.
To that, there are many things I wanted to experiment with; for the sake of learning on how the BF2 engine works and how to code for it:
- kit moderation (squad leaders need to approve kit selection)
- kit allocation (CO allocates kits to SL or SL request kits for their squad)
- kit info for players (players know which kits are available to their squads)
- Vehicle inventory (for SL and CO to know what vehicles are available)
First implementation would be text based. Eventually (and as possible) integrated in the BF2 command interface.
For the command interface, I'd also like to work on a better information system for squad leaders to get feedback from actions done by other SL in the team and on a maker system for CO and SL to mark areas (other than using the infamous "boat spotted").
To that, there are many things I wanted to experiment with; for the sake of learning on how the BF2 engine works and how to code for it:
- kit moderation (squad leaders need to approve kit selection)
- kit allocation (CO allocates kits to SL or SL request kits for their squad)
- kit info for players (players know which kits are available to their squads)
- Vehicle inventory (for SL and CO to know what vehicles are available)
First implementation would be text based. Eventually (and as possible) integrated in the BF2 command interface.
For the command interface, I'd also like to work on a better information system for squad leaders to get feedback from actions done by other SL in the team and on a maker system for CO and SL to mark areas (other than using the infamous "boat spotted").
-
danthemanbuddy
- Posts: 842
- Joined: 2006-11-12 19:07
-
KingofCamelot
- Retired PR Developer
- Posts: 2365
- Joined: 2006-01-07 18:17
No offense mate, but you're really looking at doing stuff that is pushing the limits of Python in BF2, and far beyond your knowledge at the moment. Its extremely hard to communicate information to just one player from the server, hence all the kit request spam in-game. I've experimented with ways and have found a method which works, but it requires the cooperation of both the Python code and the HUD coding. Still in experimental phase.geogob wrote:I'd like to work on a reporting system to give SL and CO an overview of the available and issued equipment, which squads has what, etc. That's the basic idea.
To that, there are many things I wanted to experiment with; for the sake of learning on how the BF2 engine works and how to code for it:
- kit moderation (squad leaders need to approve kit selection)
- kit allocation (CO allocates kits to SL or SL request kits for their squad)
- kit info for players (players know which kits are available to their squads)
- Vehicle inventory (for SL and CO to know what vehicles are available)
First implementation would be text based. Eventually (and as possible) integrated in the BF2 command interface.
For the command interface, I'd also like to work on a better information system for squad leaders to get feedback from actions done by other SL in the team and on a maker system for CO and SL to mark areas (other than using the infamous "boat spotted").
However, I do plan on adding the kit availability into v0.7, so theres one of your wishes.
Ruthless Executioner of 280 SpamBots
Retired Lead Coder for Project Reality - 0.25 through 0.4
Retired Lead Coder for Project Reality - 0.25 through 0.4
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
No offense taken, KOC.
I very well know it is beyond my current knowledge. That's the point as it is my way to learning the engine. I do know that I will constantly hit myself at things that can't be done. But since I'm that stubborn, usually I find my way around of making these things that can't be done. It somehow worked well for me in the past.
You have to understand that those are not wishes I have for PR. Although I do think experimenting with them in the development would be a good idea to see how they turn out, that wasn't the point of this project. I do not intent nor plan on making a polished up working and stable version of any of this. The idea is to have a project to work on to learn the engine, PR and limitations (and imagining ways to go around them). In the end, some good idea could be pushed forward, but that would just be collateral damage
I don't have the intention to work on all these ideas at the same time either, for obvious reasons. Once I get more experienced with the engine, we'll take about making wishes for PR real... but not at this point.
Coding is something I do as a hobby and, frankly, it's damn more interesting than the game itself - even if my code never gets into the game
I like to do little experiments with games and engines, like that penetration code Beppo and I wrote for Red Orchestra. (A game which I never really played nor coded for except for that one experiment). That was my first and last mod for Unreal2/RO. Took me about a week to start in from scratch and get it working reasonably well online on a full server - finding a few bugs in the RO code in the process and doing something the RO devs official announced as impossible.
There's no better way to test some code: "Hey! That function shouldn't return zero all the time...!" hehe
Just that we're clear on that. It's not a suggestion I'd like to make real myself
Just a way for me to get into coding for BF2/PR - even if it never works.
Anyway, I find this place strange. I see mapping, modeling, and all sort of other art content related discussion on these modding forums, but really no coding "community". :S
I very well know it is beyond my current knowledge. That's the point as it is my way to learning the engine. I do know that I will constantly hit myself at things that can't be done. But since I'm that stubborn, usually I find my way around of making these things that can't be done. It somehow worked well for me in the past.
You have to understand that those are not wishes I have for PR. Although I do think experimenting with them in the development would be a good idea to see how they turn out, that wasn't the point of this project. I do not intent nor plan on making a polished up working and stable version of any of this. The idea is to have a project to work on to learn the engine, PR and limitations (and imagining ways to go around them). In the end, some good idea could be pushed forward, but that would just be collateral damage
I don't have the intention to work on all these ideas at the same time either, for obvious reasons. Once I get more experienced with the engine, we'll take about making wishes for PR real... but not at this point.
Coding is something I do as a hobby and, frankly, it's damn more interesting than the game itself - even if my code never gets into the game
There's no better way to test some code: "Hey! That function shouldn't return zero all the time...!" hehe
Just that we're clear on that. It's not a suggestion I'd like to make real myself
Just a way for me to get into coding for BF2/PR - even if it never works.
Anyway, I find this place strange. I see mapping, modeling, and all sort of other art content related discussion on these modding forums, but really no coding "community". :S
Last edited by geogob on 2007-09-06 05:44, edited 1 time in total.
-
KingofCamelot
- Retired PR Developer
- Posts: 2365
- Joined: 2006-01-07 18:17
Theres no community coding section cause theres really not a ton to discuss.
Theres also not a ton of great coders in the BF2 community, only a dozen or so. Luckily we have some good ones on the PR team. 
I realize that you're trying to experiment to learn and see what you can do, and thats always been my attitude, its the best way to do it IMO. However, you're going to want to set simpler projects to learn how everything works. To accomplish the projects you mentioned you need a very solid understand about how Python and the engine interacts, as well as good knowledge about the engine in general, etc. Its a little much to just jump right into. Personally I'd suggest some smaller goals first to help you cement the basic understandings and build up from there.
I realize that you're trying to experiment to learn and see what you can do, and thats always been my attitude, its the best way to do it IMO. However, you're going to want to set simpler projects to learn how everything works. To accomplish the projects you mentioned you need a very solid understand about how Python and the engine interacts, as well as good knowledge about the engine in general, etc. Its a little much to just jump right into. Personally I'd suggest some smaller goals first to help you cement the basic understandings and build up from there.
Ruthless Executioner of 280 SpamBots
Retired Lead Coder for Project Reality - 0.25 through 0.4
Retired Lead Coder for Project Reality - 0.25 through 0.4
-
geogob
- Posts: 294
- Joined: 2007-03-07 16:36
You know the engine better than me, so I'll follow your advice on this. I'm really surprised there aren't more coders than that. Being from the Unreal community where coding is very active, it's really a surprise. I have the feeling it's not the complexity of the coding process that in cause, but more the lack of documentation on the engine interaction with the code. Coding for en engine without proper documentation is quite frustrating. I can see why many are not interested in it.
Sad part is that i'm pretty sure this documentation exists. It just hasn't been released.
Sad part is that i'm pretty sure this documentation exists. It just hasn't been released.
-
KingofCamelot
- Retired PR Developer
- Posts: 2365
- Joined: 2006-01-07 18:17
-
KingofCamelot
- Retired PR Developer
- Posts: 2365
- Joined: 2006-01-07 18:17

