Page 4 of 4

Re: Class Editor

Posted: Thu Sep 11, 2014 9:24 pm
by rubberduck23
Is there a section that you want to point me to or is that for me to explore ?

Re: Class Editor

Posted: Fri Sep 12, 2014 1:25 am
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. :]

Re: Class Editor

Posted: Fri Sep 12, 2014 2:08 am
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:

Re: Class Editor

Posted: Sat Sep 13, 2014 8:22 pm
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?

Re: Class Editor

Posted: Sun Sep 14, 2014 1:07 am
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.

Re: Class Editor

Posted: Sun Sep 14, 2014 12:04 pm
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?

Re: Class Editor

Posted: Sat Sep 20, 2014 7:28 pm
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?

Re: Class Editor

Posted: Wed Dec 13, 2023 6:51 pm
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!