.MBCH Guide

## Character Files

Create one character file per class to be used within Full Authentic mode. They should be placed in ext\_data/mb2/character in your map's pk3 and named the same *(note, the name of the FILE can be anything, the name within the .mbch file is what needs to be the same for both .mbtc / .mbch)*.

Also very relevant to .mbch editing are:

MBCH Values

Mbch Weapon Overrides

Siege File

Creating a .Sab file

Creating a .veh file

https://jkhub.org/wiki/index.php?title=.npc

## Guide

1. Copy and paste the template (below) into a text editor
	* (I recommend notepad++ for Windows, Sublime for Mac, these both have very nice search/replace features and if you set their language to C+ you can see colored format, crucial for noticing when typos occur)
2. Remove // from the lines you wish to use for your particular character!
	* End and start each \_\_\_Info (Character, Weapon, Force) with brackets
	* Use quotations where designated and watch out for typos or extra / missing brackets! Those kinds of mistakes can break your entire FA!
3. **test, test, test!**
	* *tip: Make back-up/versioned .pk3s instead of constantly overwriting, it is a good idea to have an archive of older .mbch files in case something goes wrong and you can't spot the issue.*
	* *tip: If you start MBII (or your hosted server) with `+fs_dirbeforepak "1"` you can keep your FA files inside a folder instead of a .pk3, allowing you more ease to edit your ext\_data files. Instead of having to restart your entire game or server, you can update your local or hosted server, via '`/rcon map_restart 0`' or '`rcon map nameofmap`' to update the FA edits you made!*
	* To test locally:
		+ `/g_gametype 7`
		+ `devmapall nameofmap`
		+ `mbmode 2`
	* To test while hosting:
		+ set your jamp/OpenJK client to launch with `+fs_dirbeforepak "1"`
			- this allows you to more easily edit files from an FTP client on the fly.
			- A lot of small value changes will happen the following round, but some may require you to fully reload the map (which also reloads the FA) via rcon or smod map command.
4. After setting name, class and other required lines, input MBCH Values from this wiki for each character. Don't forget to fully describe all the features you added!
	* End and start each \_\_\_Info (Character, Weapon, Force) with brackets
	* Use quotations where designated and watch out for typos or extra / missing brackets! Those kinds of mistakes can break your entire FA!
	* test, test, test!
		+ *tip: Make back-ups instead of overwriting, it is a good idea to have an archive of older .mbch files in case something goes wrong and you can't spot the issue.*
		+ To test locally:
			- `/g_gametype 7`
			- `devmapall nameofmap`
			- `mbmode 2`
				* `map_restart 0` / `devmap` if you need to refresh with your changes!

## The Template Guide

```
// --------------------------------------------------------------------------------------------------------------------------------------
// Welcome to Frenzy's Template + Walkthrough to a proper .mbch FA file!
// Remember, proper format is key! Also, test often and try to save your .pk3s in versions so that you have backups!
// --------------------------------------------------------------------------------------------------------------------------------------

Classinfo    //required
{            //required

    // BASICS
    // ------------------------------------------------------
    name        "name to be read for .mbtc file"    //required
    uishader    "directory/nameoficon"              //required
    MBClass     MB_CLASS_NAMEOFCLASS                //required, see below for an easy copy/paste:

    //MB_CLASS_SOLDIER MB_CLASS_ELITETROOPER MB_CLASS_CLONETROOPER MB_CLASS_ARCTROOPER MB_CLASS_WOOKIE MB_CLASS_HERO
    // MB_CLASS_JEDI MB_CLASS_BOUNTY_HUNTER MB_CLASS_MANDALORIAN MB_CLASS_SBD MB_CLASS_DROIDEKA

    model         ""    //The model that the class is using for example luke or imperial - in quotations
    skin          ""    //Which variant skin is being used such as default, blue or red - in quotations
    modelscale    1     //default is 1, 100%
    speed         1     //default is 1

    // HEALTH + LIVES
    // ------------------------------------------------------
    maxhealth           #
    maxarmor            #
    classNumberLimit    1    //You may run into errors if all classes on a team have Class Number Limits
    extralives          #    // not to be confused with the ability MB_ATT_RESPAWNS,# which allows you to rally

    // ARSENAL + ABILITIES
    // ------------------------------------------------------
    weapons         WP_MELEE    //at least one weapon is required!
    //attributes    l           // MB_ATT_NAMEOFATTRIBUTE,#|MB_ATT_NAMEOFATTRIBUTE would be proper formatting for multiple abbilities
    //holdables                 // HI_EXAMPLE|HI_EXAMPLE

    //SABERS + FORCE  - I recomend checking out my .sab guide if you want to really customize your saber or melee weapon!)
    //                - Find MBII .sab files for hilts within the ext_data directory in MBIIHilts.pk3
    // ------------------------------------------------------
    //saber1          ""     //name of .sab file (without .sab) in quotations
    //sabercolor      #      //0-Red 1-Orange 2-Yellow 3-Green 4-Blue 5-Purple 6-Silver
    //saber2          ""     //name of .sab file (without .sab) in quotations
    //saber2color     #      //0-Red 1-Orange 2-Yellow 3-Green 4-Blue 5-Purple 6-Silver
    //forcepowers            //FP_nameofforce,#|FP_nameofforce,#
    //forceregen      1      //default is 1 - 100%
    //forcepool       100    //default is 100

   //BP Stamina Fuel Bars
    //bpmultiplier    1      //This multiplies the number of attack points a saberist has by the value.
    //apmultiplier    1      //This multiplies the numer of block points a saberist has by the value.
    //jetpackFuelAmount     //Overrides default amount of BP/Fuel/Stamina added per second (8 default if trying to match standing BP regen).
    //jetpackFuelCooldown   //The amount of time in milliseconds until jetpackFuelAmount generates.
    //jetpackFuelCap    100     //Sets the max number BP/Stamina/Fuel can regenerate to.

    // EXTRA GOODIES
    // ------------------------------------------------------
    //meleeknockback               //doesn't work any more as of 1.5.2 - will be fixed!
    //customveh "nameofvehicle"    //if Droideka MBClass, this should be not the name of the .veh but instead the name within the .veh file.
                                   //(I recommend checking out my .veh guide if you want to have an MBII character as a vehicle!)

    //APPLY EXTRA FLAGS TO CERTAIN WEAPONS (See Wiki)

    //WP_MeleeFlags            //HELD_EXAMPLE|HELD_EXAMPLE
    //WP_SaberFlags
    //WP_BlasterPistolFlags    //Pistol flags
    //WP_BlasterFlags          //E-11 and variants/Shotgun flags
    //WP_StunBatonFlags        //Proj Flags
    //WP_RepeaterFlags         //Clone rifle flags
    //WP_DEMP2Flags            //Clone pistol flags
    //WP_FlechetteFlags        //DLT-20a/A280/EE-3 flags
    //WP_RocketLauncherFlags   //PLX class flags
    //WP_DetPackFlags          //T-21/Concussion Rifle Flags
    //WP_ConcussionFlags       //SBD blaster flags    //WP_DisruptorFlags
    //WP_BryarOldFlags         //Westar Pistol flags
    //WP_RealTDFlags
    //WP_FragNadeFlags
    //WP_PulseNadeFlags
    //WP_TripMineFlags
    //WP_FireNadeFlags
    //WP_SonicNadeFlags
    //WP_ConcNadeFlags
    //WP_CryoNadeFlags

    //RGB     -      Amount of RGB for custom RGB model. Between 0.0 and 1.0

    //customred      0.#
    //customgreen    0.#
    //customblue     0.#

    //headSwapModel   modelname    // name of model you would like to overlay on to current set model
    //headSwapSkin    skinname     // name of skin (if needed)

    //  Advanced JETPACK stuff (still under Classinfo)
    //  Jetpack stuff is pretty hard to get right, use the modview to find the right tag to attach

    //jetpackThrustEffect             "directory/nameofeffect"
    //jetpackThrustEffectEnhanced1    "directory/nameofenhancedeffect"
    //jetpackThrustEffectEnhanced2    "directory/nameofenhancedeffect"
    //jetpackIdleEffect               "directory/nameofeffect"
    //jetpackIdleEffectEnhanced1      "directory/nameofeffect"
    //jetpackIdleEffectEnhanced2      "directory/nameofeffect"
    //jetpackThrustSound              "sound/jetpack/thrust"
    //jetpackIdleSound                "sound/jetpack/idle"
    //jetpackStartSound               "sound/jetpack/ignite"
    //jetpackStopSound
    //jetpackJetOffset     #.# #.# #.#    // try "8.0 -6.2 20" as a starting point if effect is not aligning well
    //jetpackJet2Offset    #.# #.# #.#
    //jetpackJetAngles     #.# #.# #.#
    //jetpackJet2Angles    #.# #.# #.#
    //jetpackJetTag     // the tag found in a .skin file - *torso_backpack for example would
    //jetpackJet2Tag    // ?

}    //required to end Classinfo
// --------------------------------------------------------------------------------------------------------------------------------------

// And that's it, you are done! If you do not want to add a WeaponInfo or ForceInfo Replacement, this is where you would put this line to finish your .mbch:

//Description    ""

// WeaponInfo stuff! Each new weapon requires a new WeaponInfo

//WeaponInfo0    //Required if using WeaponInfo. Each new Weapon Override gets a new WeaponInfo, so the next would be WeaponInfo1
//{              //required if using WeaponInfo
    // ------------------------------------------------------
    //WeaponToReplace    WP_MELEE
    //WeaponBasedOff     WP_MELEE
    //NewWorldModel
    //NewViewModel
    //Icon
    //WeaponName    //everything above is required per WeaponInfo Weapon Replacement!
    // ------------------------------------------------------
    //CustomAmmo
    //ClipSize
    //ReloadTimeModifier         // default is 1 - 100%
    //AltFireEnabled        1
    //PrimFireEnabled       1
    //ProjSpeedModifier          // 1 is default, 100%
    //FPMult            1            //Determines FP damage of weapon
    //FPChargeMult  //Charge weapon FP multiplier
    //FPBlockMinMult  //Minimum FP Damage possible
    //FPBlockMaxMult  //Maximum FP Damage possible
    //FPNoBlockMinMult  //Minimum FP Damage possible when not blocking
    //FPNoBlockMaxMult  //Maximum FP Damage possible when not blocking

    // Weapon Replacement Effects - these should include the path to the .efx file
    // ------------------------------------------------------
    //ChargeEffect
    //MuzzleEffect
    //AltMuzzleEffect
    //MissileEffect
    //MissileMissEffect
    //AltMissleMissEffect
    //MuzzleEffect
    //AltMuzzleEffect
    //MissileEffect
    //MissileMissEffect
    //MissileMissEffectEnhanced1    // "directory/nameofseffectfolder/example"
    //MissileMissEffectEnhanced2
    //AltMissileMissEffect
    //AltMissileMissEffectEnhanced1
    //AltMissileMissEffectEnhanced2
    //MissileHitHumanEffect
    //MissileHitDroid
    //Missile3Effect
    //AltMissileEffect
    //PowerUpShotEffect

    //FleshImpact
    //DroidImpact
    //WallImpact
    //WallImpactEnhanced
    //WallImpactEnhanced2

    // Weapon Replacement Sounds - these should include the path to the sound
    // ------------------------------------------------------
    //FlashSound0
    //FlashSound1
    //FlashSound3
    //AltFlashSound0    // "directory/nameofsound/example"
    //AltFlashSound1
    //AltFlashSound2
    //AltFlashSound3
    //ChargeSound
    //SelectSound

    // Models - these should include the path to the model
    // ------------------------------------------------------
    //NewHandsModel
    //NewHandModel
    //NewBarrelModel
    //CorrectedWorldModel

    //MissileModel
    //AltMissileModel

    //PrimHitscanShot      #    // default is 0, Convert the primary fire of this weapon to an instant-hit hitscan trace instead of a physical projectile.
    //PrimHitscanTracer    #    //Valid values: 0 through 10. Percent change in 10% increments, of a visible tracer occurring with hitscan weaponfire of this weapon. 0 is never, 5 is 50% chance per hitscan trace, 10 is 100% chance.

    //altHitscanShot      #
    //AltHitScanTracer    #

    //primGore    #    // Will this weapon's fire upon striking someone or something, draw blood?
    //altGore     #    // (default depends on the weapon)

    //DisruptorBeam1    ""    // The path should lead to an image file or shader.
    //DisruptorBeam2    ""

    //IdleAnim      nameofanimation
    //FiringAnim    nameofanimation

    //isMinigun    // default is 0, adds animations to heavier weapons, mainly used for minigun purposes

//}    //required to end WeaponInfo
// --------------------------------------------------------------------------------------------------------------------------------------

//ForceInfo - Force Power Effect / Sound Replacement area!

// ------------------------------------------------------
//ForceInfo0    //required
//{             //required

    //ForceToReplace
    //Icon
    //ForcePowerName    //^required

    //StartSound    "sound/directory/sound"
    //LoopSound     "sound/directory/sound"
    //ConeEffect    "/directory/effect"

    //HandShaderBlue     #    //between 0-255
    //HandShaderRed      #
    //HandShaderGreen    #

    //HandShader2Red      #
    //HandShader2Green    #
    //HandShader2Blue     #

//}    //required to end Force Override

//DON'T FORGET TO USE BRACKETS PROPERLY OR ELSE YOUR FA WILL KABLOOM!

description	"Character name

- Dodge (3) [Class Special 1]

Description of lore of class"

```

Here are a few templates of nades (which I found to be harder to locate inside .pk3s:

```
// TEMPLATES:

// Nades are hard to find in the Weapons2 area, so I listed out some quick and easy WeaponInfo replacements for them!

//fire
//WeaponInfo{#}
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/plasma/plasma_w.glm"
    //NewViewModel       "models/weapons2/plasma/plasma.md3"
    //missilewModel      "models/weapons2/plasma/plasma_proj.md3"
    //Icon               "gfx/hud/w_icon_plasma"
    //WeaponName         "Fire Grenade"
//}

//sonic
//WeaponInfo{#}
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/sonic_detonator/sonic_det_w.glm"
    //NewViewModel       "models/weapons2/sonic_detonator/sonic_det.md3"
    //missileModel       "models/weapons2/sonic_detonator/sonic_det_proj.md3"
    //Icon               "gfx/hud/w_icon_sonic_det"
    //WeaponName         "Sonic Detonator"
//}

//
//emp
//WeaponInfo{#}
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/kes_pgren/laser_trap_w.glm"
    //NewViewModel       "models/weapons2/dummy/dummy.md3"
    //missileModel       "models/weapons2/fraggrenade/thermal_proj.md3"
    //Icon               "gfx/hud/w_icon_rpgren"
    //WeaponName         "EMP Grenade"
//}

//TD
//WeaponInfo{#}    //note, for TD you will need classflag CFL_REALTD
//{
    //WeaponToReplace    WP_THERMAL    //Required: Slot of weapon you're replacing
    //WeaponBasedOff     WP_THERMAL    //Required: For future use, should be the same as WeaponToReplace
    //NewWorldModel      "models/weapons2/thermal/thermal_w.glm"    //Required: New 3rd person/dropped weapon model
    //NewViewModel       "models/weapons2/thermal/thermal.md3"      //Required: New 1st person weapon model
    //MissileModel       "models/weapons2/thermal/thermal_proj.md3"
    //AltMissileModel    "models/weapons2/thermal/thermal_proj.md3"
    //Icon               "gfx/hud/w_icon_thermal"    //Required: Weapon change icon
    //WeaponName         "Thermal Detonator"         //Required: Weapon change display name
//}

//STORMIE TD
//WeaponInfo{#}    //note, for TD you will need classflag CFL_REALTD
//{
    //WeaponToReplace    WP_THERMAL    //Required: Slot of weapon you're replacing
    //WeaponBasedOff     WP_THERMAL    //Required: For future use, should be the same as WeaponToReplace
    //NewWorldModel      "models/weapons2/Stormi_TD/thermal_w.glm"    //Required: New 3rd person/dropped weapon model
    //NewViewModel       "models/weapons2/Stormi_TD/thermal.md3"      //Required: New 1st person weapon model
    //MissileModel       "models/weapons2/Stormi_TD/thermal_proj.md3"
    //AltMissileModel    "models/weapons2/Stormi_TD/thermal_proj.md3"
    //Icon               "gfx/hud/w_icon_thermal"    //Required: Weapon change icon
    //WeaponName         "Thermal Detonator"         //Required: Weapon change display name
//}

//WeaponInfo{#}    // old school ice nade
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/b17polaritypulse/laser_trap_w.glm"
    //NewViewModel       "models/weapons2/dummy/dummy.md3"
    //MissileModel       "models/weapons2/b17polaritypulse/laser_trap_proj.md3"
    //AltMissileModel    "models/weapons2/b17polaritypulse/laser_trap_proj.md3"
    //Icon               "gfx/hud/w_icon_polarity"
    //WeaponName         "Ice Nade"
//}

//WeaponInfo{#}
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/V-59_Concussion/V-59_conc_w.glm"
    //NewViewModel       "models/weapons2/V-59_Concussion/V-59_conc.md3"
    //MissileModel       "models/weapons2/V-59_Concussion/V-59_conc_proj.md3"
    //AltMissileModel    "models/weapons2/V-59_Concussion/V-59_conc_proj.md3"
    //Icon               "gfx/hud/w_icon_V-59_conc"
    //WeaponName         "V-59 Concussion Grenade"
//}

//WeaponInfo{#}
//{
    //WeaponToReplace    WP_TRIP_MINE
    //WeaponBasedOff     WP_TRIP_MINE
    //NewWorldModel      "models/weapons2/oldfraggrenade/thermal_w.glm"
    //NewViewModel       "models/weapons2/oldfraggrenade/thermal.md3"
    //MissileModel       "models/weapons2/oldfraggrenade/thermal_proj.md3"
    //AltMissileModel    "models/weapons2/oldfraggrenade/thermal_proj.md3"
    //Icon               "gfx/hud/w_icon_oldfraggrenade"
    //WeaponName         "Frag Grenade"
//}

```