Class Editor

Ask questions, discuss ideas, get answers
rubberduck23
Posts: 15
Joined: Wed Jul 30, 2014 12:10 pm

Re: Class Editor

Post by rubberduck23 »

Is there a section that you want to point me to or is that for me to explore ?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Class Editor

Post by Swaffy »

It would benefit you a lot more if you explored. You might catch some great ideas or learn more than just what you are looking for. :]
(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 »

Swaffy is very right. You learn the most by finding things by accident, and breaking the game.

Let's just say, BF doesn't like you if your vehicle has no camera... :oops:
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.
I've had an idea :idea: .
I've seen the pattern of most mods (at least for BF1942), and I have an idea of how I might be able to create this mod.
Ok, so we have a "Mods" folder. Then we have all the mods, including vanilla BF1942. My theory is (remember, you might laugh, but I'm relatively new) that
if I copy the vanilla "bf1942" in the "Mods" folder, I can replace the "Objects.rfa" with my edit of it, rename the folder, and hey presto.
Hopefully this will display as a custom game that I can use, right?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Class Editor

Post by Swaffy »

rubberduck23 wrote:Hello.
I've had an idea :idea: .
I've seen the pattern of most mods (at least for BF1942), and I have an idea of how I might be able to create this mod.
Ok, so we have a "Mods" folder. Then we have all the mods, including vanilla BF1942. My theory is (remember, you might laugh, but I'm relatively new) that
if I copy the vanilla "bf1942" in the "Mods" folder, I can replace the "Objects.rfa" with my edit of it, rename the folder, and hey presto.
Hopefully this will display as a custom game that I can use, right?
Don't do it like that, your file size will be very large. Instead make the file structure only containing the structure that you will be using.

If you only have an Objects.rfa, then only make a Mods/ModName/Archives/Objects.rfa structure with nothing else in it. And in Mods/ModName you need your init.con file properly set up.
(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 »

Oh, ok.
So once I have the Objects.rfa ready for test: Battlefield1942\Mods\"MyMod"\Archives\"MyObjects.rfa"
What is "init.con"? Do you mean setting up the Objects file correctly or else?
rubberduck23
Posts: 15
Joined: Wed Jul 30, 2014 12:10 pm

Re: Class Editor

Post by rubberduck23 »

rubberduck23 wrote:Oh, ok.
So once I have the Objects.rfa ready for test: Battlefield1942\Mods\"MyMod"\Archives\"MyObjects.rfa"
What is "init.con"? Do you mean setting up the Objects file correctly or else?
Ah. I see what you mean. I've found the "Init.con" and will (try) to edit it accordingly. So just that and The Objects and then done, right?
jdc527
Posts: 36
Joined: Mon Aug 31, 2020 8:39 pm

Re: Class Editor

Post by jdc527 »

How do you get the AI to use the bazooka or panzershrek when changing the kit like this? Is there a file I have to edit somewhere?

Vilespring wrote: Sun Sep 07, 2014 8:58 pm 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!
Post Reply