using tables as a rule attribute

digitalzerodigitalzero 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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • digitalzerodigitalzero Member, BASIC Posts: 639

    its only giving me numeric expression and text expression @jamie_c so how do i use the expression editior to create a rule

  • TosanuTosanu Member, PRO Posts: 388

    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?

  • digitalzerodigitalzero Member, BASIC Posts: 639

    exactly!

  • digitalzerodigitalzero Member, BASIC Posts: 639

    @tosanu how am i able to do this?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2014

    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

  • TosanuTosanu Member, PRO Posts: 388

    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.

Sign In or Register to comment.