IPB

Welcome Guest ( Log In | Register )

weapon modding tutorial for beginners
Sgt_Prof
post Apr 16 2013, 09:01 AM
Post #1


CryEngine 3 environment designer, novel writer,dude who love art
****

Group: Soldiers
Posts: 967
Joined: 12-September 11
From: Dystopian world
Member No.: 8,214



This tutorial will help you to add new weapon to BF2/mod.

Actualy is this tut is similar to previously called ,,create your BF2 kit". I would suggest to read it before doing what I want expain here: Moddb.com

This action requires notepad or wordpad

Here you go. First you must find what weapon you would like to add. For start probably you would like to try something. Check for custom content here: Bf2.gamebanana.com
(or in our own Community mini-mods section ) wink.gif --mcr

Then you downloaded (zip, winrar) files, extract archives and drop weapon foldier on desktop.

Open: Bf2/ mods/ your mod/ objects_server/ weapons
Open: Bf2/ mods/ your mod/ objects_client/ weapons

if weapon have custom HUD icon then you need add it to menu client:

Open: Bf2/ mods/ your mod/ Menu_client/ HUD/ Texture/ Ingame/ weapons/ icons/ HUD
Open: Bf2/ mods/ your mod/ Menu_client/ HUD/ Texture/ Ingame/ weapons/ icons/ HUD/ selection

put HUD icon to right places^^

KITS EDITING:

Open: Bf2/ mods/ your mod/ objects_server/ kits (make sure your kit is not read-only mode). Click right mouse and check.

Okay, now make sure you realy have done all previous steps and new weapon already exists in your weapons foldiers (2 places).

Open selected kit and now you must know what item index it have.

? how check ?
- open your custom weapon tweak with notepad and find thise line:

rem -------------------------------------
ObjectTemplate.addTemplate S_M24_Fire1P
ObjectTemplate.setPosition 0/0.0251192/0.617667
ObjectTemplate.addTemplate S_M24_Fire1P_Outdoor
ObjectTemplate.setPosition 0/0.0259557/0.620327
ObjectTemplate.addTemplate S_M24_Fire3P
ObjectTemplate.setPosition 0/0.0248084/0.616961
ObjectTemplate.addTemplate S_M24_BoltClick
ObjectTemplate.setPosition 0/0.0228307/-0.165919
ObjectTemplate.addTemplate S_M24_TriggerClick
ObjectTemplate.setPosition 0/-0.0405023/-0.183669
ObjectTemplate.addTemplate S_M24_SwitchFireRate
ObjectTemplate.addTemplate S_M24_Reload1P
ObjectTemplate.addTemplate S_M24_Reload3P
ObjectTemplate.addTemplate S_M24_Deploy1P
ObjectTemplate.addTemplate S_M24_Deploy3P
ObjectTemplate.addTemplate S_M24_Zoom
ObjectTemplate.setPosition 0/0.0284011/-0.141757
ObjectTemplate.addTemplate e_muzz_sniper
ObjectTemplate.setPosition 0/0.0271032/0.612798
ObjectTemplate.addTemplate e_shellejection_rifle
ObjectTemplate.setPosition -0.00302492/0.0299253/-0.0828321
ObjectTemplate.setRotation -3.4436/3.75679/1.22417
rem -------------------------------------
ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/USRIF_M24/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/USRIF_M24/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate M24_Projectile
ObjectTemplate.velocity 1000
ObjectTemplate.itemIndex 3
ObjectTemplate.delayToUse 1.6

Now be sure to replace weapon with the same item index. For example if you got primary custom (new) weapon (item index 3), you must replace it with old primary weapon (item index 3).

You can do same thing with pistols, but now item index will be with number 2.

Notes: You can't add more then 9 weapons for one kit. EVERY WEAPON MUST HAVE DIFERENT ITEM INDEX OR YOUR GAME MUST CRASH. For example: Knife- intem indiex 1, pistol- item index 2, assault rifle- item index 3....

all weapons must be different in kit, e.g. in kit not recommended have two ak47...

Crash fix:

Possible bugs: Game crash at textures loading or after load in menu you see white weapon icon. It means that something is wrong with weapon icon.

How add working, but vBF2 (not same weapon icon for test) ?

Open your custom weapon tweak and copy icon code from other exsiting and working (default) weapon.

Like this:

ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\M24.tga
ObjectTemplate.weaponHud.altWeaponIcon Ingame\Weapons\Icons\Hud\M24.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\M24.tga

If mod still crash after edit and you don't know reason, run BF2 mod in windowed mode.
Right click on scortcut and you will see something like this:

E:\Battlefield2\BF2.exe +menu 1 +fullscreen 1

set to:

E:\Battlefield2\BF2.exe +menu 1 +fullscreen 0

Then you will get error massage and will know why mod crash.

Set 0 to 1 if you want fullscreen back.

This post has been edited by MasterChiefRulZ: May 1 2013, 08:17 AM
Reason for edit: added link to community mini-mod section


--------------------
It's hard to beat a person who never gives up
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 6)
FSeven
post Sep 25 2014, 10:55 PM
Post #2


Enlisted
*

Group: Soldiers
Posts: 4
Joined: 25-September 14
Member No.: 10,336



I'd like to start this by saying that this is my first ever post to this site, so if I do something wrong, please tell me.


I've been tweaking the kits of both BF2 v 1.5 and AIX2 to my liking, and now certain (seemingly random) maps crash while loading objects.

Typically you would think this was caused by an error in whatever tweaks I've done, but get this: I've played with all of the kits, and none of them are broken. The maps that do load have allowed me to see that, and test the tweaks I have done.

The only things I have done outside of the actual kit changing are change weapon damages, fire rates, projectile speeds and some item indexes. Nothing else.

This is kind of frustrating as it makes very little sense as to why this would affect map load. If it works on these maps, why not those ones too?

Is there a debugger that someone with limited skill (me) could use to pinpoint the problem? If so, a link would be nice happy.gif

Go to the top of the page
 
+Quote Post
Death_EnForcer
post Sep 26 2014, 08:15 PM
Post #3


Dictator
Group Icon

Group: BFSP Team
Posts: 2,595
Joined: 17-July 04
From: New Jersey, USA
Member No.: 294



QUOTE (FSeven @ Sep 25 2014, 11:55 PM) *
I'd like to start this by saying that this is my first ever post to this site, so if I do something wrong, please tell me.


I've been tweaking the kits of both BF2 v 1.5 and AIX2 to my liking, and now certain (seemingly random) maps crash while loading objects.

Typically you would think this was caused by an error in whatever tweaks I've done, but get this: I've played with all of the kits, and none of them are broken. The maps that do load have allowed me to see that, and test the tweaks I have done.

The only things I have done outside of the actual kit changing are change weapon damages, fire rates, projectile speeds and some item indexes. Nothing else.

This is kind of frustrating as it makes very little sense as to why this would affect map load. If it works on these maps, why not those ones too?

Is there a debugger that someone with limited skill (me) could use to pinpoint the problem? If so, a link would be nice happy.gif


BF2 debugger is included with the BF2 Editor. Following are some links that might help you.

http://www.moddb.com/games/battlefield-2/d...ld-2-editor-v13

http://www.battlefieldsingleplayer.com/for...bugger+download

http://www.battlefieldsingleplayer.com/for...bugger+download

http://www.battlefieldsingleplayer.com/for...bugger+download
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Sep 27 2014, 09:22 PM
Post #4


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE
Is there a debugger that someone with limited skill (me) could use to pinpoint the problem?

I notice you didn't mention windowed mode, it's extremely easy and very effective. Debug mode is a little bit more advanced.

If you're using BF2 version 1.4 or lower you might be exceeding BF2's allowed memory usage level. Memory usage for those versions are capped at 2 gigs, if the game exceeds that then it closes to desktop. Exceeded memory happens with modding if one adds a considerable amount of new content for the game to run.


--------------------
Go to the top of the page
 
+Quote Post
FSeven
post Sep 28 2014, 02:23 AM
Post #5


Enlisted
*

Group: Soldiers
Posts: 4
Joined: 25-September 14
Member No.: 10,336



Thanks people biggrin.gif I'll have a go at those links, let you know if I can figure this out.

MasterChief, I have run it in windowed mode (thought I had stated that here, but I guess not). I get no error, it just CTDs.

I'm running 1.50 on Win 7.
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Sep 28 2014, 11:53 PM
Post #6


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



The first two CTD with no messages in Windowed mode (for me) are either RAM exhaustion or Item Index error.

Anyways, I wish you good bug hunting.


--------------------
Go to the top of the page
 
+Quote Post
Fastj@ck
post Sep 29 2014, 01:50 PM
Post #7


Major
****

Group: Soldiers
Posts: 279
Joined: 24-August 08
From: Germany
Member No.: 5,523



Crash your map at 14% mapload? If yes, i think you modified a kit (kits) with items that have the same itemindex. Thats not allowed.
Some itemindexes are fixed for some classes like the engineer and the at mine or the AT Kit and the rocketlauncher.

Another question, you use the bf 1.5 as basemod or AIX as basemod? If you use bf1.5 and maybe AA kit, a tallwrapper its missing but i dont know if that happens at mapload or ingame.

Hope that helps.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th November 2017 - 04:55 PM