Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Equipping NPCs

Page: 1 of 1
 TimBob12
10-02-2010, 2:10 PM
#1
Hi there,
I am trying to equip an NPC with a custom datapad. He dies immediately so I want it to appear in remains. However I have attempted to script this. The NPC appears, he dies after a short and sweet conversation, but no datapad appears. I am using the on enter script to make this happen.


void main()
{
// ST: Check if it's the player entering the trigger, and that it hasn't

already fired
if (!GetLocalBoolean(OBJECT_SELF, 40) && (GetEnteringObject() ==

GetFirstPC())) {

// ST: Make sure the trigger only fires once.
SetLocalBoolean(OBJECT_SELF, 40, TRUE);


object oNPC1 = CreateObject(OBJECT_TYPE_CREATURE, "c_officer_corpse",

Location(Vector(25.38,66.07,14.61), 0.0));

CreateItemOnObject("czerka_o_datapad",oNPC1);

}


ExecuteScript("k_ptat20aa_enter_old", OBJECT_SELF);

}


Please help. I am stumped. I am pretty sure I have used this script before and it worked.

Thanks in advance.

TimBob12
 Rtas Vadum
10-02-2010, 2:29 PM
#2
You could just add that to the NPC's inventory(within the character's UTI file), and it should appear in the remains.
 TimBob12
10-02-2010, 2:35 PM
#3
I couldn't work our how to add custom items to the inventory. I could only work out how to add items already in the game.
 Rtas Vadum
10-02-2010, 3:05 PM
#4
I couldn't work our how to add custom items to the inventory. I could only work out how to add items already in the game.

Just add any of the in-game items, then change the ResRef column to match the name of the datapad's uti file.
 LDR
10-02-2010, 9:12 PM
#5
Go into K-GFF Editor (if you have it), and open the utc file with it. Then, go under inventory, and add the item into it.
 TimBob12
10-04-2010, 11:39 AM
#6
Neither of these methods make it dropable. I have used exactly the same script in another part of my mod and it works fine. AHHHHHHHHHH this is so frustrating!!!
Page: 1 of 1