Creating a proper .sab file can be a very intensive process, or quite simple! .sab files are used to customize WP_Sabers. Generally they are used in FA, but you could make your own replacement for open/duel if you wanted as well.
Advanced .sab code offer a lot of customization with damage, effects and sounds. This guide will walk you through every possible customization available! At the bottom there also are bare-bones .sab files for those just looking to add a simple lightsaber with no frills attached.
When making a map or file, where in the .pk3 do you put .sab files?
- ext_data/sabers
Like most code in MBII, the best way to start creating is slowly, testing often and referring to other .sab files already created (look within the MBhilts.pk3) and adding lines as they begin to make sense. Fortunately, I have made a guide for you here with all of the relevant lines. But let's make our very first .sab file for starters!
Here is your most basic .sab file:
singleexample { name "Single Example" saberType SABER_SINGLE saberModel "models/weapons2/saber_4/saber_4.glm" soundOn "sound/weapons/saber/saberon.wav" soundLoop "sound/weapons/saber/saberhum4.wav" soundOff "sound/weapons/saber/saberoff.wav" saberLength 40 //40 is default for single saberColor random //not required to specify in MBII }
If this .sab is for an FA, make sure to add this line within the brackets so your saber doesn't appear in Duel or Open mode!
notinopen 1
Duals / Staff:[]
You do not necessarily need to clarify if your weapon is for duals, as within the .mbch you could put the name of the .sab twice in both the saber1 line and the saber2 line. But this line is important as it will clarify what style your duals or staff will use if the style is changed (or else it will default as a single saber). Duals are only allowed one extra style other than SS_DUAL. Use this line within the brackets to specify:
singleBladeStyle MEDIUM //fast, tavion, medium, desann, strong, dual, staff
Here is an example of a default Staff .sab
staffexample { name "Staff_example" saberType SABER_STAFF saberModel "models/weapons2/saber_dual_3/saber_dual_3.glm" soundOn "sound/weapons/saber/saberon.wav" soundLoop "sound/weapons/saber/saberhum4.wav" soundOff "sound/weapons/saber/saberoff.wav" numBlades 2 saberLength 32 //32 is default for staff twoHanded 1 saberStyle staff //since it is set to staff, there will be no other style NotInOpen 1 }
Note, 'singleexample' and 'staffexample' would be what you would write as your value to saber1 or saber2 inside your .mbch file.
Guide[]
Copy and paste this into your own text editor and remove // on lines which you wish to use! There are a lot of fun ways to customize sabers!
NAMEOFSABHERE // This is the hilt or weapon's name for directory purposes
{ // REQUIRED
// ------------------------------------------------------
name "Public Name of Weapon" // as appears when scrolling through weapon here (not super important for MBII since WeaponInfo overrides)
notinopen 1 // I advise keeping this at 1, unless you want a replacement to see it in duel or open mode
saberType SABER_SINGLE // required - SABER_SINGLE or SABER_STAFF are your choices for MBII
saberModel "models/weapons2/saber_reborn/saber_w.glm" // required - direct to .glm model file
//customSkin "" // not required - a .skin file to apply to the saber hilt model, if any (overrides saber hilt model's internal texture mapping)
twoHanded 0 // required for Staff, whether or not it requires 2 hands (makes it restrict force powers but makes it stronger in locks or parries)
numBlades "" // 1 - how many blades it has (min of 1, max of 8)
saberLength "32" // 32 is default for staff, 40 is for single - how long the saber's first blade should be (minimum of 4)
//saberLength2 // and so-on, and so forth
//NOTE: these should be inputted in order - setting "saberLength" automatically sets all of the others to the same length
saberRadius 3 // how wide the saber's first blade should be (minimum of 0.25)
//saberRadius2 //saberRadius - how wide the saber's second blade should be (minimum of 0.25)
//NOTE: these should be inputted in order - setting "saberRadius" automatically sets all of the others to the same length
//maxChain 0 // how many moves can be chained in a row with this weapon (-1 is infinite, 0 is use default behavior)
//throwable 1 // whether or not it can be thrown
//bounceOnWalls 0 // whether or not blade causes stagger if hitting a surface
//disarmable 1 // whether or not it can be disarmed (dropped), this usually occurs from mblock or saber being hit when not blocking
//blasterBlocking 1 // whether or not user will block blaster fire or not (regardless of Force Defense)
//forceBlocking 0 // whether or not holding block will protect from lightning/destruction - Jedi/Sith and anything with forceblock have this automatically
//boltToWrist 0 // useful if using special hilts not meant to be held
//noDlight 1 // disables Dynamic Light on saber
//oninwater 1
// force power restrictions
// ------------------------------------------------------
//forceRestrict FP_VALUEHERE //what force powers it restricts, use a
//forceRestrict FP_VALUEHERE // separate entry line -per- power. Keys:
//FP_HEAL, FP_LEVITATION, FP_SPEED, FP_PUSH,
// FP_PULL, FP_TELEPATHY, FP_GRIP, FP_LIGHTNING,
// FP_SABERTHROW, FP_SABER_DEFENSE
//+ more (look up .mbch values in MBII forums for more)
// Animations and movement (find all of the animations via modview + tutorials)
// ------------------------------------------------------
//moveSpeedScale 1 //1.0 is default - you move faster/slower when using this saber
//animSpeedScale 1 //1.0 is default - plays normal attack animations faster/slower
//bounceOnWalls 0
//kataMove NAMEOFANIMATION // if set, player will execute this move when they press both attack buttons at the same time
//lungeAtkMove NAMEOFANIMATION // if set, player will execute this move when they crouch+fwd+attack
//jumpAtkUpMove NAMEOFANIMATION // if set, player will execute this move when they jump+attack
//jumpAtkFwdMove NAMEOFANIMATION // if set, player will execute this move when they jump+fwd+attack
//jumpAtkBackMove NAMEOFANIMATION // if set, player will execute this move when they jump+back+attack
//jumpAtkRightMove NAMEOFANIMATION // if set, player will execute this move when they jump+rightattack
//jumpAtkLeftMove NAMEOFANIMATION // if set, player will execute this move when they jump+left+attack
// ANIMATION NOTE: TO RESTRICT SPECIALS USE THIS ANIMATION -> LS_NONE
//readyAnim NAMEOFANIMATION //-1 - anim to use when standing idle
//drawAnim NAMEOFANIMATION //-1 - anim to use when drawing weapon
//putawayAnim NAMEOFANIMATION //-1 - anim to use when putting weapon away
//tauntAnim NAMEOFANIMATION //-1 - anim to use when hit "taunt"
//bowAnim NAMEOFANIMATION //-1 - anim to use when hit "bow"
//meditateAnim NAMEOFANIMATION //-1 - anim to use when hit "meditate"
//flourishAnim NAMEOFANIMATION //-1 - anim to use when hit "flourish"
//gloatAnim NAMEOFANIMATION //-1 - anim to use when hit "gloat"
//readyAnimOnlyTorso 0 //0 is default - should readyanim only play on torso section of body?
//***NOTE: you can only have a maximum of 2 "styles" of blades, so this next value, "bladeStyle2Start" is the number of the first blade to use these value on... all blades before this use the normal values above, all blades at and after this number use the secondary values below***
//***The following can be different for the extra blades - not setting them individually defaults them to the value for the whole saber (and first blade)***
//lungeAtkMove NAMEOFANIMATION
//jumpAtkUpMove NAMEOFANIMATION
//jumpAtkFwdMove NAMEOFANIMATION
//jumpAtkBackMove NAMEOFANIMATION
//jumpAtkRightMove NAMEOFANIMATION
//jumpAtkLeftMove NAMEOFANIMATION
//slapanim nameofamin
//readyanim NAMEOFANIMATION
//drawAnim NAMEOFANIMATION
//putawayAnim NAMEOFANIMATION
//tauntAnim NAMEOFANIMATION
//bowAnim NAMEOFANIMATION
//meditateAnim NAMEOFANIMATION
//flourishAnim NAMEOFANIMATION
//gloatAnim NAMEOFANIMATION
// Disable aspects of sabering or force acrobatics
// ------------------------------------------------------
//noRollStab 0
//noPullAttack 0
//noBackAttack 0
//noStabDown 0
//noWallRuns 0
//noWallFlips 0
//noWallGrab 0
//noRolls 0
//noFlips 0
//noCartwheels 0
//noKicks 0
//noMirrorAttacks 0
// Damage
// ------------------------------------------------------
//transitionDamage 0 //if set, the blade does damage in start, transition and return anims (like strong style does)
//alwaysBlock 0 //disables or enables blocking, affects saber box size... basically toggle base-style or not!
// Note: for these 5 lines below, copy and add a new line with 2 if you wish to add certain damages to dual blades, for example: knockbackScale2
//knockbackScale 0 //0 is default - if non-zero, uses damage done to calculate an appropriate amount of knockback
//damageScale 1 //1 is default - scale up or down the damage done by the saber
//splashRadius 0 //0 is default- radius of splashDamage
//splashDamage 0 //0 is default - amount of splashDamage, 100% at a distance of 0, 0% at a distance = splashRadius
//splashKnockback 0 //0 is default - amount of splashKnockback, 100% at a distance of 0, 0% at a distance = splashRadius
// SOUNDS
// ------------------------------------------------------
soundOn "sound/weapons/saber/enemy_saber_on.wav" //turn on sound
soundLoop "sound/weapons/saber/saberhum3.wav" //loop sound (must be a .wav file), for nothing->"sounds\weapons\saber\nothing.wav"
soundOff "sound/weapons/saber/enemy_saber_off.wav" //turn off sound
// REQUIRED ^
// IF YOU REQUIRE A DIFFERENT SOUND FOR SECOND BLADE, follow similar number format: Swing2Sound#
//swingSound1 "" // if set, plays one of these 3 sounds when swung during an attack - NOTE: must provide all 3!!!
//swingSound2 ""
//swingSound3 "" // NOTE: must provide all 3!!!
//hitSound1 "" // if set, plays one of these 3 sounds when saber hits a person - NOTE: must provide all 3!!!
//hitSound2 ""
//hitSound3 "" // NOTE: must provide all 3!!!
//blockSound1 "" // if set, plays one of these 3 sounds when saber/sword hits another saber/sword - NOTE: must provide all 3!!!
//blockSound2 ""
//blockSound3 "" // NOTE: must provide all 3!!!
//bounceSound1 "" // if bounceOnWall is set to 1
//bounceSound2 "" // plays one of these sounds
//bounceSound3 "" // NOTE: must provide all 3!!!
//spinSound "" // if set, plays this sound as it spins when thrown
//I am unsure where these appear, but some .sab files have it:
//fallSound1 ""
//fallSound2 ""
//fallSound3 ""
// EFFECTS
// ------------------------------------------------------
//g2MarksShader "" // if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
//g2MarksShader2 ""
//g2WeaponMarkShader "" // if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
//g2WeaponMarkShader2 "" //set if using dual blades
//noG2Marks 0 // disables slash wounds on player models
//useGoreConfig 0 // what makes getting shot show different blood effects, namely seen from proj rifles hits, sometimes its a red or green puff.
//useGoreConfig2 0 // if needed for second saber
//disabledBladeIsHot 0 // underwater effects
//disabledBladeIsHot2 0 // if second saber
//noBladeCortosisReaction 1 // puff effect caused by hitting a cortosis (seen in open on SBDs)
//noBladeCortosisReaction2 1 // secondary saber
//hitPersonEffect "" // if set, plays this effect when the saber/sword hits a person (instead of "saber/blood_sparks_mp.efx")
//hitOtherEffect "" //if set, plays this effect when the saber/sword hits something else damagable (instead of "saber/saber_cut.efx")
//blockEffect "" // if set, plays this effect when the saber/sword hits another saber/sword (instead of "saber/saber_block.efx")
//hitPersonEffect2 ""
//hitOtherEffect2 "" //<- ^ if there is second saber
//blockEffect2 "" //if second saber
//alwaysBlock ""
//trailStyle "" // default (0) is normal, 1 is a motion blur and 2 is no trail at all (good for real-sword type mods)
//trailstyle2 "" //second saber
// for blunt melee weapons:
//noBladeEffects 0 //disables saber blade effects
//noDismemberment 0
//hitOtherEffect 0 // if set, plays this effect when the saber/sword hits something else damagable (instead of "saber/saber_cut.efx")
//noClashFlare 1
//bladeStyle2Start 0 //0 - if set, blades from this number and higher use the following values (otherwise, they use the normal values already set)
} //REQUIRED TO END .SAB FILE
//DISABLED IN MBII, I kept these here as they are useful in base!
// ------------------------------------------------------
//saberStyle none // what one style it's limited to, if any (fast, medium, strong, desann, tavion) (not applicable in MBII)
//lockable 1 // whether or not it can be stuck in a saber lock
//blocking 1 // whether or not user will try to block incoming shots (shots always bounce off it, this just determines if the user *tries* to block with it)
//lockBonus 0 // this pushes harder/weaker in saberlocks
//parryBonus 0 // this is stronger/weaker in a parry (harder to break, more likely to knockaway)
//breakParryBonus 0 // this is more/less likely to break a parry
//disarmBonus 0 // this is more/less likely to disarm another saber in a saberlock or knockaway
//singleBladeStyle none // makes it so that you use a different style if you only have the first blade active
//singleBladeThrowable 0 // makes it so that you can throw this saber if only the first blade is on
//brokenSaber1 none // if saber is actually hit by another saber, it can be cut in half/broken and will be replaced with this saber in your right hand
//brokenSaber2 none // if saber is actually hit by another saber, it can be cut in half/broken and will be replaced with this saber in your left hand
//kataMove NAMEOFANIMATION
//bladeShader "" // if set, overrides the shader used for the saber blade?
//trailShader "" // if set, overrides the shader used for the saber trail?
//bladeEffect "" // if set, plays this effect at the blade tag
//noIdleEffect ""
//returnDamage 0 //when returning from a saber throw, it keeps spinning and doing damage