UT_AddItemToInventory(R"gen_im_arm_cht_lgt_ltr.uti", 1, GetObjectByTag("acolyte_dar"));
UT_AddItemToInventory(R"gen_im_arm_cht_lgt_ltr.uti", 1, GetObjectByTag("acolyte_dar"));
EquipItem(GetObjectByTag("acolyte_dar"), GetObjectByTag("gen_im_wep_mel_lsw_lsw"), 0 );
EquipItem(GetObjectByTag("acolyte_dar"), GetObjectByTag("gen_im_arm_cht_lgt_ltr"), 4);
this code makes acolyte_dar go naked. if i have GetHero() instead of GetObjectByTag("acolyte_dar") it equips my hero.
trying to equip a creature via a trigger
Débuté par
gordonbrown82
, août 27 2010 01:32
#1
Posté 27 août 2010 - 01:32
#2
Posté 27 août 2010 - 07:00
You can make the code more robust by explicitly referring to the item you just created:
I've also used the INVENTORY_SLOT constants, to make the code easier to read.
object oNPC = GetObjectByTag("acolyte_dar");
object oWeapon = UT_AddItemToInventory(R"gen_im_wep_mel_lsw_lsw.uti", 1, oNPC);
object oArmour = UT_AddItemToInventory(R"gen_im_arm_cht_lgt_ltr.uti", 1, oNPC);
EquipItem(oNPC, oArmour, INVENTORY_SLOT_CHEST );
EquipItem(oNPC, oWeapon, INVENTORY_SLOT_MAIN );
Your original code was creating two sets of armour - I've changed that.I've also used the INVENTORY_SLOT constants, to make the code easier to read.
Modifié par Proleric1, 27 août 2010 - 08:14 .
#3
Posté 27 août 2010 - 03:06
i don't understand why that code works while mine doesn't (the double set of armors is a typo and the code in the toolset creates a sword).
#4
Posté 27 août 2010 - 03:12
maybe it's the lack of explicit referral like you said.





Retour en haut






