.npc: Difference between revisions

From Jedi Knight Wiki | JKHub
(adding a list of classes)
mNo edit summary
 
Line 22: Line 22:
== NPC classes ==
== NPC classes ==
==== Special classes ====
==== Special classes ====
* CLASS_PLAYER
* <code>CLASS_PLAYER</code>
* CLASS_VEHICLE
* <code>CLASS_VEHICLE</code>


==== New Republic / Kyle's allies ====
==== New Republic / Kyle's allies ====
* CLASS_BESPIN_COP
* <code>CLASS_BESPIN_COP</code>
* CLASS_REBEL
* <code>CLASS_REBEL</code>
* CLASS_JAN
* <code>CLASS_JAN</code>
* CLASS_LANDO
* <code>CLASS_LANDO</code>
* CLASS_MONMOTHMA
* <code>CLASS_MONMOTHMA</code>
* CLASS_MORGAN
* <code>CLASS_MORGAN</code>
* CLASS_PRISONER
* <code>CLASS_PRISONER</code>


==== Imperials ====
==== Imperials ====
* CLASS_IMPERIAL
* <code>CLASS_IMPERIAL</code>
* CLASS_IMPWORKER
* <code>CLASS_IMPWORKER</code>
* CLASS_STORMTROOPER
* <code>CLASS_STORMTROOPER</code>
* CLASS_SWAMPTROOPER
* <code>CLASS_SWAMPTROOPER</code>
* CLASS_HAZARD_TROOPER
* <code>CLASS_HAZARD_TROOPER</code>
* CLASS_ROCKETTROOPER
* <code>CLASS_ROCKETTROOPER</code>
* CLASS_SABOTEUR
* <code>CLASS_SABOTEUR</code>


==== Aliens ====
==== Aliens ====
Hostile
Hostile
* CLASS_GRAN
* <code>CLASS_GRAN</code>
* CLASS_RODIAN
* <code>CLASS_RODIAN</code>
* CLASS_TRANDOSHAN
* <code>CLASS_TRANDOSHAN</code>
* CLASS_WEEQUAY
* <code>CLASS_WEEQUAY</code>
* CLASS_NOGHRI
* <code>CLASS_NOGHRI</code>
* CLASS_TUSKEN
* <code>CLASS_TUSKEN</code>


Non-hostile
Non-hostile
* CLASS_BARTENDER
* <code>CLASS_BARTENDER</code>
* CLASS_JAWA
* <code>CLASS_JAWA</code>
* CLASS_UGNAUGHT
* <code>CLASS_UGNAUGHT</code>


==== Jedi ====
==== Jedi ====
* CLASS_JEDI
* <code>CLASS_JEDI</code>
* CLASS_KYLE
* <code>CLASS_KYLE</code>
* CLASS_LUKE
* <code>CLASS_LUKE</code>


* CLASS_REBORN
* <code>CLASS_REBORN</code>
* CLASS_SHADOWTROOPER
* <code>CLASS_SHADOWTROOPER</code>


==== Droids and mechs ====
==== Droids and mechs ====
Friendly
Friendly
* CLASS_SEEKER
* <code>CLASS_SEEKER</code>


Hostile
Hostile
* CLASS_REMOTE
* <code>CLASS_REMOTE</code>
* CLASS_INTERROGATOR
* <code>CLASS_INTERROGATOR</code>
* CLASS_PROBE
* <code>CLASS_PROBE</code>
* CLASS_SENTRY
* <code>CLASS_SENTRY</code>


* CLASS_ASSASSIN_DROID
* <code>CLASS_ASSASSIN_DROID</code>
* CLASS_SABER_DROID
* <code>CLASS_SABER_DROID</code>
* CLASS_MARK1
* <code>CLASS_MARK1</code>
* CLASS_MARK2
* <code>CLASS_MARK2</code>
* CLASS_ATST
* <code>CLASS_ATST</code>


Non-hostile
Non-hostile
* CLASS_MOUSE
* <code>CLASS_MOUSE</code>
* CLASS_GONK
* <code>CLASS_GONK</code>
* CLASS_PROTOCOL
* <code>CLASS_PROTOCOL</code>
* CLASS_R2D2
* <code>CLASS_R2D2</code>
* CLASS_R5D2
* <code>CLASS_R5D2</code>


==== Beasts ====
==== Beasts ====
* CLASS_MINEMONSTER
* <code>CLASS_MINEMONSTER</code>
* CLASS_HOWLER
* <code>CLASS_HOWLER</code>
* CLASS_RANCOR
* <code>CLASS_RANCOR</code>
* CLASS_SAND_CREATURE
* <code>CLASS_SAND_CREATURE</code>
* CLASS_WAMPA
* <code>CLASS_WAMPA</code>
* CLASS_GLIDER (not fully implemented?)
* <code>CLASS_GLIDER</code> (not fully implemented?)


==== Bosses ====
==== Bosses ====
* CLASS_BOBAFETT
* <code>CLASS_BOBAFETT</code>
* CLASS_GALAK_MECH
* <code>CLASS_GALAK_MECH</code>
* CLASS_REELO
* <code>CLASS_REELO</code>


* CLASS_ALORA
* <code>CLASS_ALORA</code>
* CLASS_DESANN
* <code>CLASS_DESANN</code>
* CLASS_TAVION
* <code>CLASS_TAVION</code>


== Modifiers ==
== Modifiers ==


===Basic 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.
* <code>playermodel</code> - 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.
* <code>weapon</code> - 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.
* <code>playerTeam</code> - 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".
* <code>enemyTeam</code> - 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".
* <code>health</code> - 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 [[.SAB File|lightsaber names]].
* <code>saber</code> - Tells the npc what [[hilt]] to use. Valid values are any [[.SAB File|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|.sab file]].
* <code>saberColor</code> - 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|.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]]).
* <code>saberStyle</code> - Says what [[Category:Styles|saber style]] to use. Valid values are 1 ([[Fast Style]]), 2 ([[Medium Style]]), 3 ([[Strong Style]]), 4 ([[Desann Style]]), 5 ([[Tavion Style]]), 6 ([[Duals]]), and 7 ([[Staff]]).


===Force Powers===
===Force Powers===
Line 146: Line 146:
| FP_DRAIN        ||
| FP_DRAIN        ||
|-
|-
| FP_SEE   || NPCs may not use this power, not entirely sure
| FP_SEE       || NPCs may not use this power, not entirely sure
|-
|-
| FP_SABERTHROW   ||
| FP_SABERTHROW   ||

Latest revision as of 16:04, 3 February 2023

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 to use. Valid values are 1 (Fast Style), 2 (Medium Style), 3 (Strong 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.