project reality header
Go Back   Project Reality Forums > PR:BF2 Mod Forums > PR:BF2 Community Modding > Modding Tutorials
21 Sep 2024, 00:00:00 (PRT)
Register Developer Blogs Members List Search Quick Links
Modding Tutorials Information and tutorials related to modding BF2.

Reply
 
Thread Tools Display Modes
Old 2009-07-14, 20:49   #11
MAINERROR
Retired PR Developer
Supporting Member

MAINERROR's Avatar
Default Re: Python coding in BF2

Well you can program a ASCII banana in Python.
MAINERROR is offline Reply With Quote
Old 2009-07-15, 17:25   #12
crazy11
Retired PR Developer

crazy11's Avatar
Default Re: Python coding in BF2

Here is a pretty good tut Non-Programmer's Tutorial for Python 2.0 - Wikibooks, collection of open-content textbooks


You miss 100% of the shots you don't take.- Wayne Gretzky
crazy11 is offline Reply With Quote
Old 2010-01-24, 13:31   #13
j0g32
Default Re: [Python Tutorial] Python coding in BF2

is there some kind of tutorial for beginners ?
I mean, I could read thousands of python tutorials by not knowing wich modules etc. to import and what these methods and callbacks are returning etc. in order to let your script working FOR BATTLEFIELD 2 / Project Reality.
Do i have to completely learn python itself if I'd like to do some coding in Bf2 ?
or is there some kinda small library of knowledge wich would only be needed :P


this wiki: Original python scripting reference documentation - BFEditor
is really helpful, but I can't get started with this:
Nice to know wich methods exist and how they're called but for me as a beginner I couldn't start of with a new script like this ...
It's difficult to say but what I'd like to have is something that answers the question:
"Okay, i see
THIS =>
Code:
init():

		bf2.registerHandler('PlayerRevived', onPlayerRevived)

		print "MyScript is now listening for players being revived..."
is the code that engages the script to "listen for players being revived"
But what if I'd like to have the script listen to players entering vehicles ?!?!"

Yeah it's basic stuff, but imo all these python tutorials do not help beginners with scripting for BF2...
Hope you'll understand

thx for responses!
j0g32 is offline
Last edited by j0g32; 2010-01-24 at 13:43..
Reply With Quote
Old 2010-02-24, 21:47   #14
addaco
Default Re: [Python Tutorial] Python coding in BF2

I am interested in learning python, however I have a question.

What version does BF" / PR use? 2 or 3?
addaco is offline Reply With Quote
Old 2010-02-24, 21:54   #15
POMARANC
Default Re: [Python Tutorial] Python coding in BF2

it uses version 2, but I'm not sure which subversion
some old info says it's 2.3.4, but maybe it was updated...
POMARANC is offline Reply With Quote
Old 2010-02-25, 17:35   #16
addaco
Default Re: [Python Tutorial] Python coding in BF2

thanks.
Im going to try and find a python interpertor of 2.3.4 THat would be better than a newever version, as I would be learning for BF2

EDIT: Can only find version 2.3.7

What should I install, the above, or the latest in 2 series?
addaco is offline Reply With Quote
Old 2010-02-25, 19:18   #17
dbzao
Retired PR Developer
Supporting Member

dbzao's Avatar
Default Re: [Python Tutorial] Python coding in BF2

2.3.7 is fine, but bear in mind BF2 has its own set of modules, so not all of original python 2.3 modules are available.


"There's always one more bug." - Lubarsky's Law of Cybernetic Entomology
dbzao is offline Reply With Quote
Old 2010-02-26, 14:47   #18
addaco
Default Re: [Python Tutorial] Python coding in BF2

ok, so I should refer to online sources when I use particular modules.

I thought the BF2 engine is bad, it always gets worse the more you look into it :P
addaco is offline Reply With Quote
Old 2011-11-11, 13:12   #19
armed Jester
Default Re: [Python Tutorial] Python coding in BF2

hey all,

i want to try out some stuff on our server "gis+ cobat zone PR9.x" and got some questions about it.

first of all; is it legal to change things like "player amount", "sq sice" and "removing nametags" on a locked server.

and; what files have to be modified to do so.
armed Jester is offline Reply With Quote
Old 2011-11-20, 21:33   #20
BloodyDeed
Retired PR Developer
Supporting Member

BloodyDeed's Avatar
Default Re: [Python Tutorial] Python coding in BF2

Afaik nametags would require you to modify the clients files.
I strongly recommend you NOT to change any client files as this if you're not backing up correctly will kick you off the servers due to md5 mismatch.

Player amount is really easy to change, just set the sv.maxPlayers 16 to whatever you want. More than 64 slots is hardcoded and requires assembly skills which is BY FAR more complex than python.

Squadsize is also hardcoded and theres no way to change that without changing the bf2 binaries.


All these question have nothing to do with python tho, would fit better in the server admins forum.

BloodyDeed is offline Reply With Quote
Reply


Tags
bf2, coding, python, tutorial

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:24.