TableCellValue as Rule condition & having change attribute problem

TheGabfatherTheGabfather Member Posts: 633
edited September 2012 in Working with GS (Mac)
Hi Guys,
(1) Is it possible to use a TableCellValue as the attribute to be checked with using Rules?
Right now I'm making do with a custom attribute inside an actor that keeps note of the cell value, then this is what I enter inside the Rule's condition. But I find that it'd be easier if I can check for the cell value itself as my game's elements are heavily dependent on the values within my table(s).

(2) Also, when I have an actor with just a Change Attribute behavior, does it always check the attribute? As in at all times, like a listener in programming? I ask because:
- I have an actor's attribute that changes value based on a certain table cell's value.
- Then I have an actor that checks the previous actor's attribute, which determines what it would do (in this case, a change in Display Text).

However the 2nd actor doesn't change immediately. In viewer, after changing the first actor's value, the second actor's Display Text remains the same. Then I refresh viewer and voila, the second actor's Display Text finally changes to the correct one. But it still required a refresh of the viewer :|

Thanks! Any help would be greatly appreciated!
If anyone requests for it, I can write a more in-depth pseudocode of my actors' scenario.

Comments

  • micksolomicksolo Member Posts: 264
    to answer the first part of your question, the answer is no. you cannot reference a table cell value as the first part of a rule. I also came across this in my current game and it's quite annoying, especially if you're making an RPG type game. I'd hope this would only be a small feature to add to the next version but we've been waiting years for little things like this so I don't expect it any time soon.

    The best way around it is like you mentioned, create a new attribute and constrain it to the value of that cell, then you can compare the 2.

    To answer part b) change attribute will not always change, you should probably use a constrain attribute instead, depending on the rule you could also use change attribute but the rule that governs it needs to reference something else that changes.

    I found a good way to do it (for integers) is if game.x > 0 then change attribute game.y

    then it should check each time the number changes.
  • JGary321JGary321 Member Posts: 1,246
    The IS a way to search in Tables however it is tedious & will only work in some situations. I put up a tutorial.. http://forums.gamesalad.com/discussion/48942/yes-you-can-search-tables-under-50-cells
  • TheGabfatherTheGabfather Member Posts: 633
    @micksolo Thanks for the feedback! Yes, I guess right now I should stick with making use of a custom attribute. After all, I'm only checking 1 cell if it's boolean true or false. And will definitely try out using constrain attributes when I get the chance.

    Thanks for the tut link @JGary321 , although I think the solution there's a bit advanced for my needs :)) but it certainly gave me an idea for a game I'm currently brainstorming on! Now I'm just worried about using Timers. Hopefully, they don't dwindle down performance, especially for the older iPhone units.

    Thanks guys!
Sign In or Register to comment.