using tables as a rule attribute
digitalzero
Member, BASIC Posts: 639
so i have the tables set up for my weapon unlocking system but i dont know how to call that tables specific row and column to have it set up as a rule
for instance if i wanna call table "guns" and i want row 1 and column 13 and if thats true i would like it to do something... i hope im explaining this right lol.
Comments
In the Expression Editor, you'll want to use some of the Table Functions. In the case you describe you'd probably want to use "tableCellValue".
When you use that you choose the table name, row, and column so you can find the value of that column and if it is 'true' (or whatever) you can do your action.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
its only giving me numeric expression and text expression @jamie_c so how do i use the expression editior to create a rule
You dont make a rule inside a table, you use a rule to modularly call aspects of the table to fill it out. I think thats what you've been asking, am I correct?
exactly!
@tosanu how am i able to do this?
Use a numeric expression. Boolean attributes have numerical values (0=false, 1=true).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
To be honest, it depends heavily on the rule. Tables let you use text(can be used to designate, say, picture titles), booleans, integerrs and real numbers, so their purpose is to be a multi-lined list of needed information.
You mention weapon unlocking. The most common way ive seen people do this is to give each weapon actor a WeaponNumber that corresponds to a table row, and put an UNLOCKED? Boolean into hat table. So that when you gain the weapon in some form, the rule will flip the boolean with ChangeTableValue, and then you can use TableCellValue(Table, WeaponNumber, column) to check the weapon number of each item to see if it is unlocked, and put pretty much all of the rules within a wrapper that requires the unlock.