View Single Post
Old 12-07-2012, 04:59 PM   #266
Fair Strides
@Fair Strides 2
Witty Programmer
Fair Strides 2's Avatar
Status: Moderator
Join Date: Jan 2012
Location: Oregon, United States
Posts: 756
Current Game: Master of Orion 2
Originally Posted by Fallen Guardian View Post
You'll just have to wait and see.

And now I have a new problem. Okay, so I've been trying to unequip Carth and Bastila's armor and put clothing on them, however when I try to run this it crashes to desktop. Any idea what's going on?

void main()

object oPM1 = GetObjectByTag("Carth");
object oPM2 = GetObjectByTag("Bastila");

object oPC = GetFirstPC();
object oArmor = GetItemInSlot(INVENTORY_SLOT_BODY, oPM1);
object oArmorB = GetItemInSlot(INVENTORY_SLOT_BODY, oPM2);
object oArm = CreateItemOnObject("g_a_clothes01", oPM1);
object oArmB = CreateItemOnObject("g_a_clothes01", oPM2);

AssignCommand(oPM1, ClearAllActions());
    AssignCommand (oPM1, ActionUnequipItem(oArmor, INVENTORY_SLOT_BODY));
    AssignCommand (oPM1, ActionEquipItem(oArm, INVENTORY_SLOT_BODY));
    AssignCommand(oPM2, ClearAllActions());
    AssignCommand (oPM2, ActionUnequipItem(oArmorB, INVENTORY_SLOT_BODY));
    AssignCommand (oPM2, ActionEquipItem(oArmB, INVENTORY_SLOT_BODY));

I'm fairly certain that the Equip/Unequip Item functions require the first parameter, in this case oArmor, to be a person. I myself have yet to get an Equip or Unequip function to actually work. For me, they've just done nothing.

Also, I recall the NWN Lexicon saying that you don't need to use the Unequip function at all if you use the Equip. You might try the script without that, though you might run into my problem with nothing happening in-game.
Fair Strides 2 is offline   you may: quote & reply,