.sab: Difference between revisions

From Jedi Knight Wiki | JKHub
mNo edit summary
m (Reverted edit by 2A09:BAC5:62CB:183C:0:0:26A:9C (talk) to last revision by 135.148.121.191)
Tag: Rollback
 
(9 intermediate revisions by 4 users not shown)
Line 54: Line 54:
| brokenSaber1, brokenSaber2 || This is unused in [[BaseJKA|base]] multiplayer, but was supposed to be model files to use when your staff gets broken. It does work however in Single Player. It may be used in some mods, so set it to the usual value of "brokenstaff", or whatever broken staff model the mod has.
| brokenSaber1, brokenSaber2 || This is unused in [[BaseJKA|base]] multiplayer, but was supposed to be model files to use when your staff gets broken. It does work however in Single Player. It may be used in some mods, so set it to the usual value of "brokenstaff", or whatever broken staff model the mod has.
|-
|-
| twoHanded                  || set this to 1 for a staff. This restricts [[force powers]] if g_saberRestrictForce is set to 1, but makes the hilt stronger in [[Saber Lock|locks]] and [[Parrying|parries]].
| twoHanded                  || set this to 1 for a staff. This restricts [[force powers]] if g_saberRestrictForce is set to 1, but makes the hilt stronger in [[Saber Lock|locks]] and [[Parrying|parries]]. And it makes the hilt break through other sabers(breakParryBouns).
|}
|}


Line 119: Line 119:
| parryBonus          || a bonus in [[parrying|parries]]. In Single Player, to block sabers with a break parry bonus, this must equal that bonus +2 (ex. a saber needs a PB of 3 to block a BPB of 1).
| parryBonus          || a bonus in [[parrying|parries]]. In Single Player, to block sabers with a break parry bonus, this must equal that bonus +2 (ex. a saber needs a PB of 3 to block a BPB of 1).
|-
|-
| breakParryBonus    || a bonus to break a parry. In Single Player, values of 1+ makes medium, staff, tavion, and perhaps duals stance swings uninterruptible. At most they can only be blocked partially.
| breakParryBonus    || a bonus to break a parry. In Single Player, values of 1+ makes medium, staff, tavion, and perhaps duals stance swings uninterruptible. At most they can only be blocked partially. And without this setting, 'twoHanded 1' can make the hilt break through other sabers. In addition, using Force Rage is capable of breaking parries temporarily.
|-
|-
| disarmBonus        || you should get the idea by now...
| disarmBonus        || you should get the idea by now...
Line 139: Line 139:
| saberRadius        || (normally 3) how wide the saber's first blade should be (minimum of 0.25)
| saberRadius        || (normally 3) how wide the saber's first blade should be (minimum of 0.25)
|-
|-
| bladeStyle2Start    || set this to a blade number. Any keys set after this line in the .sab entry will apply only to blades of the set number or higher, allowing you to give different blades different properties (should allow you to have a weapon with one sword blade and one saber blade and the like). This is unconfirmed, so test thoroughly if you use it. You should even be able to use this line multiple times with different values.
| bladeStyle2Start    || used to define which blades use bladeStyle and which ones sue bladeStyle2, set to the number of last blade you want to use the default style. Example file can be found at the bottom.
|}
|}
※ Once a player holds a saber(.sab) having 'saberStyle' or 'saberStyleLearned' or 'saberStyleForbidden', Restricting npc's saberStyle by editing .sab file will be nullified and npcs are going to begin switching their style regardless of your option.  I think the function of the code which restricts their saberStyle is focused on the player, so restriction on other npc does not working properly.




Line 185: Line 187:
| swingSound3  ||
| swingSound3  ||
|-
|-
| fallSound1  ||
| fallSound1  || for when the saber falls to the ground
|-
|-
| fallSound2  ||
| fallSound2  ||
Line 203: Line 205:
| blockSound3  ||
| blockSound3  ||
|-
|-
| bounceSound1 ||
| bounceSound1 || these are for your blade/saber bouncing off a wall
|-
|-
| bounceSound2 ||
| bounceSound2 ||
Line 384: Line 386:
     blockSound2  "sound/weapons/spoonofdeath/fall2.mp3"
     blockSound2  "sound/weapons/spoonofdeath/fall2.mp3"
     blockSound3  "sound/weapons/spoonofdeath/fall3.mp3"
     blockSound3  "sound/weapons/spoonofdeath/fall3.mp3"
}</nowiki>
===BladeStyle2Start example===
<nowiki>dual_test
{
name "Test"
saberType SABER_STAFF
saberModel "models/weapons2/saber_dual_1/saber_dual_1.glm"
soundOn "sound/weapons/saber/saberon.wav"
soundLoop "sound/weapons/saber/saberhum4.wav"
soundOff "sound/weapons/saber/saberoff.wav"
saberColor red
saberColor2 blue
numBlades 2
saberLength 32
saberStyle staff
throwable 0
singleBladeStyle medium
singleBladeThrowable 1
brokenSaber1 brokenstaff
brokenSaber2 brokenstaff
twoHanded 1
//define Bladestyle 1, you can have a maximum of 2 bladestyles per saber
noblade 0
trailstyle 0
noDlight 0
//define Bladestyle2
noblade2 1
trailstyle2 1
noDlight2 1
//Tell the game to use bladestyle2 for all blades after Blade 1
BladeStyle2Start 1
}</nowiki>
}</nowiki>


[[Category:File Types]]
[[Category:File Types]]

Latest revision as of 00:30, 12 June 2024

A .sab file sets the properties of one or more saber hilts in JKA. You can put as many different sabers into one file as you wish, and can have more than one hilt per model.

A each saber has the following syntax in a .sab file:

[Saber_name]
{
    [Key] [Value]
    [Key] [Value]
}

Where [saber_name] is the name the game refers to the saber by (and the name you can use with the /saber command) and the [key]s are various variables the modder can assign [value]s to, to give the hilt properties. A modder can put as many keys between the curly braces as they wish. Any keys that are not present will be given their default values.


Keys

Standard Keys

name note
name this is the name that will appear in the menu. you can either type a name inside quote marks (eg "MUG's Saber") or point it to a menu string (as with single_1)
saberType either SABER_SINGLE for a normal saber or SABER_STAFF for a two-handed Darth Maul style hilt.
saberModel the glm file that contains the model for the hilt.
customSkin a .skin file to apply to the saber hilt model, if any (overrides saber hilt model's internal texture mapping), needs file path (ex. models/weapons2/saber_reborn/jedi.skin)
soundOn the sound file to play when the saber is activated.
soundLoop the sound file to loop while it is on.
soundOff I think you get the idea now.
saberLength This should normally be 40 for a single saber and 32 for a staff.
saberColor Should always be set to "random". but you can type the name of another colour if you really want.


Staff Keys

name note
numBlades 2 for a staff, you can enter more if the hilt model allows for it. Maximum is 8.
throwable Set to 0 for a staff so that the saber is not throwable. This allows a saber to kick. Set this to 1, and "singleBladeThrowable" to 0 for throwable saber staffs.
singleBladeStyle the style to use when set to one blade. Should normally be "medium". (fast, medium, strong, desann, tavion)
singleBladeThrowable set to 1 to make the staff throwable when set to one blade. If you set throwable to 1 and this value to 0 for a saber staff, it allows the saber to be thrown with both blades ignited.
brokenSaber1, brokenSaber2 This is unused in base multiplayer, but was supposed to be model files to use when your staff gets broken. It does work however in Single Player. It may be used in some mods, so set it to the usual value of "brokenstaff", or whatever broken staff model the mod has.
twoHanded set this to 1 for a staff. This restricts force powers if g_saberRestrictForce is set to 1, but makes the hilt stronger in locks and parries. And it makes the hilt break through other sabers(breakParryBouns).


Sword and Non-lightsaber-blade Weapon Keys

name note
noDlight 1 (removes the saber's dynamic glow effect)
noBlade 1 (Removes the saber blade effect)
noIdleEffect 1 (prevents the saber from drawing effects or doing damage when it collides with stuff without you doing an attack.
noWallMarks 1 Pretty obvious.
trailStyle 0 For no trail, 1 for a saber trail, 2 for a sword trail.
idleInBack Does nothing unless you are using JA+. 1 to make the weapon go in whatever holster you selected over your back when out of use, 2 to make it go over your back without a holster.
bounceOnWalls Optionally you may want to set this to 1 to make it hit walls. This can be very annoying however, as several attacks always hit the floor.


Misc Keys

name note
notInMP set this to one to make the saber nonselectable in MP.
saberStyle a single combat style/stance which the saber is locked in. (fast, medium, desann, tavion etc.)
saberStyleLearned stances that are given to the player upon being given the saber
saberStyleForbidden which styles can't be used with the saber, doesn't take away the styles from the player but doesn't allow them to be used with the saber
lockable 0/1 (if it can be in a saber lock)
disarmable 0/1 (if it can be disarmed)
blocking 0 to stop the character from trying to auto block projectiles (shots will bounce off however)
forceRestrict a power to restrict if twoHanded is set to 1. The cvar g_saberRestrictForce may have to be set to 1. Enter the key multiple times to block multiple powers:
  • FP_HEAL
  • FP_LEVITATION
  • FP_SPEED
  • FP_PUSH
  • FP_PULL
  • FP_TELEPATHY
  • FP_GRIP
  • FP_LIGHTNING
  • FP_SABERTHROW
  • FP_SABER_DEFENSE
  • FP_SABER_OFFENSE
  • FP_RAGE
  • FP_PROTECT
  • FP_ABSORB
  • FP_DRAIN
  • FP_SEE
lockBonus a bonus in saber locks
parryBonus a bonus in parries. In Single Player, to block sabers with a break parry bonus, this must equal that bonus +2 (ex. a saber needs a PB of 3 to block a BPB of 1).
breakParryBonus a bonus to break a parry. In Single Player, values of 1+ makes medium, staff, tavion, and perhaps duals stance swings uninterruptible. At most they can only be blocked partially. And without this setting, 'twoHanded 1' can make the hilt break through other sabers. In addition, using Force Rage is capable of breaking parries temporarily.
disarmBonus you should get the idea by now...
returnDamage 1 to make a saber keep spinning and doing damage when returning from a throw, rather than flying straight back.
customSkin an alternate texture to apply to the model.
onInWater 1 to allow on in water.
boltToWrist if 1, attaches the hilt to the wrist rather than the hand, so you can make claws and the likes.
noDismemberment set to 1 for clubs and blunt weapons.
alwaysBlock set to 1 for shields etc. This also lets you block when you normally couldn't, such as mid-swing or when knocked over.
noManualDeactivate if 1, you cant switch dual and staff to single mode. you can still press 1 to deactivate the saber.
saberRadius (normally 3) how wide the saber's first blade should be (minimum of 0.25)
bladeStyle2Start used to define which blades use bladeStyle and which ones sue bladeStyle2, set to the number of last blade you want to use the default style. Example file can be found at the bottom.

※ Once a player holds a saber(.sab) having 'saberStyle' or 'saberStyleLearned' or 'saberStyleForbidden', Restricting npc's saberStyle by editing .sab file will be nullified and npcs are going to begin switching their style regardless of your option. I think the function of the code which restricts their saberStyle is focused on the player, so restriction on other npc does not working properly.


Crazy Keys

name note
moveSpeedScale (decimals allowed) makes the character speed change. (e.g 0.5 is half speed, 2 is double speed)
animSpeedScale (decimals allowed) Attack speed. (e.g 0.5 is half speed, 2 is double speed)
knockbackScale amount that hit players are knocked back
damageScale Usually this is only helpful for making over powered sabers, but you can also make low damage training sabers with it.
splashDamage 100% of this value is dealt at point of impact, 0% delt at the splash radius:
splashRadius maximum range of splash damage
splashKnockback scales like splashDamage


Multiple Blade Keys

  • saberLength2, saberLength3 etc. (up to 8)
  • saberColor2 etc.
  • saberRadius2 etc.


Custom Sound Keys

Set any of the following to a valid sound file:

name note
spinsound when the saber is thrown. Also used in katas.
swingSound1
swingSound2
swingSound3
fallSound1 for when the saber falls to the ground
fallSound2
fallSound3
hitSound1
hitSound2
hitSound3
blockSound1 these are for when your attacks are blocked, not the other way around.
blockSound2
blockSound3
bounceSound1 these are for your blade/saber bouncing off a wall
bounceSound2
bounceSound3


Effects

Set these to valid .efx files:

name note
hitPersonEffect impact on players
g2MarksShader Marks left on players
hitOtherEffect impact on walls
blockEffect when you parry a blow
bladeEffect Use an .efx file instead of a lightsaber blade. Reports of this causing crashes when the saber is thrown.


Animations

Set these to a name from anims.h or BehavEd. Animations are handled server-side, so you can adjust the animations of base sabers on your server and players will see the new animations. They will also see animations set in custom sabers that they don't have, so long as those sabers are saved on the server, and the animations are base.

  • readyAnim
  • drawAnim
  • putawayAnim
  • tauntAnim
  • bowAnim
  • meditateAnim
  • flourishAnim
  • gloatAnim


Disable Moves

Set these to 1 to disable each move:

  • noRollStab
  • noPullAttack
  • noBackAttack
  • noStabDown
  • noWallRuns
  • noWallFlips
  • noWallGrab
  • noRolls
  • noFlips
  • noCartwheels
  • noKicks
  • noMirrorAttacks (the stab left and right at once attack with dual sabers)


Move Replacements

Moves to Replace (Keys)

name note
kataMove kata
lungeAtkMove lunge
jumptAtkUpMove jump + attack
jumpAtkFwdMove dfa
jumpAtkBackMove (like staff reverse dfa flip)
jumptAtkRightMove (like butterfly)
jumpAtkLeftMove (like butterfly)

Moves to Set (Values)

  • LS_NONE (regular attack)
  • LS_A_TL2BR
  • LS_A_L2R
  • LS_A_BL2TR
  • LS_A_BR2TL
  • LS_A_R2L
  • LS_A_TR2BL
  • LS_A_T2B
  • LS_A_BACKSTAB
  • LS_A_BACK
  • LS_A_BACK_CR
  • LS_ROLL_STAB
  • LS_A_LUNGE
  • LS_A_JUMP_T__B_
  • LS_A_FLIP_STAB
  • LS_A_FLIP_SLASH
  • LS_JUMPATTACK_DUAL
  • LS_JUMPATTACK_ARIAL_LEFT
  • LS_JUMPATTACK_ARIAL_RIGHT
  • LS_JUMPATTACK_CART_LEFT
  • LS_JUMPATTACK_CART_RIGHT
  • LS_JUMPATTACK_STAFF_LEFT
  • LS_JUMPATTACK_STAFF_RIGHT
  • LS_BUTTERFLY_LEFT
  • LS_BUTTERFLY_RIGHT
  • LS_A_BACKFLIP_ATK
  • LS_SPINATTACK_DUAL
  • LS_SPINATTACK
  • LS_LEAP_ATTACK
  • LS_SWOOP_ATTACK_RIGHT
  • LS_SWOOP_ATTACK_LEFT
  • LS_TAUNTAUN_ATTACK_RIGHT
  • LS_TAUNTAUN_ATTACK_LEFT
  • LS_KICK_F
  • LS_KICK_B
  • LS_KICK_R
  • LS_KICK_L
  • LS_KICK_S
  • LS_KICK_BF
  • LS_KICK_RL
  • LS_KICK_F_AIR
  • LS_KICK_B_AIR
  • LS_KICK_R_AIR
  • LS_KICK_L_AIR
  • LS_STABDOWN
  • LS_STABDOWN_STAFF
  • LS_STABDOWN_DUAL
  • LS_DUAL_SPIN_PROTECT
  • LS_STAFF_SOULCAL
  • LS_A1_SPECIAL
  • LS_A2_SPECIAL
  • LS_A3_SPECIAL
  • LS_UPSIDE_DOWN_ATTACK
  • LS_PULL_ATTACK_STAB
  • LS_PULL_ATTACK_SWING
  • LS_SPINATTACK_ALORA
  • LS_DUAL_FB
  • LS_DUAL_LR
  • LS_HILT_BASH


Example Custom .SAB

Spoon Hilt

spoon
{
    name          "Spoon of Death"
    saberType     SABER_SINGLE
    saberModel    "models/weapons2/spoon/spoon.glm"
    saberLength   10
    noWallMarks   1
    throwable     1
    notInMP       0
    noDlight      1
    noBlade       1
    trailStyle    1
    noIdleEffect  1
    onInWater     1
    norollStab    0
    bounceOnWalls 1
    idleinback    2
    soundOn       "sound/weapons/spoonofdeath/on.mp3"
    soundOff      "sound/weapons/spoonofdeath/off.mp3"
    soundLoop     "sound/effects/null.wav"
    swingSound1   "sound/weapons/spoonofdeath/swing1.mp3"
    swingSound2   "sound/weapons/spoonofdeath/swing2.mp3"
    swingSound3   "sound/weapons/spoonofdeath/swing3.mp3"
    spinSound     "sound/weapons/spoonofdeath/on.mp3"
    fallSound1    "sound/weapons/spoonofdeath/fall1.mp3"
    fallSound2    "sound/weapons/spoonofdeath/fall2.mp3"
    fallSound3    "sound/weapons/spoonofdeath/fall3.mp3"
    fallSound4    "sound/weapons/spoonofdeath/fall4.mp3"
    hitSound1     "sound/weapons/spoonofdeath/hit1.mp3"
    hitSound2     "sound/weapons/spoonofdeath/hit2.mp3"
    hitSound3     "sound/weapons/spoonofdeath/hit3.mp3"
    blockSound1   "sound/weapons/spoonofdeath/fall1.mp3"
    blockSound2   "sound/weapons/spoonofdeath/fall2.mp3"
    blockSound3   "sound/weapons/spoonofdeath/fall3.mp3"
}

BladeStyle2Start example

dual_test
{
	name		"Test"
	saberType	SABER_STAFF
	saberModel	"models/weapons2/saber_dual_1/saber_dual_1.glm"
	soundOn		"sound/weapons/saber/saberon.wav"
	soundLoop	"sound/weapons/saber/saberhum4.wav"
	soundOff	"sound/weapons/saber/saberoff.wav"
	saberColor	red
	saberColor2	blue
	numBlades	2
	saberLength	32
	saberStyle	staff
	throwable		0
	singleBladeStyle	medium
	singleBladeThrowable		1
	brokenSaber1	brokenstaff
	brokenSaber2	brokenstaff
	twoHanded		1
	
	//define Bladestyle 1, you can have a maximum of 2 bladestyles per saber
	noblade			0
	trailstyle		0
	noDlight		0
	
	//define Bladestyle2
	noblade2		1
	trailstyle2		1
	noDlight2		1

	//Tell the game to use bladestyle2 for all blades after Blade 1
	BladeStyle2Start	1
}