Aller au contenu

Photo

Load and Equip item


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

#1
alschemid

alschemid
  • Members
  • 475 messages
Hi,

I would like to load an item in the inventory, make the follower equip it and talk to PC... I have tried the code below but it didn't work, the item appears in inventary, the follower unequip his weapon and talk to PC, but don't equip the new item. Any idea what I did wrong? Thanks

object oWeaponLog =  GetItemInEquipSlot(INVENTORY_SLOT_MAIN, oFollower);

UnequipItem(oFollower, oWeaponLog);
UT_AddItemToInventory(R"gen_im_wep_lsw_mar.uti",1);
object [] oSword = GetItemsInInventory(oPC, GET_ITEMS_OPTION_BACKPACK, 0, "gen_im_wep_lsw_mar");
object oSwordEquip = oSword[0];
EquipItem(oFollower, oSwordEquip, INVENTORY_SLOT_MAIN, 0);
UT_Talk(oFollower, oPC);



#2
Proleric

Proleric
  • Members
  • 2 346 messages
Try this:

object oWeaponLog = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, oFollower);

UnequipItem(oFollower, oWeaponLog);
object oSwordEquip = UT_AddItemToInventory(R"gen_im_wep_lsw_mar.uti",1);
EquipItem(oFollower, oSwordEquip, INVENTORY_SLOT_MAIN, 0);
UT_Talk(oFollower, oPC);



#3
alschemid

alschemid
  • Members
  • 475 messages
Much easier and works. Thanks!