Making rules with table values?
RubiWorks
Member Posts: 130
Hello i´m trying to make a comparison about...
Rule
----
Attribute: tableCellValue(game.mytable,row,colum) = 0
then make anything
But is imposible with GS. Any idea or solution if i want to have everything in tables and i want to save memory?
Regards
Rule
----
Attribute: tableCellValue(game.mytable,row,colum) = 0
then make anything
But is imposible with GS. Any idea or solution if i want to have everything in tables and i want to save memory?
Regards
Comments
1. Create an integer attribute called game.ZERO and make its value zero. Then use game.ZERO on the left side of the rule condition and a tableCellValue expression on the right side.
2. Create an attribute that matches the table cell type (e.g. if you have integer cells, make it an integer attribute; if you have real cells, make it a real attribute, etc.). Assign the value of the tableCellValue to that attribute before the rule:
Change/Constrain Attribute game.theCell to tableCellValue(game.mytable,row,column)
When attribute game.theCell = 0
[behaviors]
The next version of GameSalad should have left-side table expression compatibility.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1.Make an attribute called game.cellvalue or actor.cellvalue.
2. Constrain game.cellvalue to tableCellValue(game.mytable,row,colum).
3. Use game.cellvalue as a tableCellValue(game.mytable,row,colum) in the rule.
The problem is that i´m noob about what is the best way to save memory and optimize a game then maybe i use a lot of resourses
A bigger hug
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User