Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsJedi Outcast and Jedi Academy Editing Forum → How can you change NPC weapons?
How can you change NPC weapons?
2002-07-25, 9:15 PM #1
I've tried for hours with scripts but nothing seems to work. I'm trying to get a stormtrooper to use a disruptor rifle. I gave him sniper as a script_targetname. Here's an example of one of the many scripts I've tried.

affect ( "sniper", /*@AFFECT_TYPE*/ INSERT )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_DISRUPTOR" );
}
2002-07-25, 10:00 PM #2
NPCs use "NPC_targetname", not "script_targetname". Only non-NPCs used "script_targetname" such as func entities and such.

...BTW, you don't have to use NPC_targetnames for NPCs if you just use spawnscripts instead. Just make a small script with just the command that sets the weapon and then assign the script to your NPC in Radient by adding the key "spawnscript" and the name of your script you're using in the value part. So basically, you want to do this:

- Make this your script:
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_DISRUPTOR" );

- Add this key to the NPC:

key: spawnscript
value: *name of script*

-- SavageX

------------------
"How can we teach these kids to read... if they can't even fit inside the building!" -- Derek Zoolander
"Be kind to nerds because one day... one will be your boss."
SavageX's Editing Corner
2002-07-26, 7:40 AM #3
Thanks.
2002-07-26, 7:54 AM #4
If you want him to change weapons right as he's spawned, just attach a spawning script to him. It's under the entity properties, it tells you how. Then just use like Set (SET_WEAPON, WP_DISRUPTOR); or something. It'll automatically give the NPC it was assigned to a disruptor upon spawn. Be careful, since it will also change the AI to match the default user of the weapon, in this case, a Rodian.
Bassoon, n. A brazen instrument into which a fool blows out his brains.

↑ Up to the top!