.npc
A .NPC File defines an npc. It uses a variety of options to customize the npc to the modder's liking.
Format
Format
Traditionally, an .npc file is simply a text file, like .txt, renamed to the .npc extension. At the top of file, add the npc name you want your npc to have. This is the name you will use to spawn your npc. Then, on a new line, type an opening bracket ('{'). Then add your modifiers. Your modifiers are options with arguments that make up the npc's attributes. Then, finish off the file with a closing bracket. Your syntax should be as follows:
[npc name] { [modifiers] }
You can add more than one npc per .npc file, just be sure to properly name and close off each npc with brackets.
Usage of Modifiers
Each modifier defines an npc characteristic, and requires an argument. Simply give a new line to each modifier, with the argument directly following the modifier after a space. For example, if you wanted your npc to have a "playermodel" of "kyle" and an "aim" value of "5", you would type:
playermodel kyle aim 5
NPC classes
Special classes
- CLASS_PLAYER
- CLASS_VEHICLE
New Republic / Kyle's allies
- CLASS_BESPIN_COP
- CLASS_REBEL
- CLASS_JAN
- CLASS_LANDO
- CLASS_MONMOTHMA
- CLASS_MORGAN
- CLASS_PRISONER
Imperials
- CLASS_IMPERIAL
- CLASS_IMPWORKER
- CLASS_STORMTROOPER
- CLASS_SWAMPTROOPER
- CLASS_HAZARD_TROOPER
- CLASS_ROCKETTROOPER
- CLASS_SABOTEUR
Aliens
Hostile
- CLASS_GRAN
- CLASS_RODIAN
- CLASS_TRANDOSHAN
- CLASS_WEEQUAY
- CLASS_NOGHRI
- CLASS_TUSKEN
Non-hostile
- CLASS_BARTENDER
- CLASS_JAWA
- CLASS_UGNAUGHT
Jedi
- CLASS_JEDI
- CLASS_KYLE
- CLASS_LUKE
- CLASS_REBORN
- CLASS_SHADOWTROOPER
Droids and mechs
Friendly
- CLASS_SEEKER
Hostile
- CLASS_REMOTE
- CLASS_INTERROGATOR
- CLASS_PROBE
- CLASS_SENTRY
- CLASS_ASSASSIN_DROID
- CLASS_SABER_DROID
- CLASS_MARK1
- CLASS_MARK2
- CLASS_ATST
Non-hostile
- CLASS_MOUSE
- CLASS_GONK
- CLASS_PROTOCOL
- CLASS_R2D2
- CLASS_R5D2
Beasts
- CLASS_MINEMONSTER
- CLASS_HOWLER
- CLASS_RANCOR
- CLASS_SAND_CREATURE
- CLASS_WAMPA
- CLASS_GLIDER (not fully implemented?)
Bosses
- CLASS_BOBAFETT
- CLASS_GALAK_MECH
- CLASS_REELO
- CLASS_ALORA
- CLASS_DESANN
- CLASS_TAVION
Modifiers
Basic Modifiers
- "playermodel". Tells the game what model to use for this npc. Valid values for this modifier include any playermodel in the base/models/players directory.
- "weapon". Depicts what weapon the npc will use. Valid values are any weapon type, however WP_NONE only works with a few classes. Some NPC types can switch between multiple weapons, like Grans or Boba Fett.
- "playerTeam". Defines the npc's allegiance. Valid values are "TEAM_PLAYER", "TEAM_ENEMY", and "TEAM_NEUTRAL". "TEAM_FREE" means you have no allegiance.
- "enemyTeam". Tells the game what team the npc opposes. Valid values are "TEAM_PLAYER", "TEAM_ENEMY", and "TEAM_NEUTRAL".
- "health". Sets the health of the npc. Valid values are any positive integer, however the player may receive an error notice if the value is too large or "0".
- "saber". Tells the npc what hilt to use. Valid values are any lightsaber names.
- "saberColor". Optional modifier that tells the saber what color the blade should be. Valid colors are red, blue, green, yellow, orange, purple, and random. However, this information is usually defined in the .sab file.
- "saberStyle". Says what saber style to use. Valid values are 1 (Blue Style), 2 (Yellow Style), 3 (Red Style), 4 (Desann Style), 5 (Tavion Style), 6 (Duals), and 7 (Staff).
Force Powers
All of the following values set the npc's ability to use certain force powers. Valid values are 0-3, except for the powers noted below. Any positive integer greater than 3 (or whatever the highest level is) will be treated as level 3/highest level for that power.
name | note |
---|---|
FP_HEAL | |
FP_LEVITATION | |
FP_SPEED | |
FP_PUSH | |
FP_PULL | kyle_boss has pull 4, this effect likely cannot be duplicated however |
FP_TELEPATHY | |
FP_GRIP | |
FP_LIGHTNING | |
FP_RAGE | |
FP_PROTECT | |
FP_ABSORB | |
FP_DRAIN | |
FP_SEE | NPCs may not use this power, not entirely sure |
FP_SABERTHROW | |
FP_SABER_DEFENSE | |
FP_SABER_OFFENSE | This goes up to level 7 for the player, and 9 for NPCs, and increases their saber locking strength and their attack complexity, however, it is not recommended setting it past 3, but rather using custom .sab files or NPC stats to get these effects |
Attributes
The following modifiers affect the npc's attributes. The only valid values are integers between 0 and 5.
name | description |
---|---|
aggression | Determines how likely an npc is to attack. |
aim | Determines how good the npc's aim is. |
evasion | How likely the npc is to take cover or to try to evade your attacks. |
move | Determines the complexity of an npc's moves in combat. |
intelligence | Determines the intelligence of the npc. |
reactions | How quickly an npc will react. |
Size
Modifiers that determine the size and scale of the npc's model.
name | description |
---|---|
scaleX | Determines the scale of the model on the forward-back-axis. 100 is the default value. |
scaleY | Determines the vertical scale of the model. 100 is the default value. |
scaleZ | Determines the model's scale on the left-right-axis. 100 is the default value. |
scale | Overall scale of the model. Modifying this sets all of the above modifiers to the indicated value. 100 is default. |
Special Attributes
The following modifiers affect how the npc perceives the "world" of the game.
name | description |
---|---|
earshot | How far in map units the npc can hear, in map units. 1024 is the default value. |
hfov | The horizontal field of view, in angles. |
vfov | The vertical field of view, in angles. |
shootDistance | Overrides current the npc weapon's max range. This is not used by default. |
vigilance | How likely an npc will be able to notice something. Valid values are decimals between 0 and 1. Default is 0.1. |
visrange | How far away and npc can see something, in map units. Default is 1024. |
Class Modifier
The "class" modifier determines what AI (artifical intelligance) to use for the bot. Different classes affect an NPCs behavior as well as what abilities they have. For a full list of valid values, refer to dusty22's tutorial, found here.
Speed
These modifiers tell the game what speed to use for the npc's movement.
name | description |
---|---|
moveType | Tells the game what type of movement to use. Valid choices are "runjump", "static", "walk", and "flyswim". However, this is not changed by default and shouldn't be modified except if the npc's is a flier or a droid. |
yawSpeed | How quickly an npc can turn. 120 is used by most npcs. |
walkSpeed | How fast an npc can walk. 55 is used by most npcs. |
runSpeed | How fast an npc can run. 200 is used by most npcs. |
Sound
These modifiers tell the game what voice overs to use for the npc.
name | description |
---|---|
snd | Tells the game what directory in the sound/chars directory to locate the general sounds. |
sndcombat | Tells the game what directory in the sound/chars directory to locate for battle sounds, like grunts and taunts. |
sndjedi | Tells the game what directory in the sound/chars directory to locate the Jedi specific sound effects. |
Dismemberment
The following modifiers indicate the probability of a limb being hewed off by a lightsaber. Valid values are integers between 0 (don't dismember) and 100 (always dismembers).
- dismemberProbHead
- dismemberProbArms
- dismemberProbHands
- dismemberProbLegs
- dismemberProbWaist
Droid/Odd Modifiers
This is a miscellaneous category of modifiers. They either don't really fit in with any of the above category, or are rarely used, or used for droids and troopers.
name | description |
---|---|
sex | Determines the gender of the npc. Valid values are "male" and "female". It's used to choose the proper pronouns in texts. |
race | Determines the race of the npc. Valid values are unknown at this time. Pretty sure this has no use in JKA. Documentation is severely out dated on the subject. Some include "bot" and "human". |
rank | What rank to use for the npc. Lowest rank is civilian, highest is captain. This affects how smart and skillful an NPC is in general. |
acceleration | Personally, this seems like a droid modifier. Documentaion states: "accel x 20fps = speed up per second, so accel of 15 means they can go from 0 to 300 in one second". |
headModel | Uses model directory for values. This is usually not used, but when it is, it can be found in droid npcs. When used, like in remote.npc, the value is "none". |
torsoModel | Uses model directory for values. This is usually not used, but when it is, it can be found in droid npcs. When used, like in remote.npc, the value is "none". |
legsModel | Uses model directory for values. This is usually not used, but when it is, it can be found in droid npcs. When used, like in remote.npc, the value is "remote". However, a similar entry for "playermodel" can be found. |
headYawRangeLeft | How far left you can turn your head (angles). |
headYawRangeRight | How far right you can turn your head (angles). |
headPitchRangeUp | How far up you can tilt your head (angles). |
headPitchRangeDown | How far down you can tilt your head (angles). |
torsoYawRangeLeft | How far left you can turn your torso (angles). |
torsoYawRangeRight | How far right you can turn your torso (angles). |
torsoPitchRangeUp | How far up you can tilt your torso (angles). |
torsoPitchRangeDown | How far down you can tilt your torso (angles). |
Example NPC
Not all of the above modifiers need to be present in an npc file. Here is an example .npc file that contains information about the "kyle" npc:
Kyle { playerModel kyle rank commander health 1000 weapon WP_BRYAR_PISTOL weapon WP_SABER saber kyle saberStyle 1 saberStyle 3 saberStyle 2 FP_HEAL 3 FP_LEVITATION 3 FP_SPEED 3 FP_PUSH 3 FP_PULL 3 FP_TELEPATHY 3 FP_GRIP 3 FP_LIGHTNING 2 FP_SABERTHROW 3 FP_RAGE 0 FP_PROTECT 3 FP_ABSORB 3 FP_DRAIN 0 FP_SEE 3 FP_SABER_DEFENSE 3 FP_SABER_OFFENSE 3 forcePowerMax 200 reactions 4 aim 5 move 3 aggression 5 evasion 5 intelligence 5 playerTeam TEAM_PLAYER class CLASS_KYLE snd kyle sndcombat kyle sndjedi kyle dismemberProbHead 0 dismemberProbArms 0 dismemberProbHands 0 dismemberProbLegs 0 dismemberProbWaist 0 }
Trivia
There are many odd npcs that can be found in the game. Examples include the following:
npc name | description |
---|---|
Yoda | While this npc does not exist, any npc with the name Yoda is immune to force powers. |
Emperor | While this npc does not exist, any npc with the name Emperor only uses force powers. |
Cultist_commando | This npc uses dual pistols which fire very fast. It is the only npc that does so, and will by default. Other NPCs given the attributes of Captain rank, class_reborn, and the blaster pistol weapon can also wield dual pistols. |
Cultist_destroyer | This npc has a unique force power, called "force destruction". Basically, it's like force rage, but with a powerful suicide attack that deals massive damage on surrounding players and npcs. The effects are referenced, but not there. |
These npcs have been hard coded into the game. Many other npcs can be found in the game with broken classes or missing assets.
External Links
- [1] - Eezstreet revealed most of the information regarding Yoda and the Emperor npcs in this topic
- [2] - Eezstreet explains
cultist_destroyer
- [3] - A helpful tool by Kal El. This allows you to easily make .npc files.