Jump to content
Official BF Editor Forums
[BF:A] Croupier

Micro Modding 101

Recommended Posts

Ok lets start from scratch, we'll keep this as simple as possible, let's say you want to change the Amount of mines the Engineer has, and we want to test it on Strike at Karkand.

1. Open the Editor and create your mod. (starting from scratch so that nothing else previously done will interfer with the process, I am doing this as I type so I can say that it will work 100%)

2. Copy the Strike_at_Karkand folder from mods/bf2/Levels and place it in mods/your_mod/Levels

3. Copy mods/bf2/Objects_server.zip to mods/your_mod/

4. Rename it Custom_Objects_server just for the hell of it.

4.1 Open your_mod/ServerArchives.con leave the bf2 mounted stuff and just add:

fileManager.mountArchive Custom_Objects_server.zip Objects

it should look like this:

fileManager.mountArchive Custom_Objects_server.zip Objects

fileManager.mountArchive mods/bf2/Objects_server.zip Objects

fileManager.mountArchive mods/bf2/Menu_server.zip Menu

fileManager.mountArchive mods/bf2/Common_server.zip Common

4.2 Optional, but I edited the ClientArchives.con also to only read the bf2 content seeing as though Im only going to mount a server file, it looks lke this:

fileManager.mountArchive mods/bf2/Objects_client.zip Objects

fileManager.mountArchive mods/bf2/Common_client.zip Common

fileManager.mountArchive mods/bf2/Menu_client.zip Menu

fileManager.mountArchive mods/bf2/Fonts_client.zip Fonts

fileManager.mountArchive mods/bf2/Shaders_client.zip Shaders

5. Delete everything in Custom_Objects_server.zip except the Weapons folder. (I prefer to use WinRar)

6. Open the Weapons folder and delete everything except the Handheld folder.

7. Open the Handheld folder and delete everything except the at_mine folder.

8. Open the at_mine folder and delete evrything except the at_mine.tweak file.

Time for a micro mod.

Lets just give the Engineer a few more mines to play with. And how about we make the mines explode when soldiers walk on them.

9. Extract at_mine.tweak file to your desktop rightclick and uncheck read only, apply and then add it back to the .zip overwriting the original (I like to tweak my files while they are in the zip) next open up the at_mine.tweak file in notepad and edit 3 lines.

9.1 First one is in the ThrownFireComp, Change

ObjectTemplate.fire.maxProjectilesInWorld 5, to

ObjectTemplate.fire.maxProjectilesInWorld 10, this is pretty obvious allows us 10 mines before they start to dissapear.

9.2 Second tweak is in the DefaultAmmoComp and will enable 10 mines or 2 mags of 5 a mag if you like. Change

ObjectTemplate.ammo.magSize 1, to

ObjectTemplate.ammo.magSize 2, easy peasy.

9.3 Last tweak is the Player triggering the mine, this will take place in the DefaultDetonationComp. Change

ObjectTemplate.detonation.triggerType MTYVehicle, to

ObjectTemplate.detonation.triggerType MTYPco, kabooommmmm

OK lets check it out shall we, but before we do that we will want to shortcut to the mod.

10. Copy you BF2 shortcut and rename it your_mod, rightclick properties, and change it appropriately, +fullscreen 0 +modPath mods/your_mod

Fullscreen 0 so as you can surf the web while you most likely optimise shaders (if your trying this on a newly created mod). I didn't opt for BF2_r.exe as I was getting a heap of dice code errors.

I tested in singleplayer and it works beautifully.

giff created with BF2 recorder and Photoshop/imageready.

minez.gif

Share this post


Link to post
Share on other sites

Sure you can, will work for map modding as long as you mount your archive before the BF2 stuff, you can name the archive whatever you want still. Small changes like this I would actually do in map modding however this tutorial actually started out as a reply to a thread where the dude could'nt get basic changes to work in a mod.

Share this post


Link to post
Share on other sites

Hey Khrim (hope you don't mind me calling you by that nic)

There are issues with tweaking and mounting BF2 content via your maps server.zip, the textures work fine because of the suffix however there seems to be naming issues when mounting allready existing BF2 content, it just don't work, it will always read the original files.

You could rename the object completely and then rename it also in the staticobjects.con or gameplayobjects, depending on the object.

Or you could just hang tight for a bit while I get together a tut on how to do it the easy way. ;)

Share this post


Link to post
Share on other sites

Which code governs effect size? particularly the size of the C4 explosion.

I blew up 992 C4 packets spontaneously earlier and want to redo it with much bigger bombs.

Also, how would i remove the C4 explosive geometry so it is invisible? That may not be a good idea, as I wanna see where i plce it, but at the same time do not want the explosives to show up on the BF Recorder.

Share this post


Link to post
Share on other sites

ParticleMaxSize, but you'd have to do that to all the emitters in the effect.

Open the tweak for the C4 and search for "effect" and change what is being called to something that's more fitting for what you want. For nothing, make a new emitter and have it do nothing and call that. I'm relatively sure you at least have to call something or it will crash.

Share this post


Link to post
Share on other sites

Can't find anything resembling particle max Size.

Also, it's only the effect radius I care about, but just for the heck of it, where is the code that affects explosion radius (not visual, affect range) and force (or how far it sends things flying)?

Share this post


Link to post
Share on other sites
Croupier]

You could rename the object completely and then rename it also in the staticobjects.con or gameplayobjects, depending on the object.

Well, really I was planning to add brand new contant so no problem about overriding names. I just hope it won't crash when hosted on a dedicated server.

From what I read around the upcoming expansion will feature content bundled with the levels (boosterpacks are not a mod) so I think it's just a matter of waiting for Euroforces and grab EA/Dice 100% working code for doing it there.

Here's another awesome tut:

http://img137.imageshack.us/img137/438/tut11ua.jpg

Share this post


Link to post
Share on other sites

I wonder how cool it would be if you layed a 1000 C4's all around Karkand, stood in the middle of the whole map and blew them all up?

A pretty pointless question i know...

By the way, is there a way how you can make the blast rate bigger so i could be blown higher with c4?

Share this post


Link to post
Share on other sites
By the way, is there a way how you can make the blast rate bigger so i could be blown higher with c4?

Find this section in the .tweak>

rem ---BeginComp:DefaultDetonationComp ---



ObjectTemplate.createComponent DefaultDetonationComp



ObjectTemplate.detonation.explosionMaterial 80



ObjectTemplate.detonation.explosionForce 17



ObjectTemplate.detonation.explosionDamage 1000



ObjectTemplate.detonation.detonateOnWaterCollision 0



ObjectTemplate.detonation.endEffectTemplate e_exp_large



ObjectTemplate.detonation.useMMOnEndEffect 1



rem ---EndComp ---

edit value of this line

ObjectTemplate.detonation.explosionForce 17

Share this post


Link to post
Share on other sites

And if you want the c4 to do no damage at all, edit

ObjectTemplate.detonation.explosionDamage 1000 to

ObjectTemplate.detonation.explosionDamage 0 (pretty obivous =) )

Share this post


Link to post
Share on other sites

I've tried everything you may mean by that. All resulted in a loss of explosion graphic and sound ((same damage ratio and same shaking of screen).

Show me a line configured in this fashion as an example.

Share this post


Link to post
Share on other sites

I thought you wanted the damage and radius the same.

Open the tweak for an effect. Find which emitters are being called (by way of (AddTemplate) and then (assuming separate files) find the tweaks for those emitters and find the line ParticleMaxSize. If they're not separate files, scroll down to the emitters themselves. Understand that you need to be editing the actual effect you're using. Also, if you ask me to tell you whether or not you need to increase the number or decrease it to make your effect larger, I'll kill me.

Share this post


Link to post
Share on other sites

ObjectTemplate.emitTime 0.3

ObjectTemplate.emitDelay 0

ObjectTemplate.isLooping 0

ObjectTemplate.emitSpeed 15

ObjectTemplate.emitDirection 0/1/0

What are these? I'm looking for the codes that govern the speed of explosion, the code that loops (repeats) the explosion, and damage radius (not in there).

I'm gonna play around with these right here but since I gotta log in every time I go to try it out it's more effective to post some stuff here.

Share this post


Link to post
Share on other sites

Damage is set in the detonation comp on the weapon, not in the effects.

emitTime = how long the emitter is active

frequency = particles generated per second - requires a save and reload geometry to see changes

emitDelay = delay between loops

isLooping = 1=on, 0=off

emitSpeed = Speed of the particles as they are born

emitDirection = direction in x,y,z dependant on the way the object's facing

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×