Aller au contenu

Photo

why is this not working?


1 réponse à ce sujet

#1
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
int iCountItems = UT_CountItemInInventory(R"longsword_norequirements.utp");
    UT_RemoveItemFromInventory(R"longsword_norequirements.utp", iCountItems);
    WR_SetPlotFlag(PLT_SWORDS_AND_ARMOR, ONE_SWORD, FALSE);
    WR_SetPlotFlag(PLT_SWORDS_AND_ARMOR, MORE_SWORDS, FALSE);
    UT_AddItemToInventory(R"longsword_norequirements.utp", iCountItems, GetObjectByTag("sword_armor_chest_prelude"));

or to be more specific: the removal of items from the player inventory works but adding the same amount of items to sword_armor_chest_prelude does not work. I have it on the map.

#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
The reason it removes but doesn't add is that the remove function converts the resource name into a tag by cutting off the suffix at the end. In this case, that's hiding the bug. The add function needs the resource and not the tag, so it can't chop off the suffix.