Use an expression to see if an attribute is unequal to a number
hiddevandijk
Member Posts: 17
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.
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
-
KevinCross London, UKPosts: 1,894If 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