PDA

View Full Version : getting into coding?


manos_de_la_muerte
07-23-2005, 05:30 PM
I've seen lots of stuff around here on mapping and modelling and whatnot, but I was wondering what folks could tell me about getting into the coding aspects of a bf2 mod.

Where does one begin?

I'm a fairly experienced programmer, and while I haven't done a ton of python stuff, I'm sure that won't be a problem to sort out. I guess I just need some pointers in the right direction or a good little project to play with.

Thanks...

Doorstop[DCON]
07-23-2005, 06:21 PM
Check your pm's

>Marshall
07-24-2005, 11:55 PM
Do you mind pm'ing me info too? thanks

Maz1
07-25-2005, 01:47 PM
doorstop mind pm'ing me too :p im more a mapper... but im hoping to develop my own mod ( if its anything like IRC/CoD coding i should be quick at getting into it :p)

Djuice
07-25-2005, 01:52 PM
lol, currently all you need is a notepad, and WinZip...

Open up the Objects_server.zip file, extract the data into a separate folder. Right Click on that folder and select properties, and untick Read-Only..

Once youve done that open the respective .con/.tweak files with a notepad and view all its information in all its glory..

Somethings are hard to understand but somethings are quite easy, wont take you that long to figure out what you need to change to have what kind of effects.

Why?!
07-25-2005, 02:29 PM
I have done a lot of modding in the past, since the release of BF1942. Coding for it is fun because most things are simple to change or add. A lot of the code is pretty self explanatory.

Doorstop[DCON]
07-25-2005, 02:56 PM
Check PM's why

manos_de_la_muerte
07-26-2005, 01:42 AM
What are the most common things that folks like to go in and change? Maybe that's kind of a retarded question, but being new to modding, I guess I'm still trying to get a feel for what can be done.

Anyway, this should be fun... I've got my trusty ole ide, an o'reilly python book, and a fridge full of beers. Are there other forums/lists dedicated more to the programming aspect? Anyone else doing anything cool they want to brag about?

Frosty289
07-26-2005, 01:52 AM
Well i'll get you started with some examples of the easiest of the easiest to change. Let's start off with weapon damage/accuracy, for the M4A1. Open up the objects_server file with WINRAR, (it's the easiest to recompile with, just drag and drop.) Once you open that up, go into weapons, handheld USRIF_m4
Once you get in there, ignore all of the other files, you just want the .tweak, drag that file to your desktop (the tweak file), right click the file, go to properties and turn off 'read only'.

Now you're ready to open up the file, its pretty self explanitory, look for this
rem -------------------------------------
ObjectTemplate.addTemplate S_M4Projectile_Looping
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/0.5/0/0
ObjectTemplate.material 38
ObjectTemplate.minDamage 0.2
ObjectTemplate.damage 25

Well it shouldn't take much to tell you what they do, just forget the timetolive command, and the material command. Tweak the damage/mindamage to your likeing. Now, on to accuracy, its in the .tweak file also (everything is)

rem ---BeginComp:SoldierDeviationComp ---
ObjectTemplate.createComponent SoldierDeviationComp
ObjectTemplate.deviation.setFireDev 1.7 0.2 0.08
ObjectTemplate.deviation.minDev 0.2
ObjectTemplate.deviation.setTurnDev 0 0 0 0
ObjectTemplate.deviation.setSpeedDev 1 0.2 0.2 0.15
ObjectTemplate.deviation.setMiscDev 2 2 0.05
ObjectTemplate.deviation.devModStand 1.5
ObjectTemplate.deviation.devModCrouch 1.2
ObjectTemplate.deviation.devModZoom 0.75
rem ---EndComp ---
Now there's a lot of numbers, changing them to 0 will give you uber accuracy. Basically the one you probably want is the last one, devmodzoom, this is how accurate your gun is when you are aiming down the sight, the others you can forget about. The smaller the value, the more accurate it is. The accuracy for the M4 is retarded, you couldn't hit a tin can 10 ft away with the default. So you'll want it at about 0.35, that will be pretty damn accurate, but it won't be 100% accurate, which gives it some realism in that factor. If you want to expand your knowledge just ask and i'll post in the same format I did with this one.

Now to get it back in, just drag the file from your desktop, overwriting the .tweak inside the zip, winrar will take its 3 or 4 seconds of time recompiling the zip, and then you can go test it out. Keep in mind you can't play online with this, unless the server is running the mod also.

Have a nice day :)

manos_de_la_muerte
07-26-2005, 02:15 PM
Cool... that makes sense, and I see exactly what you're talking about.

... but let's talk about AI, in particular, for a moment. Has anyone messed with this?

What's all the stuff in the AI\AIBehaviors.ai file about? Is it reasonable to expect that there will there be documentation released about this stuff?

Frosty289
07-26-2005, 02:34 PM
Well, if you mean on what weapons they use, and what they use more commonly you might want to go back into the weapons file I showed you above, go into the AI folder and look for weapons.ai and it will show you what the bot thinks is most effective for what. For instance here is the m4's
rem *** Add Usrif_m4 ***
weaponTemplate.create usrif_m4AI
weaponTemplate.indirect 0
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 72.0
weaponTemplate.optimalRangePercentage 35
weaponTemplate.setFiringPose Crouching
weaponTemplate.setStrength Infantry 5.0
weaponTemplate.setStrength LightArmour 1.0
weaponTemplate.setStrength HeavyArmour 0.0
weaponTemplate.setStrength NavalArmour 0.0
weaponTemplate.setStrength Helicopter 0.0
weaponTemplate.setStrength AirPlane 0.0

Changing weaponTemplate.setStrength AirPlane 0.0 to 5.0 will make it the new uber anti aircraft gun, that doesn't mean you can't change it to 3.0 though also, it's just a value.

Frosty289
07-26-2005, 02:36 PM
bah double post

Djuice
07-26-2005, 02:53 PM
ha, i have all mine @ 50!!! ANTI everything gun!

FunkyMonkey
07-26-2005, 02:54 PM
So what about vehicles? changing around things like seating positions/what you can do at those seats. Ex. i wanted to make it so you can sit in the passenger side of the jeep and use your weapons instead of that machine gun, just like you can in the side of the blackhawk.

And most importantly, when you edit the Objects_server.zip, how can you put it in its own "mod" so that you can still play the normal game online, while being able to switch to your "mod" at will?

GlobalFear
07-26-2005, 02:55 PM
Add mini guns to random vehicles, adjust protecta for unlimited shells (With 12 rd mag), add turbo boost to various vehicles, Add burst fire option to MP5, Increase SRAW effectiveness (Players go flying :cool: ), Increase speed of vehicles, add slugs to some shotguns, and Tweak weapon accuracy.
Just to name a few of the fun things to change.

I highly recommend making a copy of your mods>bf2 folder. Paste the copy within mods and name it whatever you want. Tweak this version so you can still play unline. I would tell you how to make a custom mod specific shortcut but I'm not in front of my main rig right now.
Maybe frosty could fill you in. He is pretty knowledgeable.

EDIT: Also, most of the stuff is self explanatory.
Just compare vehicles/objects that do what you want with the ones you want to change. Shouldn't be that hard as you say you have experience. ;)
Don't worry about ****ing up. Thats part of the fun.

Why?!
07-26-2005, 03:35 PM
Don't worry about ****ing up. Thats part of the fun.

Very true, except for my current bug. (http://forums.totalbf2.com/showthread.php?t=18839)

I remember when I made the F/A-18 launch Maverick missiles instead of bombs. I got it working with HUD and all in two tries. I actually dissapointed that it worked so perfectly so fast.

GlobalFear
07-28-2005, 12:32 AM
Which is?

pyalot
07-28-2005, 02:17 PM
see my sig