Aller au contenu

Photo

why is this not working?


5 réponses à 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
TimelordDC

TimelordDC
  • Members
  • 923 messages
I don't even know how this is working for the PC since items are suffixed with .uti. .utp is for placeables.

#3
Proleric

Proleric
  • Members
  • 2 352 messages
Indeed, .uti should work.

You'll probably find that an equipped instance of the sword is not regarded as inventory. That's certainly true of other inventory functions. If that's the case, you'll need to unequip it first (bearing in mind that there are two weapon sets).

#4
gordonbrown82

gordonbrown82
  • Members
  • 544 messages

TimelordDC wrote...

I don't even know how this is working for the PC since items are suffixed with .uti. .utp is for placeables.


Image IPB

#5
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.

#6
gordonbrown82

gordonbrown82
  • Members
  • 544 messages
hmm i thought i had gone temporarily insane. or more insane than usual.