How to count all resrefs in a numbered list
Valeriya
Member Posts: 57
So say I have a list of random treasure using resrefs with:
Poor_Item001
Poor_Item002
Up until Poor_Item250
And I keep adding to that list day by day. The problem is that I also a script of random treasure from 001 to the last of the poor item I create, which means I need to be constantly updating the number in the random treasure script that gives you a random item between 1 to the last number; is there a way to count all the resrefs with "Poor_Item" so I won't have to change that last number manually every time?
I hope my problem is understood
-Val
Poor_Item001
Poor_Item002
Up until Poor_Item250
And I keep adding to that list day by day. The problem is that I also a script of random treasure from 001 to the last of the poor item I create, which means I need to be constantly updating the number in the random treasure script that gives you a random item between 1 to the last number; is there a way to count all the resrefs with "Poor_Item" so I won't have to change that last number manually every time?
I hope my problem is understood
-Val
0
Comments
If you really needed to compute it, you could CreateItemInObject in an inaccessible container, looping from 001 onwards until it returns OBJECT_INVALID.
To go a step further, Trigger Based Spawn System (TBSP) uses this approach quite nicely.