I am developing a game in which a large number of pieces need to be moved each turn, in a very predictable way. I am trying to automate this and am trying figure out how. This is what I have so far:
I use a move counter. I have a large number of regions on the board with a name like spot1 spot2 spot3, etc…
The pieces that need to move have a “move to location” trait that combines “spot” with the current move counter. I.e. spot3
I guess this uses basic concatenation and I only stumbled across it by trial and error.
This works, but I have a few more requirements and it doesn’t work on pieces that the players use. Is there a way to take a piece’s current location, like spot3, and separate the “spot” and the 3, increment the 3 to 4, and put it back together? So, if a piece is on spot3, it will be moved to spot4. I need this to work on a couple different tracks so it will be like tracka1, tracka2 and trackb1 and trackb2, etc…
Thanks,
Ben