Use an expression to see if an attribute is unequal to a number

Hi there,

I have created a simple table (1 row, 3 columns) to store generated data. At start all columns are empty.
Now my question:

First I gererate one index value (between 1-26) that corresponds to a letter of the alpabet. I use this later on to lookup that value using another table that contains the alpabet letters and change textures and images etc. I then randomly save this value temporarely to one of the columns in my table. This works so far. But now the tricky part...

Can I make a rule that then fills in the other 2 cells/columns, using other letters of the alphabet than the one genrated before. I know where the first value went into, as I created an game attribute for this.

I would like to use a formula that uses an if statment with an unequal to statement, but I cannot seem to create such expression.

Kind regards,

Hidde.

Best Answer

  • KevinCrossKevinCross London, UKPosts: 1,894
    edited September 2013 Accepted Answer
    If you're using tables, you could create a copy of the letters table, remove the row for the letter chosen, and then pick a random row from the table which will be one of the last 25 letters. Use tablerowcount in the random max number I.e.

    tablecellvalue(table name, random(1, tablerowcount(table name)), column with the letter in)

    Remember to remove the 2nd chosen letter before the 3rd one is picked

    Let me know if this isn't clear

Answers

  • hiddevandijkhiddevandijk Member Posts: 17
    Clever. let me try this now. Thanks so far!
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    You could use the same to pick your first letter too, you'll just need to copy the table before the first letter otherwise you'll eventually run out of letters, unless that's what you want
  • hiddevandijkhiddevandijk Member Posts: 17
    edited September 2013
    I did just that. This method is perfect! =D>
Sign In or Register to comment.