Jump to content

Spawn NPC with specific weapon


Recommended Posts

I've been searching around for a way to do this through the console but haven't found anything about how to do it. Is it possible to spawn an npc and specify which lightsaber/weapon they will use? I'd like to spawn some npc's with different lightsaber hilts and weapns like the darksaber and different swords. Is this possible to do through the console or would i have to edit the models pk3 file?

Link to comment

As far as I know, you have to edit this in the NPC file (which is a text file) in the PK3. You can create a number of custom NPCs you use, place them in an NPC file under "ext_data/npcs/", and package it as a PK3 to place in your "base" folder. It doesn't matter if those models/skins already have an NPC file -- you can create additional NPCs for them as needed.

 

Here's an example of an NPC:

 

ahsoka
{
	playerModel	ahsoka
	saber		tano
	saber2		tano2
	saberColor	green
	saber2Color	yellow
	weapon	WP_SABER
	saberStyle	0
	FP_HEAL			2
	FP_LEVITATION		3
	FP_SPEED		2
	FP_PUSH			3
	FP_PULL			2
	FP_TELEPATHY		2
	FP_GRIP			1
	FP_LIGHTNING		0
	FP_RAGE			0
	FP_PROTECT		2
	FP_ABSORB		2
	FP_DRAIN		0
	FP_SEE			3
	FP_SABERTHROW		0
	FP_SABER_DEFENSE 	3
	FP_SABER_OFFENSE 	3
	forcePowerMax		120
	forceRegenRate		100
	forceRegenAmount	1
	rank		commander
	reactions	5
	aim		4
	move		5
	aggression	5
	evasion		3
	intelligence	5
	move		5
	vigilance	0.9
	visrange	2048
	earshot		1024
	hfov		160
	vfov		160
	scale		94
	playerTeam	TEAM_PLAYER
	enemyTeam	TEAM_ENEMY
	class		CLASS_JEDI
	sex		female
	yawSpeed	140
	walkSpeed	55
	runSpeed	250
	acceleration	15
	snd		ahsoka
	sndcombat	ahsoka
	sndjedi		ahsoka
	health		250
	dismemberProbHead	5
	dismemberProbArms	30
	dismemberProbLegs	30
	dismemberProbHands	30
	dismemberProbWaist	15
	moveType	walk
}
"Weapon" holds the value you're looking for. Depending on what weapon you give the NPC, their behaviour will change also.
Link to comment

Cerez is correct, it's a simple thing to do just copy the original text and paste it directly below, changing anything you want along the way. Keep in mind that npcs WON'T change weapons if you plan to give the new npc more then one.

 

Where it says weapon you can input:

WP_BLASTER

WP_BLASTER_PISTOL

WP_SABER

WP_BRYAR_PISTOL

WP_THERMAL

WP_NOGHRI_STICK

WP_TUSKEN_RIFLE

WP_MELEE

WP_DISRUPTOR

WP_REPEATER

WP_BOWCASTER

WP_DEMP2

WP_ROCKET_LAUNCHER

WP_CONCUSSION

WP_TUSKEN_STAFF

WP_SCEPTER (If you're altering a force user but you may have to change the 'CLASS' to 'CLASS_REBORN' for it to work like tavion uses it.)

 

Cerez likes this

MB2 Beta Tester / MB2 FA Assistant Dev

Link to comment

Thank you both very much, I will try this out soon. Is it also possible to disable an NPC fron using force powers by changing the force options the their NPC file? There's some players id like to not use the force bacause they didn't in the movies or they arnt from Star Wars like Ganondorf.

Link to comment

Thank you both very much, I will try this out soon. Is it also possible to disable an NPC fron using force powers by changing the force options the their NPC file? There's some players id like to not use the force bacause they didn't in the movies or they arnt from Star Wars like Ganondorf.

 

Just set their force abilities to 0 like so, I'll edit cerez post below to demonstrate:

 

Any number for the powers between 0 and 3 will represent what level they will use the ability at with 0 being disabled, 1 being the weakest form and 3 the most powerful, they use them in the same way we would as the PC.

As for saberstyle it works like this:

 

1 = Fast Style

2 = Medium

3 = Strong

4 = Desann

5 = Tavion

6 = Dual

7 = Staff

 

You can group them up so you can have

 

saberStyle 2

saberStyle 5

saberStyle 4

 

That npc will use Medium, Tavion and Desann against you.

 

ahsoka

{

    playerModel    ahsoka

    saber        tano

    saber2        tano2

    saberColor    green

    saber2Color    yellow

    weapon    WP_SABER

    saberStyle    0

    FP_HEAL            0

    FP_LEVITATION        0

    FP_SPEED        0

    FP_PUSH            0

    FP_PULL            0

    FP_TELEPATHY        0

    FP_GRIP            0

    FP_LIGHTNING        0

    FP_RAGE            0

    FP_PROTECT        0

    FP_ABSORB        0

    FP_DRAIN        0

    FP_SEE            0

    FP_SABERTHROW        0

    FP_SABER_DEFENSE     3

    FP_SABER_OFFENSE     3

    forcePowerMax        120

    forceRegenRate        100

    forceRegenAmount    1

    rank        commander

    reactions    5

    aim        4

    move        5

    aggression    5

    evasion        3

    intelligence    5

    move        5

    vigilance    0.9

    visrange    2048

    earshot        1024

    hfov        160

    vfov        160

    scale        94

    playerTeam    TEAM_PLAYER

    enemyTeam    TEAM_ENEMY

    class        CLASS_JEDI

    sex        female

    yawSpeed    140

    walkSpeed    55

    runSpeed    250

    acceleration    15

    snd        ahsoka

    sndcombat    ahsoka

    sndjedi        ahsoka

    health        250

    dismemberProbHead    5

    dismemberProbArms    30

    dismemberProbLegs    30

    dismemberProbHands    30

    dismemberProbWaist    15

    moveType    walk

}

Cerez likes this

MB2 Beta Tester / MB2 FA Assistant Dev

Link to comment

I'm having trouble saving the NPC file inside the pk3. It says its saved when I edit it but then when I hope it back up its back the original values. I'm doing it on a tablet using an app called RAR to open the pk3 and just a plain text editor for the NPC file.

I play the game on my tablet using Beloko's JK3 touch port,that's why it's all being done on the table.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...