PDA

View Full Version : Remove all Items


brwarner
09-05-2005, 06:21 PM
Does anyone know how to remove all the items from your party and store them in a footlocker or something like when you first arrive on Telos in Kotor2 and the tsf take all your stuff and put it in lockers.

JediKnight707
09-05-2005, 06:24 PM
Its probably not possible, because the TSF stop you as you arrive, so theres no time to do anything.

brwarner
09-05-2005, 06:32 PM
Its probably not possible, because the TSF stop you as you arrive, so theres no time to do anything.

No I meant can I build a script to do something like that. I want to make a sidequest were all your items are stolen.

JediKnight707
09-05-2005, 06:53 PM
Oh, well I guess its possible, but you shouldn't ask me I'm a n00b. :D (good luck though)

stoffe
09-05-2005, 06:59 PM
No I meant can I build a script to do something like that. I want to make a sidequest were all your items are stolen.

It is possible and not too difficult. I believe a script like this one should do the trick, theoretically:


// ST: Strip all items from the player party's possession
// and put them in a container.
void main() {
object oContainer = GetObjectByTag("FootlockerTag");
object oPC = GetFirstPC();

object oItem = GetFirstItemInInventory(oPC);

while (GetIsObjectValid(oItem)) {
if (GetPlotFlag(oItem)) {
oItem = GetNextItemInInventory(oPC);
}
else {
GiveItem(oItem, oContainer);
oItem = GetFirstItemInInventory(oPC);
}
}

int i;
for (i = NUM_INVENTORY_SLOTS-1; i >= INVENTORY_SLOT_HEAD; i--) {
if (GetIsObjectValid(GetPartyMemberByIndex(0)))
GiveItem(GetItemInSlot(i, GetPartyMemberByIndex(0)), oContainer);

if (GetIsObjectValid(GetPartyMemberByIndex(1)))
GiveItem(GetItemInSlot(i, GetPartyMemberByIndex(1)), oContainer);

if (GetIsObjectValid(GetPartyMemberByIndex(2)))
GiveItem(GetItemInSlot(i, GetPartyMemberByIndex(2)), oContainer);
}
}


If you want to use it, don't forget to put the tag of the footlocker you wish to contain the items where it says FootlockerTag.

The only problem with this is that it will only strip the members of your group that are in the active (3 person) party, since you can't access the inventory of the non-active party members without spawning them first.

If this happens in an area where you can't switch your party around that shouldn't be a problem. But If you really must strip them all, I think I can add a workaround for that to the script.

(Obsidian didn't have that problem on Citadel Station since you only have the Exile, Kreia and Atton at your disposal there, and they were all in the active party when you were arrested.)