Jump to content
Official BF Editor Forums

Change Weapon Damage!


simon.blom
 Share

Recommended Posts

Hello!

I'm going to change the damage of the bullets of all weapons in my new mod.....

So i wanted to ask you if you could help me?

To make this easy I've decided to start with the m-16, and then continue with the other weapons. So if you write someting, take the m-16 as example....

I know that I'm going to load up the m-16 in the Battlefield 2 Editor / Objecteditor.

Then I need help. What should I change? I don't whant to change splashdamage. I just whant to change the damage, so I can get a kill with 1 shot, not 3-4...

Please help!

Thanks in advance

/// simon.blom

Link to comment
Share on other sites

A standard BF2 soldier has 100 hitpoints.

Now find the line ObjectTemplate.damage in the m16 tweak file which you can open with any texteditor. the tweak file is located in /objects_server.zip/weapons/handheld/usrif_m16a2 . The damage in that line is the damage the projectile does on impact, currently set to 30 on the vanilla M16.

This means 4 shots of the M16 would kill a soldier ( 4* 30 = 120 hitpoints exceed the 100 hitpoints of the soldier) .

You could now either increase the damage of the M16 projectile or decrease the hitpoints on soldiers.

Note that projectiles loose damage over distance. Some weapons have the distances coded ('distToMinDamage' ) and some rely on the defaults.

Explosive projectiles can also damage with their explosion component where the explosion damage add to the impact damage. Explosion damage is unrelated to the shooting distance and is mostly used for arty shells, bombs and torpedoes where the main damage is done by the explosion and not the impact.

Link to comment
Share on other sites

This is the target line in my shortcut to start XWW2 in windowed mode

"C:\games\Battlefield 2\BF2.exe" +menu 1 +fullscreen 0 +modPath mods/xww2

Here is an example of launching the game debugger with a mod and directly into a map ('xww2_crete') in SP 64 mode:

"C:\GAMES\Battlefield 2\BF2_r.exe" +menu 1 +fullscreen 0 +modPath mods/xww2 +ai 1 +loadLevel xww2_crete +maxPlayers 64 +gameMode sp3 +ignoreAsserts 0

Note that my game isn't installed in the standard location

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

"C:\GAMES\Battlefield 2\BF2_r.exe" +menu 1 +fullscreen 0 +modPath mods/xww2 +ai 1 +loadLevel xww2_crete +maxPlayers 64 +gameMode sp3 +ignoreAsserts 0

My game is installed in the same location. :rolleyes:

Oh, and if you have unstandart screen resolution, try adding +szx (yourmonitorwidth) +zxy (yourmonitorheight)

And what's +ignoreAsserts 0 does?

And have you fixed BF2_r.exe? It doesn't seems to work for me.

Link to comment
Share on other sites

The game debugger requires the DLL's with '_r' in their name . Sometimes an installation misses to install vtuneapi.dll , which you can get e.g. from my server:

http://berlin.schoeldgen.de/bf1942/vtuneapi.zip or from various resources on the net.

Unzip it into the BF2.EXE directory.

Note that the debugger has to be run in windowed mode to do its magic.

The debugger will give you a lot of errors. Press 'Continue' to dismiss the error boxes and to proceed to the next error. The last error before a CTD is probably responsible for the crash.

To get an idea about what errors are fatal and which are not launch a known good map ( e.g. one of the vanilla maps ) and jot down the errors produced by it. As you will see DICE didn't build an error-free game :P

Link to comment
Share on other sites

Accuracy is called 'Deviation' in BF and is located in the 'SoldierDeviationComp' for handheld weapons . The lower the numbers, the higher the accuracy of the weapon. A detailed explanation is beyond the scope here but have a look at other weapons to get the idea. Deviation can be coded for the different moves of the soldier and can be summed up ( in e.g. MG's) for decreasing accuracy while firing.

Crosshairs are determined by the 'GUIIndex' in the WeaponHUD component. E.g. GUIIndex 4 is the standard crosshair. There's a textfile in /menu_server.zip/HUD/HUDSetup/GUIIndex.txt describing the available indices in BF2.

Firing modes can be changed in the FireComponent :

ObjectTemplate.fire.addFireRate N where N determines the kind of fire - e.g. 0 is single fire , 2 is continous fire. Again, look at other weapons and mimic the code.

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

Thanks again for all help ;)

I've learn the basics about weapon modding and I thought that I will process with some object creation in maya 6. But I think that I will search some on google first and then I make a new topic under "maya". Before I start, anyone that got any tips?

Thanks everybody and and great thanks to mschoeldgen [Xww2] for the help!

/// simon.blom

Link to comment
Share on other sites

  • 11 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...