.npc: Difference between revisions

From Jedi Knight Wiki | JKHub
No edit summary
Line 58: Line 58:
* "aggression". Determines how likely an npc is to attack.
* "aggression". Determines how likely an npc is to attack.
* "aim". Determines how good the npc's aim is.
* "aim". Determines how good the npc's aim is.
* "evasion". How likely the npc is to take cover or be defensive.
* "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.
* "move". Determines the complexity of an npc's moves in combat.
* "intelligence". Determines the intelligence of the npc.
* "intelligence". Determines the intelligence of the npc.

Revision as of 09:13, 25 February 2013

A .NPC File dictates the make up of 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

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.
  • "playerTeam". Defines the npc's allegiance. Valid values are "TEAM_PLAYER", "TEAM_ENEMY", and "TEAM_NEUTRAL".
  • "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), and 5 (Tavion Style).

Force Powers

All of the following values set the npc's ability to use certain force powers. Valid values are 0-4, however any positive integer greater than 4 will be treated as a 4.

  • FP_HEAL
  • FP_LEVITATION
  • FP_SPEED
  • FP_PUSH
  • FP_PULL
  • FP_TELEPATHY
  • FP_GRIP
  • FP_LIGHTNING
  • FP_RAGE
  • FP_PROTECT
  • FP_ABSORB
  • FP_DRAIN
  • FP_SEE
  • FP_SABERTHROW
  • FP_SABER_DEFENSE
  • FP_SABER_OFFENSE

Attributes

The following modifiers affect the npc's attributes. The only valid values are integers between 0 and 5.

  • "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.

  • "scaleX". Determines the horizontal scale of the model. 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 "Z" 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.

  • "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.
  • "visrange". How far away and npc can see something, in map units. Default is 2048.

Class Modifier

The "class" modifier determines what AI (artifical intelligance) to use for the bot. 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.

  • "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.

  • "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". * "snd". 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.

  • "sex". Determines the gender of the npc. Valid values are "male" and "female".
  • "race". Determines the race of the npc. Valid values are unknown at this time. Documentation is severely out dated on the subject. Some include "bot" and "human".
  • "rank". What rank to use for the npc. Again, valid values are unknown.
  • "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".
  • "tosoModel". 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
}

The modifier "saber" has been placed in a bounding box automatically by the wiki. It is unknown why this occurs...

Trivia

Trivia

There are many odd npcs that can be found in the game. Examples include the following:

  • "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_commander". This npc uses duel pistols. It is the only npc that does so, and will.
  • "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 referrenced, but not there.

These npcs have been believed to be 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