El Gobbo
El Gobbo
Problems updating to v12
I honestly have no idea why that wasn't picked up in v11.315
5 replies
Problems updating to v12
Thanks for the tip about defineSchema - the errors were only showing me locations in the foundry API, so I didn't know where the error was in my code. After checking through my schema I found that one didn't have a return value - I added that and now everything works!
5 replies
Array keeps resetting
Okay, I located the issue - it seems to be with the fact that the way I had implemented it was meant to allow players to directly edit specific indexes within the array via their character sheet. In fact, everything I tried involved changing only single indexes. This is incompatible with the .update() function, as explained by the quote below
Working with Arrays: Because the updates work using object key merges, whereas arrays purely work via index, Foundry cannot modify specific indexes inside an array via update, arrays need to be written as a cohesive whole. To update an array in a document's data, you need to edit a copy of the array and then write the new array as a whole with an update.
Thanks for pointing me in the right direction! I'll have to come up with some other implementation..
4 replies