Im doing a large item database in a table and i need to use a column text attribute in a rule condition, but i dont know how.
Comments
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
edited March 2013
We REALLY need this feature ^ ... Sigh
You cannot grab the cell from a table in a rule, currently. When you need to do is constrain or grab the value of the table and put that into another game attribute. Then reference that attribute in your rule.
If you must use tableCellValue in your rule conditions make a game attribute called ConstantZero which equals 0. When game.ConstantZero = (other expression)-tableCellValue()...
If you must use tableCellValue in your rule conditions make a game attribute called ConstantZero which equals 0. When game.ConstantZero = (other expression)-tableCellValue()...
a = b => 0 = b-a
It could be that it's 2AM for me right now, but I'm not quite understanding the method to your madness...and I really wish I did. My app will end up having several hundred attributes unless I could retask my behaviors to work with tables. Would you be able to give some more examples with your formula?
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
Ah, I see. Very nice work-around. I'll definitely take a close look at my app and see how long it'll take me to re-work what I already have built into multiple attributes.
On another note, though, do you have any clever solutions to cells/colums that are not integers or real values? Several of my tables would use text.
Comments
You cannot grab the cell from a table in a rule, currently. When you need to do is constrain or grab the value of the table and put that into another game attribute. Then reference that attribute in your rule.
a = b => 0 = b-a
e.g. If you wanted:
If tableCellValue(myTable,2,3) > 56
Instead try,
If game.ConstantZero > 56 - tableCellValue(myTable,2,3)
if levelScore > tableCellValue(tblLevelSettings,currentLeve,2)
then do this
On another note, though, do you have any clever solutions to cells/colums that are not integers or real values? Several of my tables would use text.