No announcement yet.

Possible to set a variable, using a variable name?

  • Filter
  • Time
  • Show
Clear All
new posts

    Possible to set a variable, using a variable name?

    I'm looking to set the value of a variable within a loop. I'm currently working on a chess level and, while I can get it to work the way I want to - it is going to be giant in Kismat. I was wondering if I could do something like this

    while loop begins
    while loop checks for legal moves
    if it finds one it sets the variable LegalMove1 to that spot
    if it finds a second one it sets the variable LegalMove2 to that spot...
    ends the loop

    Basically I'm asking if there is a way to create and use an integer array in Kismat. If not, I can work around it - just a lot of tedious work (a real bummer when I have to go back and fix/alter something too).

    Does this help?


      Nah, I appreciate the help though! Using the SetVar function in Kismet I can set a specific variable to a specific value, but I want to set a dynamically named variable. For instance:

      While X < 57 DO
      SetVar LegalMove[X] = True
      X = X + 1

      That sort of logic, so when I have 56 variables I want to set - I don't have to draw out 56 different functions in Kismet. Thats how I tried doing it this afternoon actually (doing an individual check for each legal move) but I managed to fill up the allotted space in Kismet with all the different functions I need to accomplish.