I have created a system to randomly pick an event from an array and not repeat it. It moves the picked data to the end of the array where the index counter reduces by 1 so that the pool of random choices lessens and thus the events will not reappear again. This method works for the most part. I have tested it with just plain text in the array.
However i want to have my event text in a variable and output that when chosen (see example further below code example).
Using text variables inside an array and output them works fine, however in my system im using a temporary Array placeholder (CurrentList) for 2 different variations of my system (one outputs 3 choices being non-events eg. choosing a reward out of a list and the other will pick a single event). Even if i wasn't using a placeholder i still want to be able to move the text variable to the back of the array.
But i do not know how to write the text variable (inside the array) to the temporary array (CurrentList), letters or numbers is easy. Here is an example (This is a task that is looped and using a counter for the index will move across data in the array to the CurrentList array.)
Code: Select all
Set variable CurrentList[%DataCrossOverCounter% to %Test2MasterList[%DataCrossOverCounter%]%
Which in that text variable is like;
This happened (event 1)
1) Do nothing
2) Do something
3) Do this
Then using the array that has text variables inside, this causes a bad expression error. I suspect the issue is the % is not being written/carried over, so is there a way i can do this? a work around?
I'm hoping there is a way to append the % % but if not, i guess the way to do it requires a little more work, having instead a code number like E1 that is picked and run through a series of tasks to match E1 and then output the text. I have used a system using objects and groups. But wanted to see if i can make something more easier with just arrays.
I hope this makes sense.