Hello.
I would like to transfer all the items from one character to another character which is going to be the player.ç
I was trying to create a for to transfer them from one to another, but I don't know which property gets the number of that array
for(i = 1, i < CharacterA.InventoryQuantity[].length(), i++) {
CharacterB.InventoryQuantity[i] = CharacterA.InventoryQuantity[i];
}
Thank you.
It's Game.InventoryItemCount in that case.
In general, AGS script does not support getting length from arrays themselves, so there must be separate property or constant for built-in arrays, and length stored in a separate variable for user arrays.
Thank you. If someone needs something similar this is how it worked for me.
int i;
for(i = 1; i < Game.InventoryItemCount; i++) {
CharacterB.InventoryQuantity[i] = CharacterA.InventoryQuantity[i];
}
UpdateInventory();