playMaker

Author Topic: Select the Array based on a string?  (Read 1281 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Select the Array based on a string?
« on: January 27, 2017, 06:58:40 AM »
Surely there is a way to do this that I'm missing.

I have an FSM with 10 arrays on it, each containing level objectives for levels.

Based on the name of the current level, I want it to select which array, and based on the requested objective, select and store the index from that array.

Is there such a thing as an "array switch," where it chooses which array to get info from based on a string or something? What am I missing?

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Select the Array based on a string?
« Reply #1 on: January 27, 2017, 07:24:23 AM »
the array's name is a string, can you use that?

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Select the Array based on a string?
« Reply #2 on: January 27, 2017, 07:31:55 AM »
Yes, you should be able to use the array's reference as a string.