Aller au contenu

Photo

How do you force an item to equip/unequip?


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Obsidian_Warlock

Obsidian_Warlock
  • Members
  • 2 messages
I'm looking to create a scene where the character automatically unequips his weapon and all armor, and equips a set of noble clothes upon entering the area. I have no problem spawning the clothes into inventory, but all my messing around with EquipItem and UnequipItem has done nothing so far. What should the script look like to equip an item (like clothes) to the chest slot, and remove it?
 
Thanks in advance!

#2
Halchek

Halchek
  • Members
  • 36 messages
The following should create chest armour equip it, unequip it, create noble robes then equip those leaving the chest armour in the inventory.



object oChestArmour = UT_AddItemToInventory(R"gen_im_arm_cht_lgt_rlr.uti");

EquipItem(oHero, oChestArmour);

UnequipItem(oHero, oChestArmour);



oChestArmour = UT_AddItemToInventory(R"gen_im_cth_nob_b00.uti");

EquipItem(oHero, oChestArmour);



HTH



Regards



Paul

#3
Obsidian_Warlock

Obsidian_Warlock
  • Members
  • 2 messages
Perfect - I *was* doing it wrong. Fixed, compiled and tested. Finally, the character enters the king's court dressed like a nobleman, not in banged up iron armor.



Thanks Paul!

#4
blavena

blavena
  • Members
  • 4 messages
does this unequip armors that "cannot be unequiped"?? I've got some armors stuck on my PCs that cannot be unequiped and I dont know what else can I try...

#5
Craig Graff

Craig Graff
  • Members
  • 608 messages
UnequipItem works regardless of whether or not an item is marked as unequippable.