getting into coding?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manos_de_la_muerte

    #1

    getting into coding?

    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]

    #2
    Check your pm's

    Comment

    • >Marshall

      #3
      Do you mind pm'ing me info too? thanks

      Comment

      • Maz1

        #4
        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)

        Comment

        • Djuice

          #5
          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.

          Comment

          • Why?!

            #6
            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.

            Comment

            • Doorstop[DCON]

              #7
              Check PM's why

              Comment

              • manos_de_la_muerte

                #8
                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?

                Comment

                • Frosty289

                  #9
                  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
                  Code:
                  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)

                  Code:
                  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 :)

                  Comment

                  • manos_de_la_muerte

                    #10
                    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?

                    Comment

                    • Frosty289

                      #11
                      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
                      Code:
                      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
                      Code:
                      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.

                      Comment

                      • Frosty289

                        #12
                        bah double post

                        Comment

                        • Djuice

                          #13
                          ha, i have all mine @ 50!!! ANTI everything gun!

                          Comment

                          • FunkyMonkey

                            #14
                            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?

                            Comment

                            • GlobalFear

                              #15
                              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 ), 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.

                              Comment

                              Working...