Class Editor

Ask questions, discuss ideas, get answers
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Class Editor

Post by Vilespring »

Swaffy, stop making me feel like I'm forgetting a step and being a moron at the same time! :lol:
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Class Editor

Post by Swaffy »

Ah, but that makes more of a chance to find the problem! Because I am usually wrong anyway. XD
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
rubberduck23
Posts: 15
Joined: Wed Jul 30, 2014 12:10 pm

Re: Class Editor

Post by rubberduck23 »

. I'm pretty new to modding so don't expect me to do what's "logical" for you.
. As of yet it is garbled, full of those weird symbols associated with formatting errors etc.
. EA Games\Battefield 1942\Mods\bf1942\Archives\?Objects?
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Class Editor

Post by Vilespring »

well, you need to download WinRFA, a program used to unpack the RFA, and extract the files to a place so you can actually edit them. Also, it would be a good idea to download the debug executable. This will tell you where errors are in your mod.
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Class Editor

Post by Swaffy »

Vilespring wrote:well, you need to download WinRFA, a program used to unpack the RFA, and extract the files to a place so you can actually edit them. Also, it would be a good idea to download the debug executable. This will tell you where errors are in your mod.
You still use that program? O.o BGA kicks so much more ass though. XD
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Class Editor

Post by Vilespring »

Yes :D
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
rubberduck23
Posts: 15
Joined: Wed Jul 30, 2014 12:10 pm

Re: Class Editor

Post by rubberduck23 »

Hello :)

After abandoning kit modification due to restricted user rights (don't ask -_-), I am now back (admin again). I have recently started my quest to
making some BF1942 maps, and in in the process I extracted the objects folder and with it the kits etc. for all factions! Now, I was tempted to just
dive in there and change the weapons to other ones, but how is that exactly acheived?
What caught my eye was the "objectTemplate.addWeaponIcon "weapon/Icon_<insert weapon here>.tga"". Now, I noted that it said "Icon" and "Template", so
that makes me think twice about editing it, as it conveys the message that it is merely the template/icon that you are changing, rather than the weapon
itself. Is this true? If not, would it simply be a case of replacing the weapons with ones of the same factions (of course)?

P.S. This folder is a copy, so it's all ok :)
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Class Editor

Post by Vilespring »

Now, the code you found adds the picture of the weapon in the weapon selector, thingy. (I really don't know what that's called!) When you change that, you need to change that AND this!

ObjectTemplate.addTemplate <weapon name>

Edit: I'll give you an example with my mod!

Vanilla 1942 US AT class

Code: Select all

ObjectTemplate.create Kit Us_AT
ObjectTemplate.setType AT
ObjectTemplate.setKitTeam 2
ObjectTemplate.geometry Kit_Allies_Antitank
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.networkableInfo KitInfo

ObjectTemplate.setHealthBarIcon "Ingame/Healthbar_empty_at_64x64.tga"
ObjectTemplate.setHealthBarFullIcon "Ingame/Healthbar_full_at_64x64.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_alliesKnife.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_colt.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_bazooka.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_grenadeallies.tga"

ObjectTemplate.setKitIcon 2 "kits/Icon_antitank_allies_selected.tga"
ObjectTemplate.setKitName 2 "RESPAWN_AT"
ObjectTemplate.setKitActiveName 2 "RESPAWN_ACTIVE_AT"

ObjectTemplate.addTemplate Us_Helmet
ObjectTemplate.addTemplate US_Britt_Bacpac
ObjectTemplate.addTemplate US_Hip_Pack

ObjectTemplate.addTemplate Bazooka
ObjectTemplate.addTemplate KnifeAllies
ObjectTemplate.addTemplate Colt

ObjectTemplate.addTemplate GrenadeAllies
ObjectTemplate.aitemplate AT
My US AT kit

Code: Select all

ObjectTemplate.create Kit Us_AT
ObjectTemplate.setType AT
ObjectTemplate.setKitTeam 2
ObjectTemplate.geometry Kit_Allies_Antitank
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.networkableInfo KitInfo

ObjectTemplate.setHealthBarIcon "Ingame/Healthbar_empty_at_64x64.tga"
ObjectTemplate.setHealthBarFullIcon "Ingame/Healthbar_full_at_64x64.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_alliesKnife.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_colt.tga"
ObjectTemplate.addWeaponIcon "Weapon/icon_m1_garand.tga"
ObjectTemplate.addWeaponIcon "Weapon/Icon_bazooka.tga"


ObjectTemplate.setKitIcon 2 "kits/Icon_antitank_allies_selected.tga"
ObjectTemplate.setKitName 2 "RESPAWN_AT"
ObjectTemplate.setKitActiveName 2 "RESPAWN_ACTIVE_AT"

ObjectTemplate.addTemplate Us_Helmet
ObjectTemplate.addTemplate US_Britt_Bacpac
ObjectTemplate.addTemplate US_Hip_Pack

ObjectTemplate.addTemplate Bazooka
ObjectTemplate.addTemplate KnifeAllies
ObjectTemplate.addTemplate Colt

ObjectTemplate.addTemplate M1Garand
ObjectTemplate.aitemplate AT
NOTE! Unlike BF Vietnam, where weapons go into the kit in the order they are added, in BF 1942, the weapon has an ID on it, and will always take that slot. I changed the Bazooka to slot 4 to allow the rifle. The kit icons do get added in the order they are added in the code. Do not add more than 1 weapon with the same ID, or BF won't like you!
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
rubberduck23
Posts: 15
Joined: Wed Jul 30, 2014 12:10 pm

Re: Class Editor

Post by rubberduck23 »

Ah, right ;)

So it seems relatively easy to change the weapons (from your example). I'll hopefully get around to trying that soon, and as I'll upload my progress.
However, when I am ready to use my modified "kitpack" (if we make the assumption that I have only modified the "BritKits", for example), I am a little bit
stuck. We all know that the Objects.rfa is shown as a .rfa file right? I have unpacked a copy of this (the one I intend to edit) but I'm not quite sure
how to implement it. Is it simply a case of replacing (both backed-up, of course) the Objects.rfa with the folder, or is there another way?
User avatar
Vilespring
Posts: 740
Joined: Sat Nov 24, 2012 5:47 am
Location: Somewere in the United States

Re: Class Editor

Post by Vilespring »

The RFA editor should have some sort of way to re-pack a folder. Just find the Objects folder that's unpacked (not any of its subfolders!) and re-pack it. Then it should be good to go!
A picture is worth a thousand words, but takes up three thousand times the memory.

Area 51: http://battlefieldarea51mod.weebly.com/

Image
"I didn't steal your pizza"
Post Reply