Issues with comparing table information with attribute value

RedCatRedCat Member Posts: 26
edited May 2012 in Working with GS (Mac)
Hi Guys,

I've encountered a strange one, and was wondering if anyone has seen and resolved similar issues.

Very simply I've got a table of shop values and have an integer attribute for players cash. All I want to do is se if the player can afford the item.

In the rule I'm saying:

attribute (player_cash) if equal or greater than "tableCellValue( game.shop , game.Whatshop ,3)"

game.shop being the name of the table
game.Whatshop being an attribute that defines which row to use (though just using any number here doesn't help)
3 being the column the item is in.

It not only doesn't display, or say "invalid_expression" it actually causes actors to change position in the scene and other completely unrelated actors, like HUD elements to not display at all.

What's even more strange is I use a very similar rule to take the money from the player and this works fine:

"game.player_cash -tableCellValue( game.shop , game.Whatshop ,3)"

help much appreciated as I can't think of another way to compare these 2 values to define if the action and be completed.

Answers

  • RedCatRedCat Member Posts: 26
    Thanks!

    I might try this in a fresh project, see if I encounter the same issue. I've already tried deleting and recreating this rule a number of times, and always with the same results.

    If I encounter this in a clean, small project how would I get it over to you to take a look?
  • RedCatRedCat Member Posts: 26
    OK, did the same thing in a clean project and still FUBAR. will email you this project now. =)
  • RedCatRedCat Member Posts: 26
    think I've sussed it. it's because the table is using a "text" type for the column rather than a real or integer...
  • RedCatRedCat Member Posts: 26
    this is a bit annoying though as changing all columns to Real loses the item names from the first row, which are referenced in the shop buttons. Moving these item names to a "text" column will be somewhat confusing to navigate and change later
Sign In or Register to comment.